Commit 0cac1f5d authored by Charles G Waldman's avatar Charles G Waldman
Browse files

Merge branch 'feature-fluid-inflow-type' into 'main'

Add Equation input for fluid velocity

See merge request !221
parents dca52a8b 06ee0597
Loading
Loading
Loading
Loading
Loading
+28 −22
Changes for docs/source_docs/user_guide/inputs/boundary_conditions.rst: 28 added lines, 22 removed lines.
Original line number Diff line number Diff line
@@ -65,22 +65,28 @@ using the prefix ``bc.[region_name].[fluid_name]``:
+------------------------+------------------------------------------------------------------------+-------------+-----------+
| temperature            | Fluid temperature [required if bc type is ``mi`` or ``pi``]            | Real        | None      |
+------------------------+------------------------------------------------------------------------+-------------+-----------+
| velocity               | Velocity components [required if bc type is ``mi``                     | Reals       | None      |
|                        | and ``volflow`` or ``massflow`` not specified]                         |             |           |
| species.[species_name] | Mass fraction of ``species_name`` [required if ``solve_species``       | Real        | None      |
|                        | is enabled and bc type is ``mi`` or ``pi``].  Must be a fluid species. |             |           |
+------------------------+------------------------------------------------------------------------+-------------+-----------+
| volflow                | Volumetric flow rate [required if bc type is ``mi``                    | Real        | None      |
|                        | and ``velocity`` or ``massflow`` not specified]                        |             |           |
| normal                 | Specify the flow direction for mass inflows. Providing a normal is     | Reals<3>    | None      |
|                        | optional with all flows applying the boundary normal by default.       |             |           |
+------------------------+------------------------------------------------------------------------+-------------+-----------+
| massflow               | Mass flow rate [required if bc type is ``mi``                          | Real        | None      |
|                        | and ``velocity`` or ``volflow`` not specified]                         |             |           |
| inflow_type            | Specify the mass inflow ``mi`` type. Options:                          | String      | None      |
|                        |                                                                        |             |           |
|                        | * ``velocity`` - Velocity magnitude.                                   |             |           |
|                        | * ``volflow`` - Volumetric flow rate.                                  |             |           |
|                        | * ``massflow`` - Mass flow rate.                                       |             |           |
+------------------------+------------------------------------------------------------------------+-------------+-----------+
| species.[species_name] | Mass fraction of ``species_name`` [required if ``solve_species``       | Real        | None      |
|                        | is enabled and bc type is ``mi`` or ``pi``].  Must be a fluid species. |             |           |
| velocity               | Specify the velocity magnitude as a constant or as a function of       | Equation    | None      |
|                        | space and/or time: f(x,y,z,t).                                         |             |           |
+------------------------+------------------------------------------------------------------------+-------------+-----------+
| volflow                | Specify the volumetric flow rate as a constant or as a function of     | Equation    | None      |
|                        | time: f(t).                                                            |             |           |
+------------------------+------------------------------------------------------------------------+-------------+-----------+
| massflow               | Specify the mass flow rate as a constant or as a function of           | Equation    | None      |
|                        | time: f(t).                                                            |             |           |
+------------------------+------------------------------------------------------------------------+-------------+-----------+

Note that for a ``mi`` only one of ``velocity`` or ``volflow`` or ``massflow`` should be specified.
Additionally, velocity can be specified as a vector or a scalar, the latter of which is applied
normal to the inflow plane, as with volflow and massflow.

Below is an example for specifying boundary conditions for fluid (``fluid``).

@@ -90,11 +96,12 @@ Below is an example for specifying boundary conditions for fluid (``fluid``).

   bc.inflow = mi
   bc.inflow.fluid.density     =  1.0
   bc.inflow.fluid.velocity    =  0.015  0.0  0.0
   bc.inflow.fluid.temperature =  300
   bc.inflow.fluid.species.O2  =  0.0
   bc.inflow.fluid.species.CO  =  0.5
   bc.inflow.fluid.species.CO2 =  0.5
   bc.inflow.fluid.inflow_type =  velocity
   bc.inflow.fluid.velocity    =  0.015

   bc.outflow = po

@@ -122,7 +129,8 @@ Below is an example where only specific cells are imposed a velocity inflow in t
   bc.eb-flow.eb.normal_tol = 3.0
   bc.eb-flow.eb.normal =  0.9848  0.0000  0.1736  # 10 deg

   bc.eb-flow.my_fluid.velocity = 0.1  0.0  0.0
   bc.eb-flow.my_fluid.inflow_type = velocity
   bc.eb-flow.my_fluid.velocity = 0.1


.. _InputsBCSolids:
@@ -269,15 +277,15 @@ the prefix ``bc.[region_name].[solid_name].density``:
Transient boundary conditions
-----------------------------

Velocity, temperature, and pressure boundary conditions may also be specified as a
function of time simply by adding a new column. The time value is entered in the
Temperature and species boundary conditions may also be specified as a
function of time by adding a new column. The time value is entered in the
new first column. We can make the `mi` boundary condition above time-dependent
by replacing:

.. code-block:: none

   bc.inflow.fluid.velocity    =  0.0  0.0    0.0  0.0
   bc.inflow.fluid.velocity    =  3.0  0.015  0.0  0.0
   bc.inflow.fluid.inflow_type = velocity
   bc.inflow.fluid.velocity    = "max(t/3., 1.)*0.015"

   bc.inflow.fluid.temperature =  0.0  300
   bc.inflow.fluid.temperature =  2.99 300
@@ -286,11 +294,9 @@ by replacing:
   bc.inflow.fluid.temperature =  4.01 300

In the above example, the inflow velocity is accelerated from zero to its
final value over a period of three seconds. Linear interpolation is used in
between discrete time values and held constant at the last time value. The
temperature sees an abrupt spike from 300 up to 500 at t = 3s and then back
down again after 4s. Note that the timestep is not adjusted to sync with
transient BCs.
final value over a period of three seconds. The temperature sees an abrupt
spike from 300 up to 500 at t = 3s and then back down again after 4s.
Note that the timestep is not adjusted to sync with transient BCs.

.. figure:: ./images/transient-bc.png
   :height: 4in
+2 −1
Changes for docs/source_docs/user_guide/inputs/chemical_reactions.rst: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -361,7 +361,8 @@ to chemical reactions.
  bc.regions = inflow  outflow

  bc.inflow = mi
  bc.inflow.fluid.velocity      = 0.015  0.0  0.0
  bc.inflow.fluid.inflow_type = velocity
  bc.inflow.fluid.velocity      = 0.015
  bc.inflow.fluid.temperature   = 1273.
  bc.inflow.fluid.species.CH4   = 0.1
  bc.inflow.fluid.species.H2    = 0.2
+6 −3
Changes for docs/source_docs/user_guide/inputs/fluid_model.rst: 6 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -580,7 +580,8 @@ are not solved.
   bc.inlet = mi
   bc.inlet.fluid0.density  =  1.0

   bc.inlet.fluid0.velocity =  1.0e-8  0.0  0.0
   bc.inlet.fluid0.inflow_type = velocity
   bc.inlet.fluid0.velocity =  1.0e-8

   bc.outlet = po
   bc.outlet.fluid0.pressure =  0.
@@ -635,7 +636,8 @@ pressure when evaluating the equation of state.

   bc.inlet = mi

   bc.inlet.fluid0.velocity =  1.0e-8  0.0  0.0
   bc.inlet.fluid0.inflow_type = velocity
   bc.inlet.fluid0.velocity =  1.0e-8

   bc.inlet.fluid0.temperature = 300.0

@@ -703,7 +705,8 @@ thermodynamic pressure for the system.

   bc.inlet = mi

   bc.inlet.fluid0.velocity =  1.0e-8  0.0  0.0
   bc.inlet.fluid0.inflow_type = velocity
   bc.inlet.fluid0.velocity =  1.0e-8

   bc.inlet.fluid0.temperature = 300.0

+2 −1
Changes for docs/source_docs/user_guide/inputs/species.rst: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -451,7 +451,8 @@ outflow boundary condition pressure which is set here to 1 atmosphere.

   bc.inlet = mi

   bc.inlet.fluid.velocity =  1.0e-8  0.0  0.0
   bc.inlet.fluid.inflow_type = velocity
   bc.inlet.fluid.velocity =  1.0e-8

   bc.inlet.fluid.species.N2   = 0.77
   bc.inlet.fluid.species.O2   = 0.23