From e963dfb8a181a4e4cfed59ddb168b29f20a5e746 Mon Sep 17 00:00:00 2001 From: Jordan Musser Date: Fri, 5 Jun 2026 08:26:36 -0400 Subject: [PATCH] Add Equation input for fluid velocity --- .../user_guide/inputs/boundary_conditions.rst | 50 +++++++++++-------- .../user_guide/inputs/chemical_reactions.rst | 3 +- .../user_guide/inputs/fluid_model.rst | 9 ++-- .../source_docs/user_guide/inputs/species.rst | 3 +- 4 files changed, 38 insertions(+), 27 deletions(-) diff --git a/docs/source_docs/user_guide/inputs/boundary_conditions.rst b/docs/source_docs/user_guide/inputs/boundary_conditions.rst index c0c8f38..364c6fe 100644 --- a/docs/source_docs/user_guide/inputs/boundary_conditions.rst +++ b/docs/source_docs/user_guide/inputs/boundary_conditions.rst @@ -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 diff --git a/docs/source_docs/user_guide/inputs/chemical_reactions.rst b/docs/source_docs/user_guide/inputs/chemical_reactions.rst index 6e7cac3..11c6f2b 100644 --- a/docs/source_docs/user_guide/inputs/chemical_reactions.rst +++ b/docs/source_docs/user_guide/inputs/chemical_reactions.rst @@ -348,7 +348,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 diff --git a/docs/source_docs/user_guide/inputs/fluid_model.rst b/docs/source_docs/user_guide/inputs/fluid_model.rst index 74d4832..f553de5 100644 --- a/docs/source_docs/user_guide/inputs/fluid_model.rst +++ b/docs/source_docs/user_guide/inputs/fluid_model.rst @@ -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 diff --git a/docs/source_docs/user_guide/inputs/species.rst b/docs/source_docs/user_guide/inputs/species.rst index e89b034..1c5c464 100644 --- a/docs/source_docs/user_guide/inputs/species.rst +++ b/docs/source_docs/user_guide/inputs/species.rst @@ -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 -- GitLab