From 8f390dee9b001a5626f126c5a4f6da737acafd85 Mon Sep 17 00:00:00 2001 From: Jordan Musser Date: Mon, 18 Mar 2024 12:04:31 -0400 Subject: [PATCH 1/2] Clean up species definition inputs --- .../user_guide/inputs/species_defs.rst | 328 +++++++++++++----- 1 file changed, 234 insertions(+), 94 deletions(-) diff --git a/docs/source_docs/user_guide/inputs/species_defs.rst b/docs/source_docs/user_guide/inputs/species_defs.rst index 9abd71a..d53c595 100644 --- a/docs/source_docs/user_guide/inputs/species_defs.rst +++ b/docs/source_docs/user_guide/inputs/species_defs.rst @@ -1,105 +1,245 @@ Species definitions =================== +The following inputs are defined using the ``species`` prefix. + ++--------------------------+------------------------------------------------------------------------+----------+-----------+ +| | Description | Type | Default | ++==========================+========================================================================+==========+===========+ +| solve | Specified name of the species or None to disable the | String | None | +| | species solver. The name assigned to the species | | | +| | solver is used to specify species inputs. | | | ++--------------------------+------------------------------------------------------------------------+----------+-----------+ +| diffusivity | Fluid species diffusivity model. | String | None | +| | | | | +| | * ``constant`` a constant diffusion coefficient is used for | | | +| | all fluid species. | | | +| | | | | ++--------------------------+------------------------------------------------------------------------+----------+-----------+ +| diffusivity.constant | Constant species diffusivity -- required for | Real | 0 | +| | ``constant`` diffusivity model | | | +| | | | | ++--------------------------+------------------------------------------------------------------------+----------+-----------+ +| specific_heat | Species specific heat model. This setting only applies if either | String | None | +| | ``fluid.specific_heat = mixture`` or | | | +| | ``solids.specific_heat = mixture`` | | | +| | | | | +| | * ``constant`` a constant specific heat is defined for each species | | | +| | and a *mixture* specific heat is computed based on the fluid or | | | +| | particle composition. | | | +| | | | | +| | * ``NASA7-poly`` the specific heat of each species is defined by two | | | +| | polynomials that are a function of temperature, then a *mixture* | | | +| | specific heat is computed based on the fluid or particle | | | +| | composition. One polynomial defines the specific across the low | | | +| | temperature range while the second defines the specific heat across | | | +| | the high temperature range. | | | +| | | | | +| | NASA7 polynomial format: | | | +| | | | | +| | :math:`c_p(T) = \sum_{i=0}^5 a_iT^i` | | | +| | | | | ++--------------------------+------------------------------------------------------------------------+----------+-----------+ + + +The following inputs are for each species defined using the ``species.[species name]`` prefix. + ++--------------------------+------------------------------------------------------------------------+----------+-----------+ +| | Description | Type | Default | ++==========================+========================================================================+==========+===========+ +| molecular_weight | Molecular weight of species. Required for mixture molecular weight | Real | 0 | +| | model and when including chemical reactions. | | | ++--------------------------+------------------------------------------------------------------------+----------+-----------+ +| specific_heat.constant | Constant species specific heat. Required for all fluid (solids) | Real | 0 | +| | species if the fluid (solids) ``specific_heat = mixture`` and the | | | +| | specific heat model is ``constant`` | | | ++--------------------------+------------------------------------------------------------------------+----------+-----------+ +| specific_heat.NASA7.a[i] | Species specific heat polynomial coefficients. Required for all fluid | Real | 0. 0. | +| | (solids) species if the fluid (solids) ``specific_heat = mixture`` | | | +| | and the specific heat model is ``NASA7-poly`` | | | +| | | | | +| | Each polynomial is defined by six coefficients (``a0`` .. ``a5``), and | | | +| | two values are required for each coefficient. The first value is the | | | +| | low temperature polynomial coefficient and the second is the | | | +| | coefficient for the high temperature polynomial. A total of twelve | | | +| | coefficients are required. | | | +| | | | | ++--------------------------+------------------------------------------------------------------------+----------+-----------+ +| enthalpy_of_formation | Enthalpy of formation of species. This input is required only when | Real | 0 | +| | the specific heat model is ``constant`` and chemical reactions | | | +| | are defined. | | | ++--------------------------+------------------------------------------------------------------------+----------+-----------+ + + + +Example inputs +-------------- + +Fluid species as passive scalars +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +In the following example, two species are defined and assigned to the fluid. We are required +to define the species diffusivity and initial and boundary conditions. The +``IncompressibleFluid`` constraint is used, and the fluid density and species mass fractions +are defined in the initial and boundary conditions. +The fluid energy equation is not solved, and because we are not updating fluid density, the +local species concentrations do not effect the fluid. + + +.. code-block:: bash + :caption: Snippet of inputs defining species as passive tracers. This is not a complete input file. + + mfix.constraint_type = IncompressibleFluid + + mfix.advect_density = 0 + mfix.solve_species = 1 + mfix.advect_enthalpy = 0 + + + # Species model settings + # ----------------------------------------------------------------------- + species.solve = N2 O2 -Enabling the species mass fraction solver and specifying species model options. - -+----------------------+-------------------------------------------------------------------------+----------+-----------+ -| | Description | Type | Default | -+======================+=========================================================================+==========+===========+ -| species.solve | Specified name of the species or None to disable the species solver. | String | None | -| | The name assigned to the species solver is used to specify species | | | -| | inputs. | | | -+----------------------+-------------------------------------------------------------------------+----------+-----------+ - - -The following inputs must be preceded by the "species." prefix - -+-------------------------------------------+-------------------------------------------------------+----------+-----------+ -| | Description | Type | Default | -+===========================================+=======================================================+==========+===========+ -| [specie0].molecular_weight | Value of species molecular weight. [required if | Real | 0 | -| | fluid.molecular_weight='mixture']. | | | -+-------------------------------------------+-------------------------------------------------------+----------+-----------+ -| diffusivity | Specify which diffusivity model to use for species | String | None | -| | [required]. | | | -| | Available options include: | | | -| | | | | -| | * 'constant' for constant diffusivity model | | | -+-------------------------------------------+-------------------------------------------------------+----------+-----------+ -| diffusivity.constant | Value of constant species diffusivity. [required if | Real | 0 | -| | diffusivity_model='constant']. | | | -+-------------------------------------------+-------------------------------------------------------+----------+-----------+ -| specific_heat | Specify which specific heat model to use for species | String | None | -| | [required if fluid.molecular_weight='mixture']. | | | -| | Available options include: | | | -| | | | | -| | * 'constant' for constant specific heat model | | | -| | * 'nasa7-poly' for NASA7 Polynomials model | | | -+-------------------------------------------+-------------------------------------------------------+----------+-----------+ -| [specie0].specific_heat.constant | Value of constant species diffusivity. [required if | Real | 0 | -| | diffusivity model='constant']. | | | -+-------------------------------------------+-------------------------------------------------------+----------+-----------+ -| [specie0].specific_heat.NASA7.a[i] | Value of i-th coefficient, with i=0,..,6 for NASA7 | Real | 0 | -| | polynomial coefficient [required if specific heat | | | -| | model='NASA7-Poly']. | | | -+-------------------------------------------+-------------------------------------------------------+----------+-----------+ -| [specie0].enthalpy_of_formation | Value of constant enthalpy of formation. [required if | Real | 0 | -| | specific heat model='constant']. | | | -+-------------------------------------------+-------------------------------------------------------+----------+-----------+ - -Below is an example for specifying species solver model options. - -.. code-block:: none - - species.solve = O2 CO CO2 Fe2O3 FeO + species.diffusivity = constant + species.diffusivity.constant = 1.9e-5 + + + # Fluid model settings + # ----------------------------------------------------------------------- + fluid.solve = fluid + + fluid.viscosity = constant + fluid.viscosity.constant = 2.0e-5 + + fluid.species = N2 O2 + + # Initial Conditions + # ----------------------------------------------------------------------- + ic.regions = full-domain + + ic.full-domain.fluid.volfrac = 1.0 + ic.full-domain.fluid.density = 1.0 + + ic.full-domain.fluid.velocity = 0.0 0.0 0.0 + + ic.full-domain.fluid.species.N2 = 0.77 + ic.full-domain.fluid.species.O2 = 0.23 + + # Boundary Conditions + # ----------------------------------------------------------------------- + bc.regions = inlet outlet + + bc.inlet = mi + bc.inlet.fluid.volfrac = 1.0 + bc.inlet.fluid.density = 1.0 + + bc.inlet.fluid.velocity = 1.0e-8 0.0 0.0 + + bc.inlet.fluid.species.N2 = 0.77 + bc.inlet.fluid.species.O2 = 0.23 + + bc.outlet = po + bc.outlet.fluid.pressure = 0. + + +Fluid as mixture +^^^^^^^^^^^^^^^^ + +In this example, the fluid is treated as a mixture of two species and the +``IdealGasOpenSystem`` constraint is used. Because we are solving the +energy equation, the fluid thermal conductivity is provided and the +specific heats for both species are needed. The species specific heat +model is set to ``NASA7-poly``; therefore 12 coefficients (6 low-temperature range +coefficients and 6 high-temperature range coefficients) are defined for each species. +Additionally, species molecular weights are provided to compute the mixture +molecular weights needed to evaluate the ideal-gas equation of state. + +Fluid temperature is specified by the initial and boundary conditions, and unlike +the previous example, density is no longer provided. Instead, the ideal gas +equation of state is used to compute density from temperature, fluid composition, +and the thermodynamic pressure. The thermodynamic pressure is taken as the +outflow boundary condition pressure which is set here to 1 atmosphere. + +.. code-block:: bash + :caption: Snippet of inputs defining fluid as a mixture with ``NASA7-poly`` specific heat model. This is not a complete input file. + + mfix.constraint_type = IdealGasOpenSystem + + mfix.advect_density = 1 + mfix.solve_species = 1 + mfix.advect_enthalpy = 1 + + # Species model settings + # ----------------------------------------------------------------------- + species.solve = N2 O2 species.diffusivity = constant - species.diffusivity.constant = 1.9e-5 + species.diffusivity.constant = 1.9e-5 + + species.O2.molecular_weight = 31.99880e-3 + species.N2.molecular_weight = 28.01340e-3 species.specific_heat = NASA7-poly # Oxygen species.O2.molecular_weight = 31.99880e-3 - species.O2.specific_heat.NASA7.a0 = 3.78245636E+00 3.66096065E+00 - species.O2.specific_heat.NASA7.a1 = -2.99673416E-03 6.56365811E-04 - species.O2.specific_heat.NASA7.a2 = 9.84730201E-06 -1.41149627E-07 - species.O2.specific_heat.NASA7.a3 = -9.68129509E-09 2.05797935E-11 - species.O2.specific_heat.NASA7.a4 = 3.24372837E-12 -1.29913436E-15 - species.O2.specific_heat.NASA7.a5 = -1.06394356E+03 -1.21597718E+03 - - # Carbon monoxide - species.CO.molecular_weight = 28.01040e-3 - species.CO.specific_heat.NASA7.a0 = 3.57953350E+00 3.04848590E+00 - species.CO.specific_heat.NASA7.a1 = -6.10353690E-04 1.35172810E-03 - species.CO.specific_heat.NASA7.a2 = 1.01681430E-06 -4.85794050E-07 - species.CO.specific_heat.NASA7.a3 = 9.07005860E-10 7.88536440E-11 - species.CO.specific_heat.NASA7.a4 = -9.04424490E-13 -4.69807460E-15 - species.CO.specific_heat.NASA7.a5 = -1.43440860E+04 -1.42661170E+04 - - # Carbon dioxide - species.CO2.molecular_weight = 44.00980e-3 - species.CO2.specific_heat.NASA7.a0 = 2.35681300E+00 4.63651110E+00 - species.CO2.specific_heat.NASA7.a1 = 8.98412990E-03 2.74145690E-03 - species.CO2.specific_heat.NASA7.a2 = -7.12206320E-06 -9.95897590E-07 - species.CO2.specific_heat.NASA7.a3 = 2.45730080E-09 1.60386660E-10 - species.CO2.specific_heat.NASA7.a4 = -1.42885480E-13 -9.16198570E-15 - species.CO2.specific_heat.NASA7.a5 = -4.83719710E+04 -4.90249040E+04 - - # Hematite - species.Fe2O3.molecular_weight = 159.68820e-3 - species.Fe2O3.specific_heat.NASA7.a0 = 1.52218166E-01 2.09445369E+01 - species.Fe2O3.specific_heat.NASA7.a1 = 6.70757040E-02 0.00000000E+00 - species.Fe2O3.specific_heat.NASA7.a2 = -1.12860954E-04 0.00000000E+00 - species.Fe2O3.specific_heat.NASA7.a3 = 9.93356662E-08 0.00000000E+00 - species.Fe2O3.specific_heat.NASA7.a4 = -3.27580975E-11 0.00000000E+00 - species.Fe2O3.specific_heat.NASA7.a5 = -1.01344092E+05 -1.07936580E+05 - - # Wustite - species.FeO.molecular_weight = 71.84440e-3 - species.FeO.specific_heat.NASA7.a0 = 3.68765953E+00 1.81588527E+00 - species.FeO.specific_heat.NASA7.a1 = 1.09133433E-02 1.70742829E-02 - species.FeO.specific_heat.NASA7.a2 = -1.61179493E-05 -2.39919190E-05 - species.FeO.specific_heat.NASA7.a3 = 1.06449256E-08 1.53690046E-08 - species.FeO.specific_heat.NASA7.a4 = -2.39514915E-12 -3.53442390E-12 - species.FeO.specific_heat.NASA7.a5 = -3.34867527E+04 -3.30239565E+04 + species.O2.specific_heat.NASA7.a0 = 3.78245636E+00 3.66096065E+00 + species.O2.specific_heat.NASA7.a1 = -2.99673416E-03 6.56365811E-04 + species.O2.specific_heat.NASA7.a2 = 9.84730201E-06 -1.41149627E-07 + species.O2.specific_heat.NASA7.a3 = -9.68129509E-09 2.05797935E-11 + species.O2.specific_heat.NASA7.a4 = 3.24372837E-12 -1.29913436E-15 + species.O2.specific_heat.NASA7.a5 = -1.06394356E+03 -1.21597718E+03 + + # Nitrogen + species.N2.molecular_weight = 28.01340e-3 + species.N2.specific_heat.NASA7.a0 = 3.53100528E+00 2.95257637E+00 + species.N2.specific_heat.NASA7.a1 = -1.23660988E-04 1.39690040E-03 + species.N2.specific_heat.NASA7.a2 = -5.02999433E-07 -4.92631603E-07 + species.N2.specific_heat.NASA7.a3 = 2.43530612E-09 7.86010195E-11 + species.N2.specific_heat.NASA7.a4 = -1.40881235E-12 -4.60755204E-15 + species.N2.specific_heat.NASA7.a5 = -1.04697628E+03 -9.23948688E+02 + + + # Fluid model settings + # ----------------------------------------------------------------------- + fluid.solve = fluid + + fluid.viscosity = constant + fluid.viscosity.constant = 2.0e-5 + + fluid.thermal_conductivity = constant + fluid.thermal_conductivity.constant = 0.026 + + fluid.specific_heat = mixture + + fluid.species = N2 O2 + + # Initial Conditions + # ----------------------------------------------------------------------- + ic.regions = full-domain + + ic.full-domain.fluid.volfrac = 1.0 + + ic.full-domain.fluid.velocity = 0.0 0.0 0.0 + + ic.full-domain.fluid.species.N2 = 0.77 + ic.full-domain.fluid.species.O2 = 0.23 + + ic.full-domain.fluid.temperature = 300.0 + + # Boundary Conditions + # ----------------------------------------------------------------------- + bc.regions = inlet outlet + + bc.inlet = mi + bc.inlet.fluid.volfrac = 1.0 + + bc.inlet.fluid.velocity = 1.0e-8 0.0 0.0 + + bc.inlet.fluid.species.N2 = 0.77 + bc.inlet.fluid.species.O2 = 0.23 + + bc.inlet.fluid.temperature = 300.0 + + bc.outlet = po + bc.outlet.fluid.pressure = 101325. -- GitLab From ff39ee8e6c8e116f4789a99202c29be19a2f1b1d Mon Sep 17 00:00:00 2001 From: Jordan Musser Date: Mon, 18 Mar 2024 15:11:14 -0400 Subject: [PATCH 2/2] Address Roberto's comments --- docs/source_docs/user_guide/inputs/species_defs.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source_docs/user_guide/inputs/species_defs.rst b/docs/source_docs/user_guide/inputs/species_defs.rst index d53c595..14e88f2 100644 --- a/docs/source_docs/user_guide/inputs/species_defs.rst +++ b/docs/source_docs/user_guide/inputs/species_defs.rst @@ -60,9 +60,9 @@ The following inputs are for each species defined using the ``species.[species n | | | | | | | Each polynomial is defined by six coefficients (``a0`` .. ``a5``), and | | | | | two values are required for each coefficient. The first value is the | | | -| | low temperature polynomial coefficient and the second is the | | | -| | coefficient for the high temperature polynomial. A total of twelve | | | -| | coefficients are required. | | | +| | low temperature polynomial coefficient (T < 1000K) and the second is | | | +| | the coefficient for the high temperature polynomial (T > 1000K). A | | | +| | total of twelve coefficients are required. | | | | | | | | +--------------------------+------------------------------------------------------------------------+----------+-----------+ | enthalpy_of_formation | Enthalpy of formation of species. This input is required only when | Real | 0 | @@ -83,7 +83,7 @@ to define the species diffusivity and initial and boundary conditions. The ``IncompressibleFluid`` constraint is used, and the fluid density and species mass fractions are defined in the initial and boundary conditions. The fluid energy equation is not solved, and because we are not updating fluid density, the -local species concentrations do not effect the fluid. +local species concentrations do not affect the fluid. .. code-block:: bash -- GitLab