- arrayFalseTrue to make this variable a array variable regardless of number of components. If 'components' > 1, this will automatically be set to true.
Default:False
C++ Type:bool
Controllable:No
Description:True to make this variable a array variable regardless of number of components. If 'components' > 1, this will automatically be set to true.
- blockThe list of blocks (ids or names) that this object will be applied
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:The list of blocks (ids or names) that this object will be applied
- cache_cell_gradientsTrueWhether to cache cell gradients or re-compute them.
Default:True
C++ Type:bool
Controllable:No
Description:Whether to cache cell gradients or re-compute them.
- components1Number of components for an array variable
Default:1
C++ Type:unsigned int
Controllable:No
Description:Number of components for an array variable
- face_interp_methodaverageSwitch that can select between face interpoaltion methods.
Default:average
C++ Type:MooseEnum
Controllable:No
Description:Switch that can select between face interpoaltion methods.
- familyMONOMIALSpecifies the family of FE shape functions to use for this variable.
Default:MONOMIAL
C++ Type:MooseEnum
Controllable:No
Description:Specifies the family of FE shape functions to use for this variable.
- fvTrueTrue to make this variable a finite volume variable
Default:True
C++ Type:bool
Controllable:No
Description:True to make this variable a finite volume variable
- orderCONSTANTOrder of the FE shape function to use for this variable (additional orders not listed here are allowed, depending on the family).
Default:CONSTANT
C++ Type:MooseEnum
Controllable:No
Description:Order of the FE shape function to use for this variable (additional orders not listed here are allowed, depending on the family).
- solver_sysnl0If this variable is a solver variable, this is the solver system to which it should be added.
Default:nl0
C++ Type:SolverSystemName
Controllable:No
Description:If this variable is a solver variable, this is the solver system to which it should be added.
- two_term_boundary_expansionTrueWhether to use a two-term Taylor expansion to calculate boundary face values. If the two-term expansion is used, then the boundary face value depends on the adjoining cell center gradient, which itself depends on the boundary face value. Consequently an implicit solve is used to simultaneously solve for the adjoining cell center gradient and boundary face value(s).
Default:True
C++ Type:bool
Controllable:No
Description:Whether to use a two-term Taylor expansion to calculate boundary face values. If the two-term expansion is used, then the boundary face value depends on the adjoining cell center gradient, which itself depends on the boundary face value. Consequently an implicit solve is used to simultaneously solve for the adjoining cell center gradient and boundary face value(s).
- use_dualFalseTrue to use dual basis for Lagrange multipliers
Default:False
C++ Type:bool
Controllable:No
Description:True to use dual basis for Lagrange multipliers
MooseVariableFVReal
Base class for Moose variables. This should never be the terminal object type
Overview
The MooseVariableFV
template supports creation of finite volume variable types. At the time of writing there is only one used instantiation of the template which is MooseVariableFVReal
. MOOSE uses cell-centered finite volumes which can be conveniently supported by the CONSTANT MONOMIAL
finite element type in the background.
One important parameter for MooseVariableFV
objects is two_term_boundary_expansion
. By default this is false
. When false
, boundary faces which do not have associated Dirichlet boundary conditions simply use the cell centroid value as the face value. However, when two_term_boundary_expansion
is set to true
in the Variables
sub-block of the finite volume variable, then the cell centroid value and the reconstructed cell centroid gradient (hence the two-term name) will be used to compute the extrapolated boundary face value. Note that care should be taken when setting this parameter to true
. Solving for a two-term extrapolated boundary face value requires simultaneously solving for the attached cell centroid gradient. This creates a system of equations. This system has the potential to be singular if there are multiple extrapolated boundary faces per cell; see MOOSE issue. The only time it's reasonable to expect a cell with multiple extrapolated boundary faces to yield a nonsingular system is if the vectors from the cell centroid to face centroid are parallel to the surface normals and none of the surface normals are parallel to themselves (e.g. imagine an orthogonal quad with three extrapolated boundary faces).
Example Input File Syntax
To create a MooseVariableFVReal
a user can do one of the following in their input file:
[Variables]
[u]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[v]
type = MooseVariableFVReal
[]
[]
Note that a user must specify the type
if they want to be able to set finite volume variable specific parameters like two_term_boundary_expansion
.
Functor spatial evaluation description
For background on the functor system see Functor system.
ElemArg
: returns the cell center valueElemPointArg
: returns a two term expansion that is the sum of the cell center value and the product of the distance of the point from the cell center times the cell center gradientFaceArg
: on internal faces this will return an interpolation defined by theFaceArg
limiter_type
. On external faces this will generally return a two term expansion using the cell center value and gradient unlesstwo_term_boundary_expansion
has been set tofalse
. On Dirichlet faces this will return the Dirichlet valueElemQpArg
: this forwards toElemPointArg
where thepoint
is simply the quadrature point locationElemSideQpArg
: same asElemQpArg
NodeArg
: loops over connected elements, calling to theElemPointArg
overload for each element with the node's location as thepoint
value, and performs an inverse distance weighting of the results
Input Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- eigenFalseTrue to make this variable an eigen variable
Default:False
C++ Type:bool
Controllable:No
Description:True to make this variable an eigen variable
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:No
Description:Set the enabled status of the MooseObject.
- outputsVector of output names where you would like to restrict the output of variables(s) associated with this object
C++ Type:std::vector<OutputName>
Controllable:No
Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object
- scalingSpecifies a scaling factor to apply to this variable
C++ Type:std::vector<double>
Controllable:No
Description:Specifies a scaling factor to apply to this variable
Advanced Parameters
Input Files
- (test/tests/scaling/scalar-field-grouping/test.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/heated/2d-rc-heated-effective-action.i)
- (modules/navier_stokes/test/tests/finite_volume/materials/mixture_material/mixture.i)
- (test/tests/outputs/debug/show_execution_fv_flux_objects.i)
- (modules/navier_stokes/test/tests/postprocessors/pressure_drop/drop_insfv.i)
- (modules/thermal_hydraulics/test/tests/components/flow_component_ns/flow_component_ns_pinc.i)
- (test/tests/materials/piecewise_by_block_material/discontinuous.i)
- (test/tests/transfers/multiapp_copy_transfer/linear_sys_to_aux/nonlinear_main.i)
- (modules/navier_stokes/test/tests/postprocessors/flow_rates/mass_flux_weighted_pp.i)
- (modules/porous_flow/test/tests/poroperm/PermFromPoro03_fv.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/channel-flow/2d-transient.i)
- (modules/heat_transfer/test/tests/fvbcs/fv_functor_convective_heat_flux/fv_functor_convective_heat_flux.i)
- (test/tests/scaling/resid-and-jac-together/test.i)
- (test/tests/fviks/one-var-diffusion/test.i)
- (test/tests/fvbcs/fv_functor_neumannbc/fv_functor_neumann.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/scalar_advection/mass-frac-advection.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/lid-driven-turb-non-eq-bulk.i)
- (test/tests/vectorpostprocessors/element_value_sampler/mixed_fe_fv_sampler.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/with-direction/flux_bcs-direction-action.i)
- (modules/porous_flow/test/tests/heat_advection/heat_advection_1d_fv.i)
- (modules/navier_stokes/test/tests/postprocessors/flow_rates/conservation_INSFV.i)
- (modules/porous_flow/test/tests/dispersion/diff01_fv.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/materials/2d-transient.i)
- (test/tests/postprocessors/element_integral/functors/element_integral_test.i)
- (modules/porous_flow/test/tests/fluidstate/brineco2_fv.i)
- (test/tests/vectorpostprocessors/mesh_division_functor_reduction/reduction.i)
- (modules/navier_stokes/test/tests/auxkernels/reynolds-number-functor-aux/fv.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/materials/functorfluidprops.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/straight-channel-hllc.i)
- (test/tests/auxkernels/time_derivative_aux/test_fv.i)
- (modules/navier_stokes/test/tests/finite_volume/fvbcs/FVHeatFluxBC/wall_heat_transfer.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/free-flow-hllc.i)
- (test/tests/fvkernels/vector-interpolation/test.i)
- (test/tests/fvics/function_ic/parsed_function.i)
- (test/tests/fvkernels/boundary_execution/2d.i)
- (test/tests/auxkernels/projection_aux/1d.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/regular-straight-channel.i)
- (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/rayleigh-bernard-two-phase.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/dirichlet_bcs_mdot.i)
- (modules/porous_flow/test/tests/heterogeneous_materials/constant_poroperm_fv.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_mdot.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/dc.i)
- (modules/navier_stokes/test/tests/finite_volume/materials/ergun/ergun.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_velocity.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_reversal.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/varying-eps-basic-kt-primitive.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/bfs/BFS_ERCOFTAC.i)
- (modules/porous_flow/test/tests/poroperm/PermTensorFromVar01_fv.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/porous-hllc.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/solidification/pipe_solidification.i)
- (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/lid-driven-two-phase.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/mms/porosity_change/pressure-interpolation-corrected-action.i)
- (test/tests/auxkernels/functor_elemental_gradient/functor_gradient.i)
- (test/tests/fviks/diffusion/test.i)
- (modules/navier_stokes/examples/solidification/galium_melting.i)
- (modules/navier_stokes/test/tests/finite_volume/pwcns/boundary_conditions/flux_bcs_mdot-action.i)
- (test/tests/variables/caching_fv_variables/fv_caching.i)
- (modules/porous_flow/test/tests/heat_conduction/two_phase_fv.i)
- (test/tests/misc/rename-parameters/rename-functor.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/boussinesq/wcnsfv.i)
- (test/tests/fvkernels/constraints/bounded_value.i)
- (test/tests/auxkernels/divergence_aux/test_fv.i)
- (test/tests/fvkernels/constraints/point_value.i)
- (test/tests/fvkernels/fv_constant_scalar_advection/2D_constant_scalar_advection.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/bernoulli-1d-parsed-function.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/multiapp-scalar-transport/scalar-transport_action.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/heated/2d-transient.i)
- (modules/navier_stokes/test/tests/finite_volume/cell_value_reconst/velocity_reconst.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/basic-conserved-pcnsfv-kt.i)
- (test/tests/fviks/continuity/test.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/rotated-2d-bkt-function-porosity.i)
- (test/tests/vectorpostprocessors/positions_functor_value_sampler/positions_functor_sampler.i)
- (test/tests/fvkernels/mms/advective-outflow/kt-limited-advection.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_velocity-action.i)
- (modules/navier_stokes/test/tests/finite_volume/pwcns/channel-flow/2d-transient-gas.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/with-direction/errors/flux_bcs.i)
- (test/tests/materials/functor_properties/vector-magnitude/test.i)
- (test/tests/fvkernels/fv_simple_diffusion/grad-adaptive.i)
- (test/tests/fvics/constant_ic/constant_ic.i)
- (modules/porous_flow/test/tests/dispersion/disp01_fv.i)
- (modules/navier_stokes/test/tests/ics/pns_test.i)
- (test/tests/postprocessors/side_advection_flux_integral/side_advection_flux_integral_fv.i)
- (test/tests/bounds/constant_bounds_fv.i)
- (test/tests/postprocessors/element_extreme_functor_value/extreme_proxy_value.i)
- (modules/porous_flow/test/tests/gravity/grav02e_fv.i)
- (test/tests/materials/functor_properties/ad_conversion/1d_dirichlet.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/heated/2d-transient-action.i)
- (test/tests/fvkernels/constraints/integral_transient.i)
- (modules/heat_transfer/test/tests/gap_heat_transfer_mortar/fv_modular_gap_heat_transfer_mortar_radiation_conduction.i)
- (modules/navier_stokes/test/tests/finite_volume/pwcns/channel-flow/2d-transient-action.i)
- (test/tests/tag/tag-fv.i)
- (test/tests/functors/fe-var-for-fv-neumann/test.i)
- (test/tests/fviks/one-var-diffusion/no-ik.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/2d-scalar-transport-action.i)
- (modules/navier_stokes/test/tests/finite_volume/pwcns/channel-flow/2d-transient.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/action/errors/2d-rc-error-action.i)
- (modules/heat_transfer/test/tests/fvbcs/fv_radiative_heat_flux/test.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/rotated-2d-bkt-function-porosity-mixed.i)
- (modules/porous_flow/test/tests/pressure_pulse/pressure_pulse_1d_fully_saturated_fv.i)
- (test/tests/auxkernels/projection_aux/2d.i)
- (modules/heat_transfer/test/tests/fvbcs/fv_thermal_resistance/test_functor.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/segregated/2d-momentum.i)
- (test/tests/fvkernels/mms/advective-outflow/limited-advection.i)
- (test/tests/misc/multiple-nl-systems/test-fv.i)
- (test/tests/auxkernels/nodal_aux_var/multi_update_fv_test.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/basic-primitive-pcnsfv-kt.i)
- (test/tests/fvbcs/fv_functor_dirichlet/fv_other_side.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/lid-driven-turb-no-wall.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/lid-driven-turb-energy-wall.i)
- (test/tests/fvkernels/mms/non-orthogonal/advection-diffusion-reaction.i)
- (test/tests/fviks/diffusion/multisystem.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_direct.i)
- (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/channel-drift-flux.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/2d-rc-epsjump.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/heated/2d-rc-heated-action.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_mdot-action.i)
- (modules/navier_stokes/test/tests/finite_volume/fvbcs/FVFunctorHeatFluxBC/wall_heat_transfer.i)
- (test/tests/physics/diffusion_fv.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/varying-eps-hllc.i)
- (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/channel-drift-flux-transient.i)
- (test/tests/materials/functor_properties/1d_dirichlet.i)
- (modules/navier_stokes/test/tests/auxkernels/peclet-number-functor-aux/fv-thermal.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/pwcnsfv.i)
- (modules/navier_stokes/test/tests/ics/test_function.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/materials/2d-rc-action.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/bernoulli-1d.i)
- (test/tests/fvics/constant_ic/subdomain_constant_ic.i)
- (test/tests/fvkernels/mms/skewness-correction/adv-diff-react/skewed.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/lid-driven-turb-non-eq-wall.i)
- (modules/porous_flow/test/tests/pressure_pulse/pressure_pulse_1d_2phasePS_fv.i)
- (modules/porous_flow/test/tests/pressure_pulse/pressure_pulse_1d_2phase_fv.i)
- (test/tests/fvkernels/mms/advective-outflow/advection.i)
- (test/tests/fvkernels/mms/harmonic_interpolation/diffusion.i)
- (modules/navier_stokes/test/tests/auxkernels/liquid-fraction-aux/liquid-fraction-fv-aux.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/multiapp-scalar-transport/fluid-flow.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/solidification/solidification_no_advection.i)
- (test/tests/tag/mass-matrix.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/implicit-euler-basic-kt-primitive.i)
- (test/tests/fvkernels/constraints/integral.i)
- (test/tests/mortar/convergence-studies/fv-gap-conductance/gap-conductance.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/bernoulli-1d-functor-material.i)
- (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/channel-advection-slip.i)
- (test/tests/restart/scalar-var/part1.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/block-restriction/segregated/empty-block-segregated.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/heated/2d-rc-heated-boussinesq-action.i)
- (modules/heat_transfer/test/tests/fvbcs/fv_thermal_resistance/test.i)
- (modules/navier_stokes/examples/laser-welding/2d-fv.i)
- (test/tests/mesh/preparedness/test.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/lid-driven-turb-capped.i)
- (modules/porous_flow/test/tests/poroperm/PermFromPoro01_fv.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/mms/porosity_change/pressure-interpolation-corrected.i)
- (test/tests/materials/functor_properties/gradients/functor-gradients.i)
- (test/tests/postprocessors/side_integral/side_integral_functor.i)
- (modules/navier_stokes/test/tests/ics/test.i)
- (test/tests/materials/piecewise_by_block_material/discontinuous_functor.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/hllc.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/lid-driven-turb-std-wall.i)
- (test/tests/fvkernels/mms/non-orthogonal/extended-adr.i)
- (modules/navier_stokes/test/tests/finite_volume/controls/switch-pressure-bc/switch_vel_pres_bc.i)
- (test/tests/mesh/elem_info/elem_info.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/materials/2d-rc.i)
- (test/tests/fvkernels/fv_adapt/steady-adapt.i)
- (test/tests/functors/previous-nl-it/test.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/multiapp-scalar-transport/scalar-transport.i)
- (test/tests/fvics/file_ic/file_restart.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/lid-driven-turb-inc-wall.i)
- (modules/porous_flow/test/tests/mass_conservation/mass14.i)
- (test/tests/fvkernels/mms/skewness-correction/diffusion/skewed.i)
- (test/tests/fvkernels/mms/grad-reconstruction/mat-cartesian.i)
- (test/tests/postprocessors/interface_diffusive_flux/interface_diffusive_flux_fv.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/block-restriction/with-empty-block.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/lid-driven-turb-linear-wall.i)
- (modules/porous_flow/test/tests/heat_conduction/no_fluid_fv.i)
- (test/tests/fvkernels/mms/skewness-correction/two_term_extrapol/advection-outflow.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/lid-driven-turb-energy.i)
- (modules/porous_flow/test/tests/gravity/grav02b_fv.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/channel-flow/2d-transient-action.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/natural_convection/natural_circulation_pipe.i)
- (test/tests/auxkernels/advection_flux/advection_flux_fv.i)
- (test/tests/fvkernels/orthogonal-diffusion/orthogonal-diffusion.i)
- (test/tests/fvkernels/mms/broken-domain/diffusion.i)
- (test/tests/functors/matching-analytic-solution/test.i)
- (test/tests/functormaterials/smoother/test.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/segregated/2d-heated.i)
- (test/tests/fvkernels/mms/advective-outflow/advection-outflow.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/heated-channel/transient-porous-kt-primitive.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/varying-eps-basic-kt-mixed.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/dirichlet_bcs_velocity.i)
- (modules/porous_flow/test/tests/gravity/grav01a_fv.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/channel/channel_ERCOFTAC.i)
Child Objects
(test/tests/scaling/scalar-field-grouping/test.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 20
xmax = 2
[]
[subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '1.0 0 0'
block_id = 1
top_right = '2.0 1.0 0'
[]
[interface_primary_side]
input = subdomain1
type = SideSetsBetweenSubdomainsGenerator
primary_block = '0'
paired_block = '1'
new_boundary = 'primary_interface'
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
block = 0
initial_condition = 0.5
[]
[v]
type = MooseVariableFVReal
block = 1
initial_condition = 0.5
[]
[lambda]
type = MooseVariableScalar
[]
[]
[FVKernels]
[diff_left]
type = FVDiffusion
variable = u
coeff = 'left'
block = 0
[]
[diff_right]
type = FVDiffusion
variable = v
coeff = 'right'
block = 1
[]
[]
[FVInterfaceKernels]
[interface]
type = FVTwoVarContinuityConstraint
variable1 = u
variable2 = v
boundary = 'primary_interface'
subdomain1 = '0'
subdomain2 = '1'
lambda = 'lambda'
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = u
boundary = 'left'
value = 1
[]
[v_left]
type = FVDirichletBC
variable = v
boundary = 'right'
value = 0
[]
[]
[Materials]
[block0]
type = ADGenericFunctorMaterial
block = '0'
prop_names = 'left'
prop_values = '1'
[]
[block1]
type = ADGenericFunctorMaterial
block = '1'
prop_names = 'right'
prop_values = '1'
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm lu NONZERO'
automatic_scaling = true
off_diagonals_in_auto_scaling = true
scaling_group_variables = 'u v lambda'
verbose = true
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/heated/2d-rc-heated-effective-action.i)
mu = 1
rho = 1
cp = 1
u_inlet = 1
T_inlet = 200
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = 0
ymax = 1
nx = 100
ny = 20
[]
[left]
type = ParsedSubdomainMeshGenerator
input = gen
combinatorial_geometry = 'x > 3 & x < 6'
block_id = 1
[]
[right]
type = ParsedSubdomainMeshGenerator
input = left
combinatorial_geometry = 'x < 3'
block_id = 2
[]
[more-right]
type = ParsedSubdomainMeshGenerator
input = right
combinatorial_geometry = 'x > 6'
block_id = 3
[]
[]
[AuxVariables]
[porosity]
type = MooseVariableFVReal
initial_condition = 0.5
[]
[T_solid]
family = 'MONOMIAL'
order = 'CONSTANT'
fv = true
initial_condition = 100
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'incompressible'
porous_medium_treatment = true
add_energy_equation = true
density = ${rho}
dynamic_viscosity = ${mu}
thermal_conductivity_blocks = '1 2; 3'
thermal_conductivity = 'kappa kappa'
specific_heat = ${cp}
porosity = 'porosity'
initial_velocity = '${u_inlet} 1e-6 0'
initial_pressure = 0.0
initial_temperature = 0.0
inlet_boundaries = 'left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_function = '${u_inlet} 0'
energy_inlet_types = 'heatflux'
energy_inlet_function = '${fparse u_inlet * rho * cp * T_inlet}'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip symmetry'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '0 0'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '0.1'
ambient_convection_alpha = 'h_cv'
ambient_temperature = 'T_solid'
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
energy_advection_interpolation = 'average'
[]
[]
[FunctorMaterials]
[kappa]
type = ADGenericVectorFunctorMaterial
prop_names = 'kappa'
prop_values = '1e-3 1e-2 1e-1'
[]
[constants]
type = ADGenericFunctorMaterial
prop_names = 'h_cv'
prop_values = '1'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
[]
# Some basic Postprocessors to examine the solution
[Postprocessors]
[inlet-p]
type = SideAverageValue
variable = pressure
boundary = 'left'
[]
[outlet-u]
type = SideAverageValue
variable = superficial_vel_x
boundary = 'right'
[]
[outlet-temp]
type = SideAverageValue
variable = T_fluid
boundary = 'right'
[]
[solid-temp]
type = ElementAverageValue
variable = T_solid
[]
[]
[Outputs]
exodus = true
csv = false
[]
(modules/navier_stokes/test/tests/finite_volume/materials/mixture_material/mixture.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 5
[]
[]
[AuxVariables]
[fl]
type = MooseVariableFVReal
[]
[cp]
type = MooseVariableFVReal
[]
[k]
type = MooseVariableFVReal
[]
[]
[ICs]
[FunctionIC]
type = FunctionIC
variable = fl
function = 'x'
[]
[]
[AuxKernels]
[cp_aux]
type = FunctorAux
functor = cp_mixture
variable = cp
[]
[k_aux]
type = FunctorAux
functor = k_mixture
variable = k
[]
[]
[VectorPostprocessors]
[cp]
type = LineValueSampler
start_point = '0.1 0 0'
end_point = '0.9 0 0'
num_points = 5
variable = cp
sort_by = x
[]
[k]
type = LineValueSampler
start_point = '0.1 0 0'
end_point = '0.9 0 0'
num_points = 5
variable = k
sort_by = x
[]
[fl]
type = LineValueSampler
start_point = '0.1 0 0'
end_point = '0.9 0 0'
num_points = 5
variable = fl
sort_by = x
[]
[]
[Functions]
[cp_solid]
type = ADParsedFunction
expression = '1 - x'
[]
[cp_liquid]
type = ADParsedFunction
expression = 'x'
[]
[k_solid]
type = ADParsedFunction
expression = '2 - 3*x'
[]
[k_liquid]
type = ADParsedFunction
expression = '3*x'
[]
[]
[FunctorMaterials]
[eff_cp]
type = NSFVMixtureFunctorMaterial
phase_2_names = 'cp_solid k_solid'
phase_1_names = 'cp_liquid k_liquid'
prop_names = 'cp_mixture k_mixture'
phase_1_fraction = fl
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(test/tests/outputs/debug/show_execution_fv_flux_objects.i)
[Mesh]
[gen_mesh]
type = GeneratedMeshGenerator
dim = 1
xmin = 0
xmax = 10
nx = 50
[]
[left]
type = ParsedSubdomainMeshGenerator
input = 'gen_mesh'
combinatorial_geometry = 'x < 0.5'
block_id = '2'
[]
[middle_boundary]
type = SideSetsBetweenSubdomainsGenerator
input = 'left'
primary_block = '0'
paired_block = '2'
new_boundary = 'middle'
[]
[]
[Variables]
[v]
family = MONOMIAL
order = CONSTANT
fv = true
block = 2
[]
[u]
type = MooseVariableFVReal
[]
[]
[ICs]
[v_ic]
type = FunctionIC
variable = v
function = 'if (x > 2 & x < 3, 0.5, 0)'
[]
[]
[FVKernels]
# Twice the kernel makes it not the Burgers equation, but shows the ordering
[2_burger]
type = FVBurgers1D
variable = v
[]
[1_burgers]
type = FVBurgers1D
variable = v
[]
[time]
type = FVTimeKernel
variable = v
[]
[time_u]
type = FVTimeKernel
variable = u
[]
[]
[FVBCs]
[fv_burgers_right]
type = FVBurgersOutflowBC
variable = v
boundary = 'middle'
[]
[fv_burgers_left]
type = FVBurgersOutflowBC
variable = v
boundary = 'left'
[]
[]
[FVInterfaceKernels]
[diff_ik]
type = FVOnlyAddDiffusionToOneSideOfInterface
variable1 = 'v'
variable2 = 'u'
boundary = 'middle'
coeff2 = '1'
subdomain1 = '2'
subdomain2 = '0'
[]
[]
[Executioner]
type = Transient
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
petsc_options = '-snes_converged_reason'
nl_abs_tol = 1e-7
nl_rel_tol = 1e-8
num_steps = 1
dt = 0.05
nl_forced_its = 1
line_search = none
[]
[Debug]
show_execution_order = 'LINEAR'
[]
(modules/navier_stokes/test/tests/postprocessors/pressure_drop/drop_insfv.i)
mu=1
rho=1
advected_interp_method='average'
velocity_interp_method='rc'
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Mesh]
inactive = 'mesh internal_boundary_bot internal_boundary_top'
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '1'
dy = '1 1 1'
ix = '5'
iy = '5 5 5'
subdomain_id = '1
2
3'
[]
[internal_boundary_bot]
type = SideSetsBetweenSubdomainsGenerator
input = mesh
new_boundary = 'internal_bot'
primary_block = 1
paired_block = 2
[]
[internal_boundary_top]
type = SideSetsBetweenSubdomainsGenerator
input = internal_boundary_bot
new_boundary = 'internal_top'
primary_block = 2
paired_block = 3
[]
[diverging_mesh]
type = FileMeshGenerator
file = 'expansion_quad.e'
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = 0
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1
[]
[pressure]
type = INSFVPressureVariable
[]
[temperature]
type = INSFVEnergyVariable
[]
[]
[AuxVariables]
[advected_density]
type = MooseVariableFVReal
initial_condition = ${rho}
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
force_boundary_execution = true
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
force_boundary_execution = true
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = temperature
advected_interp_method = 'upwind'
[]
[temp_source]
type = FVBodyForce
variable = temperature
function = 10
block = 1
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'bottom'
variable = u
function = 0
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'bottom'
variable = v
function = 1
[]
[noslip-u]
type = INSFVNoSlipWallBC
boundary = 'right'
variable = u
function = 0
[]
[noslip-v]
type = INSFVNoSlipWallBC
boundary = 'right'
variable = v
function = 0
[]
[axis-u]
type = INSFVSymmetryVelocityBC
boundary = 'left'
variable = u
u = u
v = v
mu = ${mu}
momentum_component = x
[]
[axis-v]
type = INSFVSymmetryVelocityBC
boundary = 'left'
variable = v
u = u
v = v
mu = ${mu}
momentum_component = y
[]
[axis-p]
type = INSFVSymmetryPressureBC
boundary = 'left'
variable = pressure
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'top'
variable = pressure
function = 0
[]
[inlet_temp]
type = FVNeumannBC
boundary = 'bottom'
variable = temperature
value = 300
[]
[]
[FunctorMaterials]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'temperature'
rho = ${rho}
[]
[advected_material_property]
type = ADGenericFunctorMaterial
prop_names = 'advected_rho cp'
prop_values ='${rho} 1'
[]
[vel_functor]
type = ADGenericVectorFunctorMaterial
prop_names = 'velocity'
prop_values = 'u v 0'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm 200 lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-12
[]
[Postprocessors]
[pdrop_total]
type = PressureDrop
pressure = pressure
upstream_boundary = 'bottom'
downstream_boundary = 'top'
boundary = 'top bottom'
[]
[pdrop_mid1]
type = PressureDrop
pressure = pressure
upstream_boundary = 'bottom'
downstream_boundary = 'internal_bot'
boundary = 'bottom internal_bot'
[]
[pdrop_mid2]
type = PressureDrop
pressure = pressure
upstream_boundary = 'internal_bot'
downstream_boundary = 'internal_top'
boundary = 'internal_top internal_bot'
[]
[pdrop_mid3]
type = PressureDrop
pressure = pressure
upstream_boundary = 'internal_top'
downstream_boundary = 'top'
boundary = 'top internal_top'
[]
[sum_drops]
type = ParsedPostprocessor
expression = 'pdrop_mid1 + pdrop_mid2 + pdrop_mid3'
pp_names = 'pdrop_mid1 pdrop_mid2 pdrop_mid3'
[]
[p_upstream]
type = SideAverageValue
variable = pressure
boundary = 'bottom'
[]
[p_downstream]
type = SideAverageValue
variable = pressure
boundary = 'top'
[]
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/components/flow_component_ns/flow_component_ns_pinc.i)
# Operating conditions
u_inlet = 1
p_outlet = 0
[AuxVariables]
[porosity]
type = MooseVariableFVReal
initial_condition = 0.5
[]
[velocity_norm]
type = MooseVariableFVReal
[]
[]
[Components]
[comp1]
type = FlowComponentNS
file = rectangle.e
position = '0 0 0'
compressibility = 'incompressible'
porous_medium_treatment = true
density = 'rho'
dynamic_viscosity = 'mu'
initial_velocity = '${u_inlet} 0 0'
initial_pressure = '${p_outlet}'
mass_advection_interpolation = 'upwind'
momentum_advection_interpolation = 'upwind'
inlet_boundaries = 'comp1:left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_function = '${u_inlet} 0'
wall_boundaries = 'comp1:top comp1:bottom'
momentum_wall_types = 'noslip symmetry'
outlet_boundaries = 'comp1:right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${p_outlet}'
[]
[comp2]
type = FlowComponentNS
file = rectangle.e
position = '0 2 0'
compressibility = 'incompressible'
porous_medium_treatment = true
density = 'rho'
dynamic_viscosity = 'mu'
initial_velocity = '${u_inlet} 0 0'
initial_pressure = '${p_outlet}'
inlet_boundaries = 'comp2:left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_function = '${u_inlet} 0'
wall_boundaries = 'comp2:top comp2:bottom'
momentum_wall_types = 'noslip symmetry'
outlet_boundaries = 'comp2:right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${p_outlet}'
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'rho mu'
prop_values = '1 1'
[]
[]
[AuxKernels]
[speed]
type = ParsedAux
variable = 'velocity_norm'
coupled_variables = 'superficial_vel_x superficial_vel_y porosity'
expression = 'sqrt(superficial_vel_x*superficial_vel_x + superficial_vel_y*superficial_vel_y) / porosity'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu NONZERO mumps'
line_search = 'none'
nl_rel_tol = 1e-12
automatic_scaling = true
off_diagonals_in_auto_scaling = true
verbose = true
scaling_group_variables = 'superficial_vel_x superficial_vel_y'
[]
[Debug]
show_var_residual_norms = true
[]
# Some basic Postprocessors to examine the solution
[Postprocessors]
[inlet-p]
type = SideAverageValue
variable = pressure
boundary = 'comp1:left'
[]
[outlet-u]
type = SideAverageValue
variable = superficial_vel_x
boundary = 'comp1:right'
[]
[]
[Outputs]
exodus = true
[]
(test/tests/materials/piecewise_by_block_material/discontinuous.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 10
xmax = 2
[]
[subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '1.0 0 0'
block_id = 1
top_right = '2.0 1.0 0'
[]
[middle]
input = subdomain1
type = SideSetsBetweenSubdomainsGenerator
new_boundary = middle
paired_block = 1
primary_block = 0
[]
[]
[Variables]
[dummy]
type = MooseVariableFVReal
[]
[]
# This is added to have sufficient ghosting layers, see #19534
[FVKernels]
[diff]
type = FVDiffusion
variable = 'dummy'
coeff = 1
[]
[]
[AuxVariables]
[u]
type = MooseVariableFVReal
[]
[v]
type = MooseVariableFVReal
[FVInitialCondition]
type = FVFunctionIC
function = '4 * (x - 7) * (x - 8)'
[]
[]
[]
[AuxKernels]
# to trigger off-boundary element computations
[to_var]
type = ADMaterialRealAux
variable = 'u'
property = coeff
[]
[]
[Materials]
[coeff_mat]
type = ADPiecewiseConstantByBlockMaterial
prop_name = 'coeff'
subdomain_to_prop_value = '0 4
1 2'
[]
[]
[Postprocessors]
# to trigger on boundary element computations
[flux]
type = ADNonFunctorSideDiffusiveFluxIntegral
boundary = left
variable = v
diffusivity = 'coeff'
[]
# to trigger ghost evaluations
[flux_mid]
type = ADInterfaceDiffusiveFluxIntegral
boundary = middle
variable = v
diffusivity = 'coeff'
coeff_interp_method = average
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
exodus = true
# To get level of ghosting
[console]
type = Console
system_info = 'framework mesh aux nonlinear execution relationship'
[]
[]
(test/tests/transfers/multiapp_copy_transfer/linear_sys_to_aux/nonlinear_main.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 10
[]
[]
[Variables]
[u_main]
type = MooseVariableFVReal
[]
[]
[AuxVariables]
[transferred]
type = MooseLinearVariableFVReal
[]
[]
[Transfers]
[copy]
type = MultiAppCopyTransfer
from_multi_app = linear_sub
source_variable = u
variable = transferred
[]
[]
[MultiApps]
[linear_sub]
type = FullSolveMultiApp
input_files = 'linear_sub.i'
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = u_main
coeff = 2
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = u_main
boundary = left
value = 0
[]
[./right]
type = FVDirichletBC
variable = u_main
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/postprocessors/flow_rates/mass_flux_weighted_pp.i)
# Fluid properties
mu = 1
rho = 1
cp = 1
k = 1e-3
# Operating conditions
u_inlet = 1
T_inlet = 200
p_outlet = 10
# expected temperature at outlet
#
# mdot * cp dT = Qdot
# Qdot = 500
# mdot = 1
# cp = 1
# dT = 500
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '5 0.1 4.9'
ix = '10 3 10'
dy = '0.5 0.5'
iy = '2 2'
subdomain_id = '1 2 3 1 3 3'
[]
[interior]
type = SideSetsBetweenSubdomainsGenerator
primary_block = '1'
paired_block = '2 3'
new_boundary = 'interior'
input = gen
[]
[]
[AuxVariables]
[porosity]
type = MooseVariableFVReal
[]
[hsrc]
type = MooseVariableFVReal
[]
[]
[ICs]
[porosity_1]
type = ConstantIC
variable = porosity
value = 0.5
block = '1 3'
[]
[porosity_2]
type = ConstantIC
variable = porosity
value = 0.1
block = 2
[]
[hsrc]
type = ConstantIC
variable = hsrc
value = 100
block = 1
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'incompressible'
porous_medium_treatment = true
add_energy_equation = true
density = 'rho'
dynamic_viscosity = 'mu'
thermal_conductivity = 'k'
specific_heat = 'cp'
porosity = 'porosity'
initial_velocity = '${u_inlet} 1e-6 0'
initial_pressure = ${p_outlet}
initial_temperature = ${T_inlet}
inlet_boundaries = 'left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_function = '${u_inlet} 0'
energy_inlet_types = 'fixed-temperature'
energy_inlet_function = '${T_inlet}'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip symmetry'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '0 0'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${p_outlet}'
mass_advection_interpolation = 'upwind'
momentum_advection_interpolation = 'upwind'
energy_advection_interpolation = 'upwind'
external_heat_source = hsrc
[]
[]
[FunctorMaterials]
[constants]
type = ADGenericFunctorMaterial
prop_names = 'cp rho mu k'
prop_values = '${cp} ${rho} ${mu} ${k}'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
nl_abs_tol = 1e-8
end_time = 1000
dt = 10
num_steps = 5
[]
# Some basic Postprocessors to examine the solution
[Postprocessors]
[Qdot]
type = ElementIntegralVariablePostprocessor
variable = hsrc
[]
[mass-flux-weighted-T-out]
type = MassFluxWeightedFlowRate
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = T_fluid
density = rho
rhie_chow_user_object = 'pins_rhie_chow_interpolator'
boundary = 'right'
[]
[mass-flux-weighted-T-interior]
type = MassFluxWeightedFlowRate
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = T_fluid
density = rho
rhie_chow_user_object = 'pins_rhie_chow_interpolator'
boundary = 'interior'
[]
[mdot]
type = VolumetricFlowRate
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = rho
rhie_chow_user_object = 'pins_rhie_chow_interpolator'
boundary = 'right'
[]
[outlet-u]
type = SideAverageValue
variable = superficial_vel_x
boundary = 'right'
[]
[outlet-temp]
type = SideAverageValue
variable = T_fluid
boundary = 'right'
[]
[]
[Outputs]
csv = true
[]
(modules/porous_flow/test/tests/poroperm/PermFromPoro03_fv.i)
# Testing permeability from porosity
# Trivial test, checking calculated permeability is correct
# k = k_anisotropic * B * exp(A * phi)
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 3
xmin = 0
xmax = 3
[]
[]
[GlobalParams]
block = 0
PorousFlowDictator = dictator
[]
[Variables]
[pp]
type = MooseVariableFVReal
[FVInitialCondition]
type = FVConstantIC
value = 0
[]
[]
[]
[FVKernels]
[flux]
type = FVPorousFlowAdvectiveFlux
gravity = '0 0 0'
variable = pp
[]
[]
[FVBCs]
[ptop]
type = FVDirichletBC
variable = pp
boundary = right
value = 0
[]
[pbase]
type = FVDirichletBC
variable = pp
boundary = left
value = 1
[]
[]
[AuxVariables]
[poro]
type = MooseVariableFVReal
[]
[perm_x]
type = MooseVariableFVReal
[]
[perm_y]
type = MooseVariableFVReal
[]
[perm_z]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[poro]
type = ADPorousFlowPropertyAux
property = porosity
variable = poro
[]
[perm_x]
type = ADPorousFlowPropertyAux
property = permeability
variable = perm_x
row = 0
column = 0
[]
[perm_y]
type = ADPorousFlowPropertyAux
property = permeability
variable = perm_y
row = 1
column = 1
[]
[perm_z]
type = ADPorousFlowPropertyAux
property = permeability
variable = perm_z
row = 2
column = 2
[]
[]
[Postprocessors]
[perm_x_bottom]
type = PointValue
variable = perm_x
point = '0 0 0'
[]
[perm_y_bottom]
type = PointValue
variable = perm_y
point = '0 0 0'
[]
[perm_z_bottom]
type = PointValue
variable = perm_z
point = '0 0 0'
[]
[perm_x_top]
type = PointValue
variable = perm_x
point = '3 0 0'
[]
[perm_y_top]
type = PointValue
variable = perm_y
point = '3 0 0'
[]
[perm_z_top]
type = PointValue
variable = perm_z
point = '3 0 0'
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp'
number_fluid_phases = 1
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
# unimportant in this fully-saturated test
m = 0.8
alpha = 1e-4
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 2.2e9
viscosity = 1e-3
density0 = 1000
thermal_expansion = 0
[]
[]
[Materials]
[permeability]
type = ADPorousFlowPermeabilityExponential
k_anisotropy = '1 0 0 0 2 0 0 0 0.1'
poroperm_function = exp_k
A = 10
B = 1e-8
[]
[temperature]
type = ADPorousFlowTemperature
[]
[massfrac]
type = ADPorousFlowMassFraction
[]
[eff_fluid_pressure]
type = ADPorousFlowEffectiveFluidPressure
[]
[ppss]
type = ADPorousFlow1PhaseP
porepressure = pp
capillary_pressure = pc
[]
[simple_fluid]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[porosity]
type = ADPorousFlowPorosityConst
porosity = 0.1
[]
[relperm]
type = ADPorousFlowRelativePermeabilityCorey
n = 0 # unimportant in this fully-saturated situation
phase = 0
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = Newton
l_tol = 1E-5
nl_abs_tol = 1E-3
nl_rel_tol = 1E-8
l_max_its = 200
nl_max_its = 400
[]
[Outputs]
file_base = 'PermFromPoro03_out'
csv = true
execute_on = 'timestep_end'
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/channel-flow/2d-transient.i)
rho = 'rho'
l = 10
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_v = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 20
ny = 10
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = ${inlet_v}
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T_fluid]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[]
[AuxVariables]
[mixing_length]
type = MooseVariableFVReal
[]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
inactive = 'u_turb v_turb temp_turb'
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = WCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_x
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_turb]
type = INSFVMixingLengthReynoldsStress
variable = vel_x
rho = ${rho}
mixing_length = 'mixing_length'
momentum_component = 'x'
u = vel_x
v = vel_y
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_y
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
momentum_component = 'y'
mu = ${mu}
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[v_turb]
type = INSFVMixingLengthReynoldsStress
variable = vel_y
rho = ${rho}
mixing_length = 'mixing_length'
momentum_component = 'y'
u = vel_x
v = vel_y
[]
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T_fluid
rho = rho
drho_dt = drho_dt
h = h
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T_fluid
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T_fluid
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T_fluid
v = power_density
[]
[temp_turb]
type = WCNSFVMixingLengthEnergyDiffusion
variable = T_fluid
rho = rho
cp = cp
mixing_length = 'mixing_length'
schmidt_number = 1
u = vel_x
v = vel_y
[]
[]
[FVBCs]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'top bottom'
function = 0
[]
# Inlet
[inlet_u]
type = INSFVInletVelocityBC
variable = vel_x
boundary = 'left'
function = ${inlet_v}
[]
[inlet_v]
type = INSFVInletVelocityBC
variable = vel_y
boundary = 'left'
function = 0
[]
[inlet_T]
type = FVDirichletBC
variable = T_fluid
boundary = 'left'
value = ${inlet_temp}
[]
[outlet_p]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T_fluid
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T_fluid'
rho = ${rho}
[]
[]
[AuxKernels]
inactive = 'mixing_len'
[mixing_len]
type = WallDistanceMixingLengthAux
walls = 'top'
variable = mixing_length
execute_on = 'initial'
delta = 0.5
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-3
optimal_iterations = 6
[]
end_time = 15
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
off_diagonals_in_auto_scaling = true
compute_scaling_once = false
[]
[Outputs]
exodus = true
[]
(modules/heat_transfer/test/tests/fvbcs/fv_functor_convective_heat_flux/fv_functor_convective_heat_flux.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 6
ny = 5
xmax = 2
subdomain_ids = '0 0 0 1 1 1
0 0 0 1 1 1
0 0 0 1 1 1
0 0 0 1 1 1
0 0 0 1 1 1'
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = gen
primary_block = 0
paired_block = 1
new_boundary = interface
[]
[]
[Problem]
kernel_coverage_check = false
[]
[Variables]
[T_solid]
type = MooseVariableFVReal
initial_condition = 1
block = 0
[]
[T_fluid]
type = MooseVariableFVReal
initial_condition = 0
block = 1
[]
[]
[FVKernels]
[diff_wall]
type = FVDiffusion
variable = T_solid
block = 0
coeff = 2
[]
[diff_fluid]
type = FVDiffusion
variable = T_fluid
block = 1
coeff = 4
[]
[gradient_creating]
type = FVBodyForce
variable = T_fluid
[]
[]
[FVBCs]
[interface_fluid_to_solid]
type = FVFunctorConvectiveHeatFluxBC
boundary = 'interface'
variable = T_solid
T_bulk = T_fluid
T_solid = T_solid
is_solid = true
heat_transfer_coefficient = 'htc'
[]
[left]
type = FVDirichletBC
boundary = 'left'
variable = T_solid
value = 1
[]
[interface_solid_to_fluid]
type = FVFunctorConvectiveHeatFluxBC
boundary = 'interface'
variable = T_fluid
T_bulk = T_fluid
T_solid = T_solid
is_solid = false
heat_transfer_coefficient = 'htc'
[]
[right]
type = FVDirichletBC
boundary = 'right'
variable = T_fluid
value = 0
[]
[]
[Materials]
[cht]
type = ADGenericFunctorMaterial
prop_names = 'htc'
prop_values = '1'
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
exodus = true
[]
(test/tests/scaling/resid-and-jac-together/test.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 21
xmax = 2
[]
[Variables]
[v]
type = MooseVariableFVReal
# singular if we use two term boundary expansion
two_term_boundary_expansion = false
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[FVKernels]
[advection]
type = FVElementalAdvection
variable = v
velocity = '1 0 0'
[]
[lambda]
type = FVIntegralValueConstraint
variable = v
lambda = lambda
phi0 = 1
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
solve_type = NEWTON
automatic_scaling = true
off_diagonals_in_auto_scaling = true
verbose = true
[]
[Outputs]
exodus = true
[]
(test/tests/fviks/one-var-diffusion/test.i)
L = 2
l = 1
q1 = 1
q2 = 2
uR = 1
D1 = 1
D2 = 2
ul = '${fparse 1/D2*(D2*uR+q2*L*L/2-q2*l*l/2-l*(q2-q1)*L+l*l*(q2-q1))}'
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 10
xmax = ${L}
[]
[subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '${l} 0 0'
block_id = 1
top_right = '${L} 1.0 0'
[]
[interface_primary_side]
input = subdomain1
type = SideSetsBetweenSubdomainsGenerator
primary_block = '0'
paired_block = '1'
new_boundary = 'primary_interface'
[]
[interface_secondary_side]
input = interface_primary_side
type = SideSetsBetweenSubdomainsGenerator
primary_block = '1'
paired_block = '0'
new_boundary = 'secondary_interface'
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
[]
[v]
type = MooseVariableFVReal
block = 0
[]
[w]
type = MooseVariableFVReal
block = 1
[]
[]
[FVKernels]
[diff_left]
type = FVDiffusion
variable = u
coeff = 'left'
block = 0
[]
[diff_right]
type = FVDiffusion
variable = u
coeff = 'right'
block = 1
[]
[source_left]
type = FVBodyForce
variable = u
function = ${q1}
block = 0
[]
[source_right]
type = FVBodyForce
variable = u
function = ${q2}
block = 1
[]
[diff_v]
type = FVDiffusion
variable = v
block = 0
coeff = 'left'
[]
[diff_w]
type = FVDiffusion
variable = w
block = 1
coeff = 'right'
[]
[]
[FVInterfaceKernels]
active = 'interface'
[interface]
type = FVOneVarDiffusionInterface
variable1 = u
boundary = primary_interface
subdomain1 = '0'
subdomain2 = '1'
coeff1 = 'left'
coeff2 = 'right'
coeff_interp_method = average
[]
[bad1]
type = FVOneVarDiffusionInterface
variable1 = w
variable2 = u
boundary = primary_interface
subdomain1 = '0'
subdomain2 = '1'
coeff1 = 'left'
coeff2 = 'right'
coeff_interp_method = average
[]
[bad2]
type = FVOneVarDiffusionInterface
variable1 = u
variable2 = v
boundary = primary_interface
subdomain1 = '0'
subdomain2 = '1'
coeff1 = 'left'
coeff2 = 'right'
coeff_interp_method = average
[]
[bad3]
type = FVOneVarDiffusionInterface
variable1 = v
boundary = primary_interface
subdomain1 = '0'
subdomain2 = '1'
coeff1 = 'left'
coeff2 = 'right'
coeff_interp_method = average
[]
[]
[FVBCs]
[right]
type = FVDirichletBC
variable = u
boundary = 'right'
value = ${uR}
[]
[v_left]
type = FVDirichletBC
variable = v
boundary = 'left'
value = 1
[]
[v_right]
type = FVDirichletBC
variable = v
boundary = 'primary_interface'
value = 0
[]
[w_left]
type = FVDirichletBC
variable = w
boundary = 'secondary_interface'
value = 1
[]
[w_right]
type = FVDirichletBC
variable = w
boundary = 'right'
value = 0
[]
[]
[Materials]
[block0]
type = ADGenericFunctorMaterial
block = '0'
prop_names = 'left'
prop_values = '${D1}'
[]
[block1]
type = ADGenericFunctorMaterial
block = '1'
prop_names = 'right'
prop_values = '${D2}'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
exodus = true
csv = true
[]
[Functions]
[exact_u]
type = ParsedFunction
expression = 'if(x<${l}, 1/${D1}*(${fparse D1*ul+q1*l*l/2}-${fparse q1/2}*x*x),-1/${D2}*(${fparse -D2*ul-q2*l*l/2}+${fparse q2/2}*x*x-${fparse l*(q2-q1)}*x+${fparse l*l*(q2-q1)}))'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2u]
type = ElementL2Error
variable = u
function = exact_u
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(test/tests/fvbcs/fv_functor_neumannbc/fv_functor_neumann.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmax = 2
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
initial_condition = 0.5
[]
[]
[FVKernels]
[diff_left]
type = FVDiffusion
variable = u
coeff = 4
[]
[]
[AuxVariables]
[qdot]
type = MooseVariableFVReal
[]
[]
[ICs]
[set_qdot]
type = FunctionIC
variable = qdot
function = 'y'
[]
[]
[FVBCs]
[left]
type = FVFunctorNeumannBC
variable = u
functor = qdot
boundary = left
[]
[right]
type = FVDirichletBC
variable = u
boundary = right
value = 0
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/scalar_advection/mass-frac-advection.i)
rho_initial=1.29
p_initial=1.01e5
T=273.15
gamma=1.4
e_initial=${fparse p_initial / (gamma - 1) / rho_initial}
et_initial=${e_initial}
rho_et_initial=${fparse rho_initial * et_initial}
v_in=1
[GlobalParams]
fp = fp
# retain behavior at time of test creation
two_term_boundary_expansion = false
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
nx = 2
ymin = 0
ymax = 10
ny = 20
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Variables]
[rho]
type = MooseVariableFVReal
initial_condition = ${rho_initial}
[]
[rho_u]
type = MooseVariableFVReal
initial_condition = 1e-15
[]
[rho_v]
type = MooseVariableFVReal
initial_condition = 1e-15
[]
[rho_et]
type = MooseVariableFVReal
initial_condition = ${rho_et_initial}
scaling = 1e-5
[]
[mass_frac]
type = MooseVariableFVReal
initial_condition = 1e-15
[]
[]
[AuxVariables]
[U_x]
type = MooseVariableFVReal
[]
[U_y]
type = MooseVariableFVReal
[]
[pressure]
type = MooseVariableFVReal
[]
[temperature]
type = MooseVariableFVReal
[]
[courant]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[U_x]
type = ADMaterialRealAux
variable = U_x
property = vel_x
execute_on = 'timestep_end'
[]
[U_y]
type = ADMaterialRealAux
variable = U_y
property = vel_y
execute_on = 'timestep_end'
[]
[pressure]
type = ADMaterialRealAux
variable = pressure
property = pressure
execute_on = 'timestep_end'
[]
[temperature]
type = ADMaterialRealAux
variable = temperature
property = T_fluid
execute_on = 'timestep_end'
[]
[courant]
type = Courant
variable = courant
u = U_x
v = U_y
[]
[]
[FVKernels]
[mass_time]
type = FVPorosityTimeDerivative
variable = rho
[]
[mass_advection]
type = PCNSFVKT
variable = rho
eqn = "mass"
[]
[momentum_time_x]
type = FVTimeKernel
variable = rho_u
[]
[momentum_advection_and_pressure_x]
type = PCNSFVKT
variable = rho_u
eqn = "momentum"
momentum_component = 'x'
[]
[momentum_time_y]
type = FVTimeKernel
variable = rho_v
[]
[momentum_advection_and_pressure_y]
type = PCNSFVKT
variable = rho_v
eqn = "momentum"
momentum_component = 'y'
[]
[energy_time]
type = FVPorosityTimeDerivative
variable = rho_et
[]
[energy_advection]
type = PCNSFVKT
variable = rho_et
eqn = "energy"
[]
[mass_frac_time]
type = PCNSFVDensityTimeDerivative
variable = mass_frac
rho = rho
[]
[mass_frac_advection]
type = PCNSFVKT
variable = mass_frac
eqn = "scalar"
[]
[]
[Functions]
[ud_in]
type = ParsedVectorFunction
expression_x = '0'
expression_y = '${v_in}'
[]
[]
[FVBCs]
[rho_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = rho
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'mass'
[]
[rho_u_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = rho_u
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'x'
[]
[rho_v_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = rho_v
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'y'
[]
[rho_et_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = rho_et
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'energy'
[]
[mass_frac_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = mass_frac
superficial_velocity = 'ud_in'
T_fluid = ${T}
scalar = 1
eqn = 'scalar'
[]
[rho_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = rho
pressure = ${p_initial}
eqn = 'mass'
[]
[rho_u_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = rho_u
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'x'
[]
[rho_v_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = rho_v
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'y'
[]
[rho_et_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = rho_et
pressure = ${p_initial}
eqn = 'energy'
[]
[mass_frac_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = mass_frac
pressure = ${p_initial}
eqn = 'scalar'
[]
[momentum_x_walls]
type = PCNSFVImplicitMomentumPressureBC
variable = rho_u
boundary = 'left right'
momentum_component = 'x'
[]
[momentum_y_walls]
type = PCNSFVImplicitMomentumPressureBC
variable = rho_v
boundary = 'left right'
momentum_component = 'y'
[]
[]
[Materials]
[var_mat]
type = PorousConservedVarMaterial
rho = rho
rho_et = rho_et
superficial_rhou = rho_u
superficial_rhov = rho_v
fp = fp
porosity = porosity
[]
[porosity]
type = GenericConstantMaterial
prop_names = 'porosity'
prop_values = '1'
[]
[]
[Executioner]
type = Transient
[TimeIntegrator]
type = ActuallyExplicitEuler
[]
steady_state_detection = true
steady_state_tolerance = 1e-12
abort_on_solve_fail = true
dt = 5e-4
num_steps = 25
[]
[Outputs]
[out]
type = Exodus
execute_on = 'initial timestep_end'
[]
[dof]
type = DOFMap
execute_on = 'initial'
[]
[]
[Debug]
show_var_residual_norms = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/lid-driven-turb-non-eq-bulk.i)
##########################################################
# Lid-driven cavity test
# Reynolds: 5,000
# Author: Dr. Mauricio Tano
# Last Update: Novomber, 2023
# Turbulent model using:
# Standard wall functions with non-equilibrium bulk formaultion
# No wall functions
# SIMPLE Solve
##########################################################
### Thermophsyical Properties ###
mu = 2e-5
rho = 1.0
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epslilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Modeling parameters ###
non_equilibrium_treatment = true
bulk_wall_treatment = false
walls = 'left top right bottom'
max_mixing_length = 1e10
linearized_yplus_mu_t = false
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
pressure_tag = "pressure_grad"
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolatorSegregated
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 0.0
solver_sys = u_system
two_term_boundary_expansion = false
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 0.0
solver_sys = v_system
two_term_boundary_expansion = false
[]
[pressure]
type = INSFVPressureVariable
solver_sys = pressure_system
initial_condition = 0.2
two_term_boundary_expansion = false
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
[]
[]
[FVKernels]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = true
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = true
u = vel_x
v = vel_y
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[p_diffusion]
type = FVAnisotropicDiffusion
variable = pressure
coeff = "Ainv"
coeff_interp_method = 'average'
[]
[p_source]
type = FVDivergence
variable = pressure
vector_field = "HbyA"
force_boundary_execution = true
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
non_equilibrium_treatment = ${non_equilibrium_treatment}
max_mixing_length = ${max_mixing_length}
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
k = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
non_equilibrium_treatment = ${non_equilibrium_treatment}
max_mixing_length = ${max_mixing_length}
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${lid_velocity}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = 'left right top bottom'
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
k = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
linearized_yplus = ${linearized_yplus_mu_t}
non_equilibrium_treatment = ${non_equilibrium_treatment}
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKED_system TKE_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.5
turbulence_equation_relaxation = '0.8 0.8'
num_iterations = 500
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
[]
[Outputs]
exodus = true
csv = false
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
(test/tests/vectorpostprocessors/element_value_sampler/mixed_fe_fv_sampler.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 1
dx = 3
ix = 10
[]
[]
[AuxVariables]
[T]
type = MooseVariableFVReal
[FVInitialCondition]
type = FVFunctionIC
function = '10 * x*x'
[]
[]
[grad_T]
order = CONSTANT
family = MONOMIAL_VEC
[]
[auxGrad_T_x]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[grad_T_aux]
type = FunctorElementalGradientAux
variable = grad_T
functor = T
[]
[grad_T_x_aux]
type = VectorVariableComponentAux
variable = auxGrad_T_x
vector_variable = grad_T
component = 'x'
[]
[]
[VectorPostprocessors]
[element_value_sampler]
type = ElementValueSampler
variable = 'T auxGrad_T_x'
sort_by = id
[]
[]
[Outputs]
csv = true
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/with-direction/flux_bcs-direction-action.i)
l = 2
inlet_area = 2
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 5e1
rho = 1000
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.2
inlet_scalar = 1.2
# The inlet angle, we will modify this and expect two things:
# 1. If we use a velocity postprocessor for the flux terms, we expect the mass flow
# to be proportional with "direction \cdot surface_normal".
# 2. If a mass flow is specified, it should not change, only the direction and magnitude of the
# inlet vleocity which is inferred based on the supplied massflow.
# direction = "0.86602540378 -0.5 0.0"
# direction = "1.0 0.0 0.0"
# cos_angle = 0.86602540378
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = ${inlet_area}
nx = 10
ny = 10
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'weakly-compressible'
add_energy_equation = true
add_scalar_equation = true
passive_scalar_names = 'scalar'
density = 'rho'
dynamic_viscosity = 'mu'
thermal_conductivity = 'k'
specific_heat = 'cp'
passive_scalar_diffusivity = '10.0'
passive_scalar_schmidt_number = '1.0'
initial_velocity = '${inlet_velocity} 1e-15 0'
initial_temperature = '${inlet_temp}'
initial_pressure = '${outlet_pressure}'
initial_scalar_variables = 1.0
inlet_boundaries = 'left'
momentum_inlet_types = 'flux-mass'
flux_inlet_pps = 'inlet_mdot'
energy_inlet_types = 'flux-mass'
energy_inlet_function = 'inlet_T'
passive_scalar_inlet_types = 'flux-mass'
passive_scalar_inlet_function = 'inlet_scalar'
wall_boundaries = 'top bottom'
momentum_wall_types = 'slip slip'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '0 0'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${outlet_pressure}'
external_heat_source = 'power_density'
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
[]
[]
[Postprocessors]
[inlet_mdot]
type = Receiver
default = '${fparse rho * inlet_velocity * inlet_area}'
[]
[inlet_velocity]
type = Receiver
default = ${inlet_velocity}
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[inlet_scalar]
type = Receiver
default = ${inlet_scalar}
[]
[outlet_mdot]
type = VolumetricFlowRate
advected_quantity = rho
vel_x = vel_x
vel_y = vel_y
boundary = right
rhie_chow_user_object = ins_rhie_chow_interpolator
[]
[inlet_mdot_check]
type = VolumetricFlowRate
advected_quantity = rho
vel_x = vel_x
vel_y = vel_y
boundary = left
rhie_chow_user_object = ins_rhie_chow_interpolator
[]
[inlet_vel_x_check]
type = SideAverageValue
variable = vel_x
boundary = left
[]
[inlet_vel_y_check]
type = SideAverageValue
variable = vel_y
boundary = left
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'rho cp k mu'
prop_values = '${rho} ${cp} ${k} ${mu}'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
csv = true
[]
(modules/porous_flow/test/tests/heat_advection/heat_advection_1d_fv.i)
# 1phase, heat advecting with a moving fluid using FV
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 50
xmin = 0
xmax = 1
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[Variables]
[temp]
type = MooseVariableFVReal
[]
[pp]
type = MooseVariableFVReal
[]
[]
[FVICs]
[pp]
type = FVFunctionIC
variable = pp
function = '1-x'
[]
[temp]
type = FVFunctionIC
variable = temp
function = 'if(x<0.02, 300, 200)'
[]
[]
[FVBCs]
[pp0]
type = FVDirichletBC
variable = pp
boundary = left
value = 1
[]
[pp1]
type = FVDirichletBC
variable = pp
boundary = right
value = 0
[]
[hot]
type = FVDirichletBC
variable = temp
boundary = left
value = 300
[]
[cold]
type = FVDirichletBC
variable = temp
boundary = right
value = 200
[]
[]
[FVKernels]
[mass_dot]
type = FVPorousFlowMassTimeDerivative
fluid_component = 0
variable = pp
[]
[advection]
type = FVPorousFlowAdvectiveFlux
fluid_component = 0
variable = pp
[]
[energy_dot]
type = FVPorousFlowEnergyTimeDerivative
variable = temp
[]
[heat_advection]
type = FVPorousFlowHeatAdvection
variable = temp
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'temp pp'
number_fluid_phases = 1
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
m = 0.6
alpha = 1.3
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 100
density0 = 1000
viscosity = 4.4
thermal_expansion = 0
cv = 2
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
temperature = temp
[]
[porosity]
type = ADPorousFlowPorosityConst
porosity = 0.2
[]
[rock_heat]
type = ADPorousFlowMatrixInternalEnergy
specific_heat_capacity = 1.0
density = 125
[]
[simple_fluid]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[permeability]
type = ADPorousFlowPermeabilityConst
permeability = '1.1 0 0 0 2 0 0 0 3'
[]
[relperm]
type = ADPorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[]
[massfrac]
type = ADPorousFlowMassFraction
[]
[PS]
type = ADPorousFlow1PhaseP
porepressure = pp
capillary_pressure = pc
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 0.01
end_time = 0.6
[]
[VectorPostprocessors]
[T]
type = ElementValueSampler
sort_by = x
variable = 'temp'
[]
[]
[Outputs]
[csv]
type = CSV
execute_vector_postprocessors_on = final
[]
[]
(modules/navier_stokes/test/tests/postprocessors/flow_rates/conservation_INSFV.i)
mu=1
rho=1
advected_interp_method='average'
velocity_interp_method='rc'
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Mesh]
inactive = 'mesh internal_boundary_bot internal_boundary_top'
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '1'
dy = '1 1 1'
ix = '5'
iy = '5 5 5'
subdomain_id = '1
2
3'
[]
[internal_boundary_bot]
type = SideSetsBetweenSubdomainsGenerator
input = mesh
new_boundary = 'internal_bot'
primary_block = 1
paired_block = 2
[]
[internal_boundary_top]
type = SideSetsBetweenSubdomainsGenerator
input = internal_boundary_bot
new_boundary = 'internal_top'
primary_block = 2
paired_block = 3
[]
[diverging_mesh]
type = FileMeshGenerator
file = 'expansion_quad.e'
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = 0
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1
[]
[pressure]
type = INSFVPressureVariable
[]
[temperature]
type = INSFVEnergyVariable
[]
[]
[AuxVariables]
[advected_density]
type = MooseVariableFVReal
initial_condition = ${rho}
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
force_boundary_execution = true
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
force_boundary_execution = true
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = temperature
advected_interp_method = 'upwind'
[]
[temp_source]
type = FVBodyForce
variable = temperature
function = 10
block = 1
[]
[]
[FVBCs]
inactive = 'noslip-u noslip-v'
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'bottom'
variable = u
function = 0
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'bottom'
variable = v
function = 1
[]
[noslip-u]
type = INSFVNoSlipWallBC
boundary = 'right'
variable = u
function = 0
[]
[noslip-v]
type = INSFVNoSlipWallBC
boundary = 'right'
variable = v
function = 0
[]
[free-slip-u]
type = INSFVNaturalFreeSlipBC
boundary = 'right'
variable = u
momentum_component = 'x'
[]
[free-slip-v]
type = INSFVNaturalFreeSlipBC
boundary = 'right'
variable = v
momentum_component = 'y'
[]
[axis-u]
type = INSFVSymmetryVelocityBC
boundary = 'left'
variable = u
u = u
v = v
mu = ${mu}
momentum_component = x
[]
[axis-v]
type = INSFVSymmetryVelocityBC
boundary = 'left'
variable = v
u = u
v = v
mu = ${mu}
momentum_component = y
[]
[axis-p]
type = INSFVSymmetryPressureBC
boundary = 'left'
variable = pressure
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'top'
variable = pressure
function = 0
[]
[inlet_temp]
type = FVNeumannBC
boundary = 'bottom'
variable = temperature
value = 300
[]
[]
[FunctorMaterials]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'temperature'
rho = ${rho}
[]
[advected_material_property]
type = ADGenericFunctorMaterial
prop_names = 'advected_rho cp'
prop_values ='${rho} 1'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm 200 lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-12
[]
[Postprocessors]
[inlet_mass_variable]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = advected_density
[]
[inlet_mass_constant]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = ${rho}
[]
[inlet_mass_matprop]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = 'advected_rho'
[]
[mid1_mass]
type = VolumetricFlowRate
boundary = internal_bot
vel_x = u
vel_y = v
advected_quantity = ${rho}
[]
[mid2_mass]
type = VolumetricFlowRate
boundary = internal_top
vel_x = u
vel_y = v
advected_quantity = ${rho}
[]
[outlet_mass]
type = VolumetricFlowRate
boundary = top
vel_x = u
vel_y = v
advected_quantity = ${rho}
[]
[inlet_momentum_x]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = u
[]
[inlet_momentum_y]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = v
[]
[mid1_advected_energy]
type = VolumetricFlowRate
boundary = internal_bot
vel_x = u
vel_y = v
advected_quantity = 'rho_cp_temp'
advected_interp_method = 'upwind'
[]
[mid2_advected_energy]
type = VolumetricFlowRate
boundary = internal_top
vel_x = u
vel_y = v
advected_quantity = 'rho_cp_temp'
advected_interp_method = 'upwind'
[]
[outlet_advected_energy]
type = VolumetricFlowRate
boundary = top
vel_x = u
vel_y = v
advected_quantity = 'rho_cp_temp'
advected_interp_method = 'upwind'
[]
[]
[Outputs]
csv = true
[]
(modules/porous_flow/test/tests/dispersion/diff01_fv.i)
# Test diffusive part of FVPorousFlowDispersiveFlux kernel by setting dispersion
# coefficients to zero. Pressure is held constant over the mesh, and gravity is
# set to zero so that no advective transport of mass takes place.
# Mass fraction is set to 1 on the left hand side and 0 on the right hand side.
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 20
xmax = 10
bias_x = 1.2
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[Variables]
[pp]
type = MooseVariableFVReal
[]
[massfrac0]
type = MooseVariableFVReal
[]
[]
[AuxVariables]
[velocity]
family = MONOMIAL
order = FIRST
[]
[]
[AuxKernels]
[velocity]
type = ADPorousFlowDarcyVelocityComponent
variable = velocity
component = x
[]
[]
[ICs]
[pp]
type = ConstantIC
variable = pp
value = 1e5
[]
[massfrac0]
type = ConstantIC
variable = massfrac0
value = 0
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
value = 1
variable = massfrac0
boundary = left
[]
[right]
type = FVDirichletBC
value = 0
variable = massfrac0
boundary = right
[]
[pright]
type = FVDirichletBC
variable = pp
boundary = right
value = 1e5
[]
[pleft]
type = FVDirichletBC
variable = pp
boundary = left
value = 1e5
[]
[]
[FVKernels]
[mass0]
type = FVPorousFlowMassTimeDerivative
fluid_component = 0
variable = pp
[]
[diff0_pp]
type = FVPorousFlowDispersiveFlux
fluid_component = 0
variable = pp
disp_trans = 0
disp_long = 0
[]
[mass1]
type = FVPorousFlowMassTimeDerivative
fluid_component = 1
variable = massfrac0
[]
[diff1_x]
type = FVPorousFlowDispersiveFlux
fluid_component = 1
variable = massfrac0
disp_trans = 0
disp_long = 0
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp massfrac0'
number_fluid_phases = 1
number_fluid_components = 2
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 1e7
density0 = 1000
viscosity = 0.001
thermal_expansion = 0
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
[]
[ppss]
type = ADPorousFlow1PhaseFullySaturated
porepressure = pp
[]
[massfrac]
type = ADPorousFlowMassFraction
mass_fraction_vars = massfrac0
[]
[simple_fluid]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[poro]
type = ADPorousFlowPorosityConst
porosity = 0.3
[]
[diff]
type = ADPorousFlowDiffusivityConst
diffusion_coeff = '1 1'
tortuosity = 0.1
[]
[relp]
type = ADPorousFlowRelativePermeabilityConst
phase = 0
[]
[permeability]
type = ADPorousFlowPermeabilityConst
permeability = '1e-9 0 0 0 1e-9 0 0 0 1e-9'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = 'gmres asm lu NONZERO 2 '
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
dt = 1
end_time = 20
[]
[VectorPostprocessors]
[xmass]
type = ElementValueSampler
sort_by = id
variable = massfrac0
[]
[]
[Outputs]
[out]
type = CSV
execute_on = final
[]
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/materials/2d-transient.i)
l = 10
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_v = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 20
ny = 10
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
rho = 'rho'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = ${inlet_v}
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[]
[AuxVariables]
[velocity_norm]
type = MooseVariableFVReal
[]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = WCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = 'rho'
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = u
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = 'rho'
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = 'mu'
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = v
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = 'rho'
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = 'mu'
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T
rho = rho
drho_dt = drho_dt
h = h
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T
v = power_density
[]
[]
[FVBCs]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = v
boundary = 'top bottom'
function = 0
[]
# Inlet
[inlet_u]
type = INSFVInletVelocityBC
variable = u
boundary = 'left'
function = ${inlet_v}
[]
[inlet_v]
type = INSFVInletVelocityBC
variable = v
boundary = 'left'
function = 0
[]
[inlet_T]
type = FVDirichletBC
variable = T
boundary = 'left'
value = ${inlet_temp}
[]
[outlet_p]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = 'rho'
[]
[fluid_props_to_mat_props]
type = GeneralFunctorFluidProps
fp = fp
pressure = 'pressure'
T_fluid = 'T'
speed = 'velocity_norm'
# even though we provide rho from the parameters, we
# want to get rho from the fluid properties
force_define_density = true
# To initialize with a high viscosity
mu_rampdown = 'mu_rampdown'
# For porous flow
characteristic_length = 1
porosity = 1
[]
[]
[AuxKernels]
[speed]
type = VectorMagnitudeAux
variable = 'velocity_norm'
x = u
y = v
[]
[]
[Functions]
[mu_rampdown]
type = PiecewiseLinear
x = '1 2 3 4'
y = '1e3 1e2 1e1 1'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-3
optimal_iterations = 6
[]
end_time = 15
nl_abs_tol = 1e-12
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
off_diagonals_in_auto_scaling = true
compute_scaling_once = false
[]
[Outputs]
exodus = true
[]
(test/tests/postprocessors/element_integral/functors/element_integral_test.i)
[Mesh]
second_order = true
[square]
type = GeneratedMeshGenerator
nx = 2
ny = 2
dim = 2
[]
[block]
type = ParsedSubdomainMeshGenerator
input = square
block_id = 1
combinatorial_geometry = 'x > 0.5'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[AuxVariables]
[nodal]
[InitialCondition]
type = FunctionIC
function = '1 + x*x + y*y*y'
[]
[]
[fe_higher_order]
order = SECOND
[InitialCondition]
type = FunctionIC
function = '1 + x*x + y*y*y'
[]
[]
[fe_elemental]
family = MONOMIAL
order = SECOND
[InitialCondition]
type = FunctionIC
function = '1 + x*x + y*y*y'
[]
[]
[fv_var]
type = MooseVariableFVReal
[FVInitialCondition]
type = FVFunctionIC
function = '1 + x*x + y*y*y'
[]
[]
[]
[Functions]
[f]
type = ParsedFunction
expression = '1 + x*x + y*y*y'
[]
[]
[Materials]
[two_piece]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = 'mat'
subdomain_to_prop_value = '0 nodal 1 fv_var'
[]
[]
[Postprocessors]
[fe]
type = ADElementIntegralFunctorPostprocessor
functor = nodal
[]
[fe_higher_order]
type = ADElementIntegralFunctorPostprocessor
functor = fe_higher_order
[]
[fe_elemental]
type = ADElementIntegralFunctorPostprocessor
functor = fe_elemental
[]
[fv]
type = ADElementIntegralFunctorPostprocessor
functor = fv_var
[]
[function]
type = ElementIntegralFunctorPostprocessor
functor = f
prefactor = f
[]
[functor_matprop]
type = ADElementIntegralFunctorPostprocessor
functor = mat
[]
[]
[Outputs]
file_base = out
exodus = false
csv = true
[]
(modules/porous_flow/test/tests/fluidstate/brineco2_fv.i)
# Tests correct calculation of properties in PorousFlowBrineCO2 using FV variables
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 2
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
temperature = 30
[]
[Variables]
[pg]
type = MooseVariableFVReal
initial_condition = 20e6
[]
[z]
type = MooseVariableFVReal
initial_condition = 0.2
[]
[]
[AuxVariables]
[xnacl]
type = MooseVariableFVReal
initial_condition = 0.1
[]
[pressure_gas]
type = MooseVariableFVReal
[]
[pressure_water]
type = MooseVariableFVReal
[]
[saturation_gas]
type = MooseVariableFVReal
[]
[saturation_water]
type = MooseVariableFVReal
[]
[density_water]
type = MooseVariableFVReal
[]
[density_gas]
type = MooseVariableFVReal
[]
[viscosity_water]
type = MooseVariableFVReal
[]
[viscosity_gas]
type = MooseVariableFVReal
[]
[enthalpy_water]
type = MooseVariableFVReal
[]
[enthalpy_gas]
type = MooseVariableFVReal
[]
[internal_energy_water]
type = MooseVariableFVReal
[]
[internal_energy_gas]
type = MooseVariableFVReal
[]
[x0_water]
type = MooseVariableFVReal
[]
[x0_gas]
type = MooseVariableFVReal
[]
[x1_water]
type = MooseVariableFVReal
[]
[x1_gas]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[pressure_water]
type = ADPorousFlowPropertyAux
variable = pressure_water
property = pressure
phase = 0
execute_on = 'timestep_end'
[]
[pressure_gas]
type = ADPorousFlowPropertyAux
variable = pressure_gas
property = pressure
phase = 1
execute_on = 'timestep_end'
[]
[saturation_water]
type = ADPorousFlowPropertyAux
variable = saturation_water
property = saturation
phase = 0
execute_on = 'timestep_end'
[]
[saturation_gas]
type = ADPorousFlowPropertyAux
variable = saturation_gas
property = saturation
phase = 1
execute_on = 'timestep_end'
[]
[density_water]
type = ADPorousFlowPropertyAux
variable = density_water
property = density
phase = 0
execute_on = 'timestep_end'
[]
[density_gas]
type = ADPorousFlowPropertyAux
variable = density_gas
property = density
phase = 1
execute_on = 'timestep_end'
[]
[viscosity_water]
type = ADPorousFlowPropertyAux
variable = viscosity_water
property = viscosity
phase = 0
execute_on = 'timestep_end'
[]
[viscosity_gas]
type = ADPorousFlowPropertyAux
variable = viscosity_gas
property = viscosity
phase = 1
execute_on = 'timestep_end'
[]
[enthalpy_water]
type = ADPorousFlowPropertyAux
variable = enthalpy_water
property = enthalpy
phase = 0
execute_on = 'timestep_end'
[]
[enthalpy_gas]
type = ADPorousFlowPropertyAux
variable = enthalpy_gas
property = enthalpy
phase = 1
execute_on = 'timestep_end'
[]
[internal_energy_water]
type = ADPorousFlowPropertyAux
variable = internal_energy_water
property = internal_energy
phase = 0
execute_on = 'timestep_end'
[]
[internal_energy_gas]
type = ADPorousFlowPropertyAux
variable = internal_energy_gas
property = internal_energy
phase = 1
execute_on = 'timestep_end'
[]
[x1_water]
type = ADPorousFlowPropertyAux
variable = x1_water
property = mass_fraction
phase = 0
fluid_component = 1
execute_on = 'timestep_end'
[]
[x1_gas]
type = ADPorousFlowPropertyAux
variable = x1_gas
property = mass_fraction
phase = 1
fluid_component = 1
execute_on = 'timestep_end'
[]
[x0_water]
type = ADPorousFlowPropertyAux
variable = x0_water
property = mass_fraction
phase = 0
fluid_component = 0
execute_on = 'timestep_end'
[]
[x0_gas]
type = ADPorousFlowPropertyAux
variable = x0_gas
property = mass_fraction
phase = 1
fluid_component = 0
execute_on = 'timestep_end'
[]
[]
[FVKernels]
[mass0]
type = FVPorousFlowMassTimeDerivative
variable = pg
fluid_component = 0
[]
[mass1]
type = FVPorousFlowMassTimeDerivative
variable = z
fluid_component = 1
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pg z'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureConst
pc = 0
[]
[fs]
type = PorousFlowBrineCO2
brine_fp = brine
co2_fp = co2
capillary_pressure = pc
[]
[]
[FluidProperties]
[co2]
type = CO2FluidProperties
[]
[brine]
type = BrineFluidProperties
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
[]
[brineco2]
type = ADPorousFlowFluidState
gas_porepressure = pg
z = z
temperature_unit = Celsius
xnacl = xnacl
capillary_pressure = pc
fluid_state = fs
[]
[permeability]
type = ADPorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[]
[relperm0]
type = ADPorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[]
[relperm1]
type = ADPorousFlowRelativePermeabilityCorey
n = 3
phase = 1
[]
[porosity]
type = ADPorousFlowPorosityConst
porosity = 0.1
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
dt = 1
end_time = 1
nl_abs_tol = 1e-12
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Postprocessors]
[density_water]
type = ElementIntegralVariablePostprocessor
variable = density_water
execute_on = 'timestep_end'
[]
[density_gas]
type = ElementIntegralVariablePostprocessor
variable = density_gas
execute_on = 'timestep_end'
[]
[viscosity_water]
type = ElementIntegralVariablePostprocessor
variable = viscosity_water
execute_on = 'timestep_end'
[]
[viscosity_gas]
type = ElementIntegralVariablePostprocessor
variable = viscosity_gas
execute_on = 'timestep_end'
[]
[enthalpy_water]
type = ElementIntegralVariablePostprocessor
variable = enthalpy_water
execute_on = 'timestep_end'
[]
[enthalpy_gas]
type = ElementIntegralVariablePostprocessor
variable = enthalpy_gas
execute_on = 'timestep_end'
[]
[internal_energy_water]
type = ElementIntegralVariablePostprocessor
variable = internal_energy_water
execute_on = 'timestep_end'
[]
[internal_energy_gas]
type = ElementIntegralVariablePostprocessor
variable = internal_energy_gas
execute_on = 'timestep_end'
[]
[x1_water]
type = ElementIntegralVariablePostprocessor
variable = x1_water
execute_on = 'timestep_end'
[]
[x0_water]
type = ElementIntegralVariablePostprocessor
variable = x0_water
execute_on = 'timestep_end'
[]
[x1_gas]
type = ElementIntegralVariablePostprocessor
variable = x1_gas
execute_on = 'timestep_end'
[]
[x0_gas]
type = ElementIntegralVariablePostprocessor
variable = x0_gas
execute_on = 'timestep_end'
[]
[sg]
type = ElementIntegralVariablePostprocessor
variable = saturation_gas
execute_on = 'timestep_end'
[]
[sw]
type = ElementIntegralVariablePostprocessor
variable = saturation_water
execute_on = 'timestep_end'
[]
[pwater]
type = ElementIntegralVariablePostprocessor
variable = pressure_water
execute_on = 'timestep_end'
[]
[pgas]
type = ElementIntegralVariablePostprocessor
variable = pressure_gas
execute_on = 'timestep_end'
[]
[x0mass]
type = FVPorousFlowFluidMass
fluid_component = 0
phase = '0 1'
[]
[x1mass]
type = FVPorousFlowFluidMass
fluid_component = 1
phase = '0 1'
[]
[]
[Outputs]
csv = true
file_base = brineco2
execute_on = 'timestep_end'
perf_graph = false
[]
(test/tests/vectorpostprocessors/mesh_division_functor_reduction/reduction.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 10
# This ensures the CSV VPP output remains ordered the same way with distributed meshes
allow_renumbering = false
[]
[MeshDivisions]
[mesh_div]
type = CylindricalGridDivision
n_radial = 4
n_azimuthal = 4
axis_direction = '0 0 1'
azimuthal_start = '1 0 0'
center = '0.5 0.5 0'
r_max = 2
[]
[]
[Functions]
[u_fn]
type = ParsedFunction
expression = 'x + 2 * if(y > 0.5, y, 0)'
[]
[]
[AuxVariables]
[u]
[]
[u_fv]
type = MooseVariableFVReal
[]
[]
[ICs]
[u_ic]
type = FunctionIC
variable = u
function = u_fn
[]
[u_fvic]
type = FunctionIC
variable = u_fv
function = u_fn
[]
[]
[FunctorMaterials]
[u_mat]
type = ADGenericFunctorMaterial
prop_names = 'u_mat'
prop_values = 'u'
[]
[]
[VectorPostprocessors]
[integral]
type = MeshDivisionFunctorReductionVectorPostprocessor
functors = 'u_fn u u_fv u_mat'
mesh_division = mesh_div
reduction = 'integral'
execute_on = 'initial'
[]
[average]
type = MeshDivisionFunctorReductionVectorPostprocessor
functors = 'u_fn u u_fv u_mat'
mesh_division = mesh_div
reduction = 'average'
execute_on = 'initial'
[]
[min]
type = MeshDivisionFunctorReductionVectorPostprocessor
functors = 'u_fn u u_fv u_mat'
mesh_division = mesh_div
reduction = 'min'
execute_on = 'initial'
[]
[max]
type = MeshDivisionFunctorReductionVectorPostprocessor
functors = 'u_fn'
mesh_division = mesh_div
reduction = 'max'
execute_on = 'initial'
[]
[sample_max]
type = SpatialUserObjectVectorPostprocessor
userobject = 'max'
points = '0 0 0.1
0.8 0 0'
execute_on = 'initial'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
execute_on = 'initial'
[]
(modules/navier_stokes/test/tests/auxkernels/reynolds-number-functor-aux/fv.i)
mu=1
rho=1
[GlobalParams]
velocity_interp_method = 'rc'
advected_interp_method = 'average'
rhie_chow_user_object = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
[]
[v]
type = INSFVVelocityVariable
[]
[pressure]
type = INSFVPressureVariable
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[AuxVariables]
[Reynolds]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[Reynolds]
type = ReynoldsNumberFunctorAux
variable = Reynolds
speed = speed
rho = ${rho}
mu = ${mu}
[]
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[mean_zero_pressure]
type = FVIntegralValueConstraint
variable = pressure
lambda = lambda
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = 'mu'
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = 'mu'
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'top'
function = 1
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = v
boundary = 'left right top bottom'
function = 0
[]
[]
[Materials]
[mu]
type = ADGenericFunctorMaterial
prop_names = 'mu'
prop_values = '${mu}'
[]
[speed]
type = ADVectorMagnitudeFunctorMaterial
x_functor = u
y_functor = v
vector_magnitude_name = speed
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm 100 lu NONZERO'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/materials/functorfluidprops.i)
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_v = 4
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 2
ymin = 0
ymax = 1
nx = 5
ny = 5
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = ${inlet_v}
[]
[v]
type = INSFVVelocityVariable
initial_condition = 2
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[]
[FVKernels]
[u_time]
type = FVFunctorTimeKernel
variable = u
[]
[v_time]
type = FVFunctorTimeKernel
variable = v
[]
[p_time]
type = FVFunctorTimeKernel
variable = pressure
[]
[T_time]
type = FVFunctorTimeKernel
variable = T
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[fluid_props_to_mat_props]
type = GeneralFunctorFluidProps
fp = fp
pressure = 'pressure'
T_fluid = 'T'
speed = 'velocity_norm'
# For porous flow
characteristic_length = 2
porosity = 'porosity'
[]
[]
[AuxVariables]
[velocity_norm]
type = MooseVariableFVReal
[]
[porosity]
type = MooseVariableFVReal
initial_condition = 0.4
[]
[rho_var]
type = MooseVariableFVReal
[]
[drho_dp_var]
type = MooseVariableFVReal
[]
[drho_dT_var]
type = MooseVariableFVReal
[]
[rho_dot_var]
type = MooseVariableFVReal
[]
[cp_var]
type = MooseVariableFVReal
[]
[dcp_dp_var]
type = MooseVariableFVReal
[]
[dcp_dT_var]
type = MooseVariableFVReal
[]
[cp_dot_var]
type = MooseVariableFVReal
[]
[cv_var]
type = MooseVariableFVReal
[]
[mu_var]
type = MooseVariableFVReal
[]
[dmu_dp_var]
type = MooseVariableFVReal
[]
[dmu_dT_var]
type = MooseVariableFVReal
[]
[k_var]
type = MooseVariableFVReal
[]
[dk_dp_var]
type = MooseVariableFVReal
[]
[dk_dT_var]
type = MooseVariableFVReal
[]
[Pr_var]
type = MooseVariableFVReal
[]
[dPr_dp_var]
type = MooseVariableFVReal
[]
[dPr_dT_var]
type = MooseVariableFVReal
[]
[Re_var]
type = MooseVariableFVReal
[]
[dRe_dp_var]
type = MooseVariableFVReal
[]
[dRe_dT_var]
type = MooseVariableFVReal
[]
[Re_h_var]
type = MooseVariableFVReal
[]
[Re_i_var]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[speed]
type = VectorMagnitudeAux
variable = 'velocity_norm'
x = u
y = v
[]
# To output the functor material properties
[rho_out]
type = FunctorAux
functor = 'rho'
variable = 'rho_var'
execute_on = 'timestep_begin'
[]
[drho_dp_out]
type = FunctorAux
functor = 'drho/dpressure'
variable = 'drho_dp_var'
execute_on = 'timestep_begin'
[]
[drho_dT_out]
type = FunctorAux
functor = 'drho/dT_fluid'
variable = 'drho_dT_var'
execute_on = 'timestep_begin'
[]
[drho_dt_out]
type = FunctorAux
functor = 'drho_dt'
variable = 'rho_dot_var'
execute_on = 'timestep_begin'
[]
[cp_out]
type = FunctorAux
functor = 'cp'
variable = 'cp_var'
execute_on = 'timestep_begin'
[]
[dcp_dp_out]
type = FunctorAux
functor = 'dcp/dpressure'
variable = 'dcp_dp_var'
execute_on = 'timestep_begin'
[]
[dcp_dT_out]
type = FunctorAux
functor = 'dcp/dT_fluid'
variable = 'dcp_dT_var'
execute_on = 'timestep_begin'
[]
[dcp_dt_out]
type = FunctorAux
functor = 'dcp_dt'
variable = 'cp_dot_var'
execute_on = 'timestep_begin'
[]
[cv_out]
type = FunctorAux
functor = 'cv'
variable = 'cv_var'
execute_on = 'timestep_begin'
[]
[mu_out]
type = FunctorAux
functor = 'mu'
variable = 'mu_var'
execute_on = 'timestep_begin'
[]
[dmu_dp_out]
type = FunctorAux
functor = 'dmu/dpressure'
variable = 'dmu_dp_var'
execute_on = 'timestep_begin'
[]
[dmu_dT_out]
type = FunctorAux
functor = 'dmu/dT_fluid'
variable = 'dmu_dT_var'
execute_on = 'timestep_begin'
[]
[k_out]
type = FunctorAux
functor = 'k'
variable = 'k_var'
execute_on = 'timestep_begin'
[]
[dk_dp_out]
type = FunctorAux
functor = 'dk/dpressure'
variable = 'dk_dp_var'
execute_on = 'timestep_begin'
[]
[dk_dT_out]
type = FunctorAux
functor = 'dk/dT_fluid'
variable = 'dk_dT_var'
execute_on = 'timestep_begin'
[]
[Pr_out]
type = FunctorAux
functor = 'Pr'
variable = 'Pr_var'
execute_on = 'timestep_begin'
[]
[dPr_dp_out]
type = FunctorAux
functor = 'dPr/dpressure'
variable = 'dPr_dp_var'
execute_on = 'timestep_begin'
[]
[dPr_dT_out]
type = FunctorAux
functor = 'dPr/dT_fluid'
variable = 'dPr_dT_var'
execute_on = 'timestep_begin'
[]
[Re_out]
type = FunctorAux
functor = 'Re'
variable = 'Re_var'
execute_on = 'timestep_begin'
[]
[dRe_dp_out]
type = FunctorAux
functor = 'dRe/dpressure'
variable = 'dRe_dp_var'
execute_on = 'timestep_begin'
[]
[dRe_dT_out]
type = FunctorAux
functor = 'dRe/dT_fluid'
variable = 'dRe_dT_var'
execute_on = 'timestep_begin'
[]
[Re_h_out]
type = FunctorAux
functor = 'Re_h'
variable = 'Re_h_var'
execute_on = 'timestep_begin'
[]
[Re_i_out]
type = FunctorAux
functor = 'Re_i'
variable = 'Re_i_var'
execute_on = 'timestep_begin'
[]
[]
[Executioner]
type = Transient
end_time = 0.1
dt = 0.1
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/straight-channel-hllc.i)
[GlobalParams]
fp = fp
[]
[Mesh]
[./gen_mesh]
type = CartesianMeshGenerator
dim = 1
dx = '.1 .1 .1 .1 .1 .5 .1 .1 .1 .1 .1'
# dx = '.1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1'
[../]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Variables]
[rho]
type = MooseVariableFVReal
initial_condition = 1.28969
scaling = 1e3
[]
[rho_u]
type = MooseVariableFVReal
initial_condition = 1.28969
[]
[rho_et]
type = MooseVariableFVReal
initial_condition = 2.525e5
scaling = 1e-2
[]
[]
[FVKernels]
[mass_advection]
type = CNSFVMassHLLC
variable = rho
fp = fp
[]
[momentum_x_advection]
type = CNSFVMomentumHLLC
variable = rho_u
momentum_component = x
fp = fp
[]
[drag]
type = FVReaction
variable = rho_u
rate = 1000
[]
[fluid_energy_advection]
type = CNSFVFluidEnergyHLLC
variable = rho_et
fp = fp
[]
[]
[FVBCs]
[mass_in]
variable = rho
type = CNSFVHLLCSpecifiedMassFluxAndTemperatureMassBC
boundary = left
temperature = 273.15
rhou = 1.28969
[]
[momentum_in]
variable = rho_u
type = CNSFVHLLCSpecifiedMassFluxAndTemperatureMomentumBC
boundary = left
temperature = 273.15
rhou = 1.28969
momentum_component = 'x'
[]
[energy_in]
variable = rho_et
type = CNSFVHLLCSpecifiedMassFluxAndTemperatureFluidEnergyBC
boundary = left
temperature = 273.15
rhou = 1.28969
[]
[mass_out]
variable = rho
type = CNSFVHLLCSpecifiedPressureMassBC
boundary = right
pressure = 1.01e5
[]
[momentum_out]
variable = rho_u
type = CNSFVHLLCSpecifiedPressureMomentumBC
boundary = right
pressure = 1.01e5
momentum_component = 'x'
[]
[energy_out]
variable = rho_et
type = CNSFVHLLCSpecifiedPressureFluidEnergyBC
boundary = right
pressure = 1.01e5
[]
[]
[Materials]
[var_mat]
type = ConservedVarValuesMaterial
rho = rho
rhou = rho_u
rho_et = rho_et
[]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_max_its = 50
line_search = none
[]
[Outputs]
exodus = true
csv = true
[]
[Debug]
show_var_residual_norms = true
[]
(test/tests/auxkernels/time_derivative_aux/test_fv.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 6
ny = 6
[]
[Variables]
[u]
type = MooseVariableFVReal
initial_condition = 2
[]
[]
[FVKernels]
[time]
type = FVTimeKernel
variable = u
[]
[reaction]
type = FVReaction
variable = u
rate = 2.0
[]
[diffusion]
type = FVDiffusion
variable = u
coeff = 0.1
[]
[]
[FVBCs]
[left]
type = FVNeumannBC
variable = u
value = 5
boundary = 'left'
[]
[]
[AuxVariables]
inactive = 'variable_derivative'
[variable_derivative]
family = MONOMIAL
order = CONSTANT
[]
[variable_derivative_fv]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[]
[AuxKernels]
# Time derivative of a FV variable using the functor system
[function_derivative_element]
type = TimeDerivativeAux
variable = variable_derivative_fv
functor = 'u'
factor = 2
[]
# this places the derivative of a FV variable in a FE one
# let's output a warning
inactive = 'function_derivative_element_fv_fe'
[function_derivative_element_fv_fe]
type = TimeDerivativeAux
variable = variable_derivative
functor = 'u'
factor = 2
[]
[]
[Executioner]
type = Transient
dt = 0.1
num_steps = 2
nl_abs_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/fvbcs/FVHeatFluxBC/wall_heat_transfer.i)
flux=10
[GlobalParams]
porosity = 'porosity'
splitting = 'porosity'
locality = 'global'
average_porosity = 'average_eps'
average_k_fluid='average_k_fluid'
average_k_solid='average_k_solid'
average_kappa='average_k_fluid' # because of vector matprop, should be kappa
average_kappa_solid='average_kappa_solid'
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 20
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
[]
[Variables]
[Tf]
type = MooseVariableFVReal
[]
[Ts]
type = MooseVariableFVReal
[]
[]
[AuxVariables]
[k]
type = MooseVariableFVReal
[]
[kappa]
type = MooseVariableFVReal
[]
[k_s]
type = MooseVariableFVReal
[]
[kappa_s]
type = MooseVariableFVReal
[]
[porosity]
type = MooseVariableFVReal
initial_condition = 0.2
[]
[]
[Functions]
[k]
type = ParsedFunction
expression = 0.1*(100*y+1)
[]
[kappa]
type = ParsedFunction
expression = 0.2*(200*y+1)
[]
[kappa_s]
type = ParsedFunction
expression = 0.4*(200*y+1)
[]
[k_s]
type = ParsedFunction
expression = 0.2*(200*y+1)+2*x
[]
[]
[FVKernels]
[Tf_diffusion]
type = FVDiffusion
variable = Tf
coeff = 1
[]
[Ts_diffusion]
type = FVDiffusion
variable = Ts
coeff = 1
[]
[]
[FVBCs]
[left_Ts]
type = NSFVHeatFluxBC
variable = Ts
boundary = 'left'
phase = 'solid'
value = ${flux}
[]
[right_Ts]
type = FVDirichletBC
variable = Ts
boundary = 'right'
value = 1000.0
[]
[left_Tf]
type = NSFVHeatFluxBC
variable = Tf
boundary = 'left'
phase = 'fluid'
value = ${flux}
[]
[right_Tf]
type = FVDirichletBC
variable = Tf
boundary = 'right'
value = 1000.0
[]
[]
[AuxKernels]
[k]
type = ADMaterialRealAux
variable = k
property = 'k'
[]
[k_s]
type = ADMaterialRealAux
variable = k_s
property = 'k_s'
[]
[kappa_s]
type = ADMaterialRealAux
variable = kappa_s
property = 'kappa_s'
[]
[]
[Materials]
[thermal_conductivities_k]
type = ADGenericFunctionMaterial
prop_names = 'k'
prop_values = 'k'
[]
[thermal_conductivities_k_s]
type = ADGenericFunctionMaterial
prop_names = 'k_s'
prop_values = 'k_s'
[]
[thermal_conductivities_kappa]
type = ADGenericConstantVectorMaterial
prop_names = 'kappa'
prop_values = '0.1 0.2 .03'
[]
[thermal_conductivities_kappa_s]
type = ADGenericFunctionMaterial
prop_names = 'kappa_s'
prop_values = 'kappa_s'
[]
[]
[Postprocessors]
[average_eps]
type = ElementAverageValue
variable = porosity
# because porosity is constant in time, we evaluate this only once
execute_on = 'initial'
[]
[average_k_fluid]
type = ElementAverageValue
variable = k
[]
[average_k_solid]
type = ElementAverageValue
variable = k_s
[]
[average_kappa_solid]
type = ElementAverageValue
variable = kappa_s
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
hide = 'porosity average_eps'
[]
(modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/free-flow-hllc.i)
diff_coeff = 0.1
[GlobalParams]
fp = fp
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = .1
xmax = 1.1
nx = 2
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Variables]
[rho]
type = MooseVariableFVReal
[]
[rho_u]
type = MooseVariableFVReal
[]
[rho_et]
type = MooseVariableFVReal
[]
[]
[ICs]
[rho]
type = FunctionIC
variable = rho
function = 'exact_rho'
[]
[rho_u]
type = FunctionIC
variable = rho_u
function = 'exact_rho_u'
[]
[rho_et]
type = FunctionIC
variable = rho_et
function = 'exact_rho_et'
[]
[]
[FVKernels]
[mass_advection]
type = CNSFVMassHLLC
variable = rho
[]
[mass_fn]
type = FVBodyForce
variable = rho
function = 'forcing_rho'
[]
[momentum_x_advection]
type = CNSFVMomentumHLLC
variable = rho_u
momentum_component = x
[]
[momentum_fn]
type = FVBodyForce
variable = rho_u
function = 'forcing_rho_u'
[]
[fluid_energy_advection]
type = CNSFVFluidEnergyHLLC
variable = rho_et
[]
[energy_fn]
type = FVBodyForce
variable = rho_et
function = 'forcing_rho_et'
[]
[mass_diff]
type = FVDiffusion
variable = rho
coeff = ${diff_coeff}
[]
[momentum_diff]
type = FVDiffusion
variable = rho_u
coeff = ${diff_coeff}
[]
[energy_diff]
type = FVDiffusion
variable = rho_et
coeff = ${diff_coeff}
[]
[]
[FVBCs]
[mass_in]
variable = rho
type = CNSFVHLLCSpecifiedMassFluxAndTemperatureMassBC
boundary = left
temperature = 'exact_T'
rhou = 'exact_rho_u'
[]
[momentum_in]
variable = rho_u
type = CNSFVHLLCSpecifiedMassFluxAndTemperatureMomentumBC
boundary = left
temperature = 'exact_T'
rhou = 'exact_rho_u'
momentum_component = 'x'
[]
[energy_in]
variable = rho_et
type = CNSFVHLLCSpecifiedMassFluxAndTemperatureFluidEnergyBC
boundary = left
temperature = 'exact_T'
rhou = 'exact_rho_u'
[]
[mass_out]
variable = rho
type = CNSFVHLLCSpecifiedPressureMassBC
boundary = right
pressure = 'exact_p'
[]
[momentum_out]
variable = rho_u
type = CNSFVHLLCSpecifiedPressureMomentumBC
boundary = right
pressure = 'exact_p'
momentum_component = 'x'
[]
[energy_out]
variable = rho_et
type = CNSFVHLLCSpecifiedPressureFluidEnergyBC
boundary = right
pressure = 'exact_p'
[]
[left_mass_diffusion]
type = FVFunctionNeumannBC
variable = rho
function = minus_rho_bc
boundary = 'left'
[]
[left_momentum_diffusion]
type = FVFunctionNeumannBC
variable = rho_u
function = minus_rho_u_bc
boundary = 'left'
[]
[left_energy_diffusion]
type = FVFunctionNeumannBC
variable = rho_et
function = minus_rho_et_bc
boundary = 'left'
[]
[right_mass_diffusion]
type = FVFunctionNeumannBC
variable = rho
function = rho_bc
boundary = 'right'
[]
[right_momentum_diffusion]
type = FVFunctionNeumannBC
variable = rho_u
function = rho_u_bc
boundary = 'right'
[]
[right_energy_diffusion]
type = FVFunctionNeumannBC
variable = rho_et
function = rho_et_bc
boundary = 'right'
[]
[]
[Materials]
[var_mat]
type = ConservedVarValuesMaterial
rho = rho
rhou = rho_u
rho_et = rho_et
[]
[]
[Functions]
[exact_rho]
type = ParsedFunction
expression = '3.48788261470924*cos(x)'
[]
[rho_bc]
type = ParsedFunction
value = '-diff_coeff*3.48788261470924*sin(x)'
vars = 'diff_coeff'
vals = '${diff_coeff}'
[]
[minus_rho_bc]
type = ParsedFunction
value = 'diff_coeff*3.48788261470924*sin(x)'
vars = 'diff_coeff'
vals = '${diff_coeff}'
[]
[forcing_rho]
type = ParsedFunction
expression = '-3.83667087618017*sin(1.1*x) + 0.348788261470924*cos(x)'
[]
[exact_rho_u]
type = ParsedFunction
expression = '3.48788261470924*cos(1.1*x)'
[]
[rho_u_bc]
type = ParsedFunction
value = '-diff_coeff*3.48788261470924*1.1*sin(1.1*x)'
vars = 'diff_coeff'
vals = '${diff_coeff}'
[]
[minus_rho_u_bc]
type = ParsedFunction
value = 'diff_coeff*3.48788261470924*1.1*sin(1.1*x)'
vars = 'diff_coeff'
vals = '${diff_coeff}'
[]
[forcing_rho_u]
type = ParsedFunction
expression = '-(10.6975765229419*cos(1.2*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + (10.6975765229419*sin(x)*cos(1.2*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 12.8370918275302*sin(1.2*x)/cos(x))*cos(x) + 3.48788261470924*sin(x)*cos(1.1*x)^2/cos(x)^2 - 7.67334175236034*sin(1.1*x)*cos(1.1*x)/cos(x) + 0.422033796379819*cos(1.1*x)'
[]
[exact_rho_et]
type = ParsedFunction
expression = '26.7439413073546*cos(1.2*x)'
[]
[rho_et_bc]
type = ParsedFunction
value = '-diff_coeff*26.7439413073546*1.2*sin(1.2*x)'
vars = 'diff_coeff'
vals = '${diff_coeff}'
[]
[minus_rho_et_bc]
type = ParsedFunction
value = 'diff_coeff*26.7439413073546*1.2*sin(1.2*x)'
vars = 'diff_coeff'
vals = '${diff_coeff}'
[]
[forcing_rho_et]
type = ParsedFunction
expression = '1.0*(3.48788261470924*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.2*x))*sin(x)*cos(1.1*x)/cos(x)^2 - 1.1*(3.48788261470924*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.2*x))*sin(1.1*x)/cos(x) + 1.0*(-(10.6975765229419*cos(1.2*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + (10.6975765229419*sin(x)*cos(1.2*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 12.8370918275302*sin(1.2*x)/cos(x))*cos(x) - 32.0927295688256*sin(1.2*x))*cos(1.1*x)/cos(x) + 3.85112754825907*cos(1.2*x)'
[]
[exact_T]
type = ParsedFunction
expression = '0.0106975765229418*cos(1.2*x)/cos(x) - 0.000697576522941848*cos(1.1*x)^2/cos(x)^2'
[]
[exact_p]
type = ParsedFunction
expression = '3.48788261470924*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)'
[]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_max_its = 50
line_search = none
nl_rel_tol = 1e-11
nl_abs_tol = 1e-11
[]
[Outputs]
exodus = true
csv = true
[]
[Debug]
show_var_residual_norms = true
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2rho]
type = ElementL2Error
variable = rho
function = exact_rho
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2rho_u]
variable = rho_u
function = exact_rho_u
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2rho_et]
variable = rho_et
function = exact_rho_et
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(test/tests/fvkernels/vector-interpolation/test.i)
a=1.1
[Mesh]
[gen_mesh]
type = GeneratedMeshGenerator
dim = 1
xmin = 0.1
xmax = 1.1
nx = 20
[]
[]
[GlobalParams]
limiter = 'vanLeer'
[]
[ICs]
[u]
type = FunctionIC
variable = u
function = exact
[]
[v]
type = FunctionIC
variable = v
function = exact
[]
[w]
type = FunctionIC
variable = w
function = exact
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
[]
[v]
type = MooseVariableFVReal
[]
[w]
type = MooseVariableFVReal
[]
[]
[FVKernels]
[advection_u]
type = FVLimitedVectorAdvection
variable = u
velocity = '${a} 0 0'
boundaries_to_force = 'right'
x_functor = 'u'
y_functor = 'v'
z_functor = 'w'
component = 0
[]
[body_u]
type = FVBodyForce
variable = u
function = 'forcing'
[]
[advection_v]
type = FVLimitedVectorAdvection
variable = v
velocity = '${a} 0 0'
boundaries_to_force = 'right'
x_functor = 'u'
y_functor = 'v'
z_functor = 'w'
component = 1
[]
[body_v]
type = FVBodyForce
variable = v
function = 'forcing'
[]
[advection_w]
type = FVLimitedVectorAdvection
variable = w
velocity = '${a} 0 0'
boundaries_to_force = 'right'
x_functor = 'u'
y_functor = 'v'
z_functor = 'w'
component = 2
[]
[body_w]
type = FVBodyForce
variable = w
function = 'forcing'
[]
[]
[FVBCs]
[left_u]
type = FVFunctionNeumannBC
boundary = 'left'
function = 'advection'
variable = u
[]
[left_v]
type = FVFunctionNeumannBC
boundary = 'left'
function = 'advection'
variable = v
[]
[left_w]
type = FVFunctionNeumannBC
boundary = 'left'
function = 'advection'
variable = w
[]
[]
[Functions]
[exact]
type = ParsedFunction
expression = 'cos(x)'
[]
[advection]
type = ParsedFunction
expression = '${a} * cos(x)'
[]
[forcing]
type = ParsedFunction
expression = '-${a} * sin(x)'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[]
[Outputs]
exodus = true
[]
(test/tests/fvics/function_ic/parsed_function.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 3.1416
ymin = 0
ymax = 3.1416
nx = 10
ny = 10
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
[]
[]
[Functions]
[parsed_function]
type = ParsedFunction
expression = 'sin(x)-cos(y/2)'
[]
[]
[FVICs]
[u_ic]
type = FVFunctionIC
variable = 'u'
function = parsed_function
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
exodus = true
[]
(test/tests/fvkernels/boundary_execution/2d.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmax = 2
ymax = 2
[]
[subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '0.0 0 0'
top_right = '1.0 1.0 0'
block_id = 1
[]
[corner_inward]
input = subdomain1
type = SideSetsBetweenSubdomainsGenerator
primary_block = '0'
paired_block = '1'
new_boundary = 'corner_inward'
[]
[corner_outward]
input = corner_inward
type = SideSetsBetweenSubdomainsGenerator
primary_block = '1'
paired_block = '0'
new_boundary = 'corner_outward'
[]
[]
[Variables]
[all_domain]
type = MooseVariableFVReal
[]
[part_domain]
type = MooseVariableFVReal
block = 1
[]
[]
[FVKernels]
[diff_all]
type = FVDiffusion
variable = all_domain
coeff = coeff
[]
[diff_part]
type = FVDiffusion
variable = part_domain
coeff = coeff
[]
[]
[FVBCs]
# The boundaries where the flux kernels are executed are
# the dirichlet BCs: left, right and corner_inward
# On top and bottom, not executed because 0 flux is assumed
[left]
type = FVDirichletBC
variable = all_domain
boundary = left
value = 2
[]
[corner_inward]
type = FVDirichletBC
variable = all_domain
boundary = right
value = 1
[]
[corner_outward]
type = FVDirichletBC
variable = part_domain
boundary = corner_inward
value = 2
[]
[right]
type = FVDirichletBC
variable = part_domain
boundary = left
value = 1
[]
[]
[Materials]
[diffusion]
type = ADGenericFunctorMaterial
prop_names = 'coeff'
prop_values = '1'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
line_search = 'none'
[]
[Outputs]
exodus = true
[]
(test/tests/auxkernels/projection_aux/1d.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = 1
nx = 10
elem_type = EDGE3
[]
[ICs]
active = 'constant_elem constant_nodal'
[constant_elem]
type = ConstantIC
variable = base_elem
value = 4
[]
[constant_nodal]
type = ConstantIC
variable = base_nodal
value = 3.5
[]
[linear_elem]
type = FunctionIC
variable = base_elem
function = 2+2*x
[]
[linear_nodal]
type = FunctionIC
variable = base_nodal
function = 3+3*x
[]
[quadratic_elem]
type = FunctionIC
variable = base_elem
function = 2+2*x*x
[]
[quadratic_nodal]
type = FunctionIC
variable = base_nodal
function = 3+3*x*x
[]
[]
[AuxVariables]
# Families:
# LAGRANGE, MONOMIAL, HERMITE, SCALAR, HIERARCHIC, CLOUGH, XYZ, SZABAB, BERNSTEIN,
# L2_LAGRANGE, L2_HIERARCHIC, RATIONAL_BERNSTEIN, SIDE_HIERARCHIC
# Notes:
# - 'elemental': MONOMIAL, XYZ, L2_LAGRANGE, L2_HIERARCHIC
# - 'nodal': LAGRANGE, HERMITE, HIERARCHIC, CLOUGH, SZABAB, BERNSTEIN, RATIONAL_BERNSTEIN
# - Hermite, Hierachic, Clough, Bernstein, rational Bernstein cannot be created on 1D EDGE3 elements
# - Hermite, Hierarchic, Clough, Bernstein, rational Bernstein, Szabab, L2_lagrange, L2_hierarchic
# cannot be created with a constant order
[base_elem]
family = MONOMIAL
order = CONSTANT
[]
[base_nodal]
[]
[test_elem_lagrange]
[]
[test_elem_lagrange_high]
order = SECOND
[]
[test_elem_mono]
family = MONOMIAL
order = CONSTANT
[]
[test_elem_mono_high]
family = MONOMIAL
order = SECOND
[]
[test_elem_fv]
type = MooseVariableFVReal
[]
[test_elem_xyz]
family = XYZ
order = CONSTANT
[]
[test_elem_xyz_high]
family = XYZ
order = SECOND
[]
[test_elem_szabab]
family = SZABAB
order = FIRST
[]
[test_elem_l2_lagrange]
family = L2_LAGRANGE
order = FIRST
[]
[test_elem_l2_lagrange_high]
family = L2_LAGRANGE
order = SECOND
[]
[test_elem_l2_hierarchic]
family = L2_HIERARCHIC
order = FIRST
[]
[test_elem_l2_hierarchic_high]
family = L2_HIERARCHIC
order = SECOND
[]
[test_nodal_lagrange]
[]
[test_nodal_lagrange_high]
order = SECOND
[]
[test_nodal_mono]
family = MONOMIAL
order = CONSTANT
[]
[test_nodal_mono_high]
family = MONOMIAL
order = SECOND
[]
[test_nodal_fv]
type = MooseVariableFVReal
[]
[test_nodal_xyz]
family = XYZ
order = CONSTANT
[]
[test_nodal_xyz_high]
family = XYZ
order = SECOND
[]
[test_nodal_szabab]
family = SZABAB
order = FIRST
[]
[test_nodal_l2_lagrange]
family = L2_LAGRANGE
order = FIRST
[]
[test_nodal_l2_lagrange_high]
family = L2_LAGRANGE
order = SECOND
[]
[test_nodal_l2_hierarchic]
family = L2_HIERARCHIC
order = FIRST
[]
[test_nodal_l2_hierarchic_high]
family = L2_HIERARCHIC
order = SECOND
[]
[]
[AuxKernels]
# Project from constant monomial
[base_elem_proj_lagrange]
type = ProjectionAux
variable = test_elem_lagrange
v = base_elem
[]
[base_elem_proj_lagrange_high]
type = ProjectionAux
variable = test_elem_lagrange_high
v = base_elem
[]
[base_elem_proj_mono]
type = ProjectionAux
variable = test_elem_mono
v = base_elem
[]
[base_elem_proj_mono_high]
type = ProjectionAux
variable = test_elem_mono_high
v = base_elem
[]
[base_elem_proj_fv]
type = ProjectionAux
variable = test_elem_fv
v = base_elem
[]
[base_elem_proj_xyz]
type = ProjectionAux
variable = test_elem_xyz
v = base_elem
[]
[base_elem_proj_xyz_high]
type = ProjectionAux
variable = test_elem_xyz_high
v = base_elem
[]
[base_elem_proj_szabab]
type = ProjectionAux
variable = test_elem_szabab
v = base_elem
[]
[base_elem_proj_l2_lagrange]
type = ProjectionAux
variable = test_elem_l2_lagrange
v = base_elem
[]
[base_elem_proj_l2_lagrange_high]
type = ProjectionAux
variable = test_elem_l2_lagrange_high
v = base_elem
[]
[base_elem_proj_l2_hierarchic]
type = ProjectionAux
variable = test_elem_l2_hierarchic
v = base_elem
[]
[base_elem_proj_l2_hierarchic_high]
type = ProjectionAux
variable = test_elem_l2_hierarchic_high
v = base_elem
[]
# Project from constant nodal
[base_nodal_proj_lagrange]
type = ProjectionAux
variable = test_nodal_lagrange
v = base_nodal
[]
[base_nodal_proj_lagrange_high]
type = ProjectionAux
variable = test_nodal_lagrange_high
v = base_nodal
[]
[base_nodal_proj_mono]
type = ProjectionAux
variable = test_nodal_mono
v = base_nodal
[]
[base_nodal_proj_mono_high]
type = ProjectionAux
variable = test_nodal_mono_high
v = base_nodal
[]
[base_nodal_proj_fv]
type = ProjectionAux
variable = test_nodal_fv
v = base_nodal
[]
[base_nodal_proj_xyz]
type = ProjectionAux
variable = test_nodal_xyz
v = base_nodal
[]
[base_nodal_proj_xyz_high]
type = ProjectionAux
variable = test_nodal_xyz_high
v = base_nodal
[]
[base_nodal_proj_szabab]
type = ProjectionAux
variable = test_nodal_szabab
v = base_nodal
[]
[base_nodal_proj_l2_lagrange]
type = ProjectionAux
variable = test_nodal_l2_lagrange
v = base_nodal
[]
[base_nodal_proj_l2_lagrange_high]
type = ProjectionAux
variable = test_nodal_l2_lagrange_high
v = base_nodal
[]
[base_nodal_proj_l2_hierarchic]
type = ProjectionAux
variable = test_nodal_l2_hierarchic
v = base_nodal
[]
[base_nodal_proj_l2_hierarchic_high]
type = ProjectionAux
variable = test_nodal_l2_hierarchic_high
v = base_nodal
[]
[]
[Postprocessors]
[base_elem_proj_lagrange]
type = ElementL2Difference
variable = test_elem_lagrange
other_variable = base_elem
[]
[base_elem_proj_lagrange_high]
type = ElementL2Difference
variable = test_elem_lagrange_high
other_variable = base_elem
[]
[base_elem_proj_mono]
type = ElementL2Difference
variable = test_elem_mono
other_variable = base_elem
[]
[base_elem_proj_mono_high]
type = ElementL2Difference
variable = test_elem_mono_high
other_variable = base_elem
[]
[base_elem_proj_fv]
type = ElementL2Difference
variable = test_elem_fv
other_variable = base_elem
[]
[base_elem_proj_xyz]
type = ElementL2Difference
variable = test_elem_xyz
other_variable = base_elem
[]
[base_elem_proj_xyz_high]
type = ElementL2Difference
variable = test_elem_xyz_high
other_variable = base_elem
[]
[base_elem_proj_szabab]
type = ElementL2Difference
variable = test_elem_szabab
other_variable = base_elem
[]
[base_elem_proj_l2_lagrange]
type = ElementL2Difference
variable = test_elem_l2_lagrange
other_variable = base_elem
[]
[base_elem_proj_l2_lagrange_high]
type = ElementL2Difference
variable = test_elem_l2_lagrange_high
other_variable = base_elem
[]
[base_elem_proj_l2_hierarchic]
type = ElementL2Difference
variable = test_elem_l2_hierarchic
other_variable = base_elem
[]
[base_elem_proj_l2_hierarchic_high]
type = ElementL2Difference
variable = test_elem_l2_hierarchic_high
other_variable = base_elem
[]
# Project from constant nodal
[base_nodal_proj_lagrange]
type = ElementL2Difference
variable = test_nodal_lagrange
other_variable = base_nodal
[]
[base_nodal_proj_lagrange_high]
type = ElementL2Difference
variable = test_nodal_lagrange_high
other_variable = base_nodal
[]
[base_nodal_proj_mono]
type = ElementL2Difference
variable = test_nodal_mono
other_variable = base_nodal
[]
[base_nodal_proj_mono_high]
type = ElementL2Difference
variable = test_nodal_mono_high
other_variable = base_nodal
[]
[base_nodal_proj_fv]
type = ElementL2Difference
variable = test_nodal_fv
other_variable = base_nodal
[]
[base_nodal_proj_xyz]
type = ElementL2Difference
variable = test_nodal_xyz
other_variable = base_nodal
[]
[base_nodal_proj_xyz_high]
type = ElementL2Difference
variable = test_nodal_xyz_high
other_variable = base_nodal
[]
[base_nodal_proj_szabab]
type = ElementL2Difference
variable = test_nodal_szabab
other_variable = base_nodal
[]
[base_nodal_proj_l2_lagrange]
type = ElementL2Difference
variable = test_nodal_l2_lagrange
other_variable = base_nodal
[]
[base_nodal_proj_l2_lagrange_high]
type = ElementL2Difference
variable = test_nodal_l2_lagrange_high
other_variable = base_nodal
[]
[base_nodal_proj_l2_hierarchic]
type = ElementL2Difference
variable = test_nodal_l2_hierarchic
other_variable = base_nodal
[]
[base_nodal_proj_l2_hierarchic_high]
type = ElementL2Difference
variable = test_nodal_l2_hierarchic_high
other_variable = base_nodal
[]
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
csv = true
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
(modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/regular-straight-channel.i)
[GlobalParams]
fp = fp
[]
[Mesh]
[./gen_mesh]
type = GeneratedMeshGenerator
dim = 1
xmax = 1.5
nx = 15
[../]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Variables]
[rho]
type = MooseVariableFVReal
initial_condition = 1.28969
scaling = 1e3
[]
[rho_u]
type = MooseVariableFVReal
initial_condition = 1.28969
[]
[rho_et]
type = MooseVariableFVReal
initial_condition = 2.525e5
scaling = 1e-2
[]
[]
[FVKernels]
[mass_advection]
type = CNSFVMassHLLC
variable = rho
fp = fp
[]
[momentum_x_advection]
type = CNSFVMomentumHLLC
variable = rho_u
momentum_component = x
fp = fp
[]
[drag]
type = FVReaction
variable = rho_u
rate = 1000
[]
[fluid_energy_advection]
type = CNSFVFluidEnergyHLLC
variable = rho_et
fp = fp
[]
[]
[FVBCs]
[mass_in]
variable = rho
type = CNSFVHLLCSpecifiedMassFluxAndTemperatureMassBC
boundary = left
temperature = 273.15
rhou = 1.28969
[]
[momentum_in]
variable = rho_u
type = CNSFVHLLCSpecifiedMassFluxAndTemperatureMomentumBC
boundary = left
temperature = 273.15
rhou = 1.28969
momentum_component = 'x'
[]
[energy_in]
variable = rho_et
type = CNSFVHLLCSpecifiedMassFluxAndTemperatureFluidEnergyBC
boundary = left
temperature = 273.15
rhou = 1.28969
[]
[mass_out]
variable = rho
type = CNSFVHLLCSpecifiedPressureMassBC
boundary = right
pressure = 1.01e5
[]
[momentum_out]
variable = rho_u
type = CNSFVHLLCSpecifiedPressureMomentumBC
boundary = right
pressure = 1.01e5
momentum_component = 'x'
[]
[energy_out]
variable = rho_et
type = CNSFVHLLCSpecifiedPressureFluidEnergyBC
boundary = right
pressure = 1.01e5
[]
[]
[Materials]
[var_mat]
type = ConservedVarValuesMaterial
rho = rho
rhou = rho_u
rho_et = rho_et
[]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_max_its = 50
line_search = none
[]
[Outputs]
exodus = true
csv = true
[]
[Debug]
show_var_residual_norms = true
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/rayleigh-bernard-two-phase.i)
mu = 1.0
rho = 1e3
mu_d = 0.3
rho_d = 1.0
dp = 0.01
U_lid = 0.0
g = -9.81
[GlobalParams]
velocity_interp_method = 'rc'
advected_interp_method = 'upwind'
rhie_chow_user_object = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = .1
ymin = 0
ymax = .1
nx = 11
ny = 11
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
[]
[vel_y]
type = INSFVVelocityVariable
[]
[pressure]
type = INSFVPressureVariable
[]
[phase_2]
type = INSFVScalarFieldVariable
[]
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[pin_pressure]
type = NSPressurePin
variable = pressure
pin_type = point-value
point = '0 0 0'
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = 'rho_mixture'
[]
[u_time]
type = INSFVMomentumTimeDerivative
variable = vel_x
rho = 'rho_mixture'
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = 'rho_mixture'
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_mixture'
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_buoyant]
type = INSFVMomentumGravity
variable = vel_x
rho = 'rho_mixture'
momentum_component = 'x'
gravity = '0 ${g} 0'
[]
[v_time]
type = INSFVMomentumTimeDerivative
variable = vel_y
rho = 'rho_mixture'
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = 'rho_mixture'
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_mixture'
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[v_buoyant]
type = INSFVMomentumGravity
variable = vel_y
rho = 'rho_mixture'
momentum_component = 'y'
gravity = '0 ${g} 0'
[]
[phase_2_time]
type = FVFunctorTimeKernel
variable = phase_2
[]
[phase_2_advection]
type = INSFVScalarFieldAdvection
variable = phase_2
u_slip = 'vel_slip_x'
v_slip = 'vel_slip_y'
[]
[phase_2_diffusion]
type = FVDiffusion
variable = phase_2
coeff = 1e-3
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${U_lid}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[bottom_phase_2]
type = FVDirichletBC
variable = phase_2
boundary = 'bottom'
value = 1.0
[]
[top_phase_2]
type = FVDirichletBC
variable = phase_2
boundary = 'top'
value = 0.0
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[drag_coefficient]
type = MooseVariableFVReal
[]
[rho_mixture_var]
type = MooseVariableFVReal
[]
[mu_mixture_var]
type = MooseVariableFVReal
[]
[phase_1]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = vel_x
y = vel_y
[]
[populate_cd]
type = FunctorAux
variable = drag_coefficient
functor = 'Darcy_coefficient'
[]
[populate_rho_mixture_var]
type = FunctorAux
variable = rho_mixture_var
functor = 'rho_mixture'
[]
[populate_mu_mixture_var]
type = FunctorAux
variable = mu_mixture_var
functor = 'mu_mixture'
[]
[compute_phase_1]
type = ParsedAux
variable = phase_1
coupled_variables = 'phase_2'
expression = '1 - phase_2'
[]
[]
[FunctorMaterials]
[CD]
type = NSFVDispersePhaseDragFunctorMaterial
rho = 'rho_mixture'
mu = mu_mixture
u = 'vel_x'
v = 'vel_y'
particle_diameter = ${dp}
[]
[mixing_material]
type = NSFVMixtureFunctorMaterial
phase_1_names = '${rho_d} ${mu_d}'
phase_2_names = '${rho} ${mu}'
prop_names = 'rho_mixture mu_mixture'
phase_1_fraction = 'phase_2'
[]
[populate_u_slip]
type = WCNSFV2PSlipVelocityFunctorMaterial
slip_velocity_name = 'vel_slip_x'
momentum_component = 'x'
u = 'vel_x'
v = 'vel_y'
rho = ${rho}
mu = 'mu_mixture'
rho_d = ${rho_d}
particle_diameter = ${dp}
linear_coef_name = 'Darcy_coefficient'
[]
[populate_v_slip]
type = WCNSFV2PSlipVelocityFunctorMaterial
slip_velocity_name = 'vel_slip_y'
momentum_component = 'y'
u = 'vel_x'
v = 'vel_y'
rho = ${rho}
mu = 'mu_mixture'
rho_d = ${rho_d}
particle_diameter = ${dp}
linear_coef_name = 'Darcy_coefficient'
[]
[]
[Postprocessors]
[average_void]
type = ElementAverageValue
variable = 'phase_2'
[]
[max_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = max
[]
[min_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = min
[]
[max_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = max
[]
[min_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = min
[]
[max_x_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_x'
value_type = max
[]
[max_y_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_y'
value_type = max
[]
[max_drag_coefficient]
type = ElementExtremeFunctorValue
functor = 'drag_coefficient'
value_type = max
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 10
iteration_window = 2
growth_factor = 2
cutback_factor = 0.5
dt = 1e-3
[]
nl_max_its = 20
nl_rel_tol = 1e-03
nl_abs_tol = 1e-9
l_max_its = 5
end_time = 1e8
[]
[Outputs]
exodus = false
[CSV]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/dirichlet_bcs_mdot.i)
rho = 'rho'
l = 10
inlet_area = 1
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 10
ny = 5
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = WCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = u
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = v
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T
rho = rho
drho_dt = drho_dt
h = h
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T
v = power_density
[]
[]
[FVBCs]
# Inlet
[inlet_u]
type = WCNSFVInletVelocityBC
variable = u
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'surface_inlet'
rho = 'rho'
[]
[inlet_v]
type = WCNSFVInletVelocityBC
variable = v
boundary = 'left'
mdot_pp = 0
area_pp = 'surface_inlet'
rho = 'rho'
[]
[inlet_T]
type = WCNSFVInletTemperatureBC
variable = T
boundary = 'left'
temperature_pp = 'inlet_T'
[]
[outlet_p]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
[]
# Walls
[no_slip_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = v
boundary = 'top bottom'
function = 0
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_mdot]
type = Receiver
default = ${fparse 1980 * inlet_velocity * inlet_area}
[]
[surface_inlet]
type = AreaPostprocessor
boundary = 'left'
execute_on = 'INITIAL'
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-2
optimal_iterations = 6
[]
end_time = 1
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
exodus = true
execute_on = 'FINAL'
[]
(modules/porous_flow/test/tests/heterogeneous_materials/constant_poroperm_fv.i)
# Assign porosity and permeability variables from constant AuxVariables to create
# a heterogeneous model and solve with FV variables
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 3
nx = 3
ny = 3
nz = 3
xmax = 3
ymax = 3
zmax = 3
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 -10'
[]
[Variables]
[ppwater]
type = MooseVariableFVReal
initial_condition = 1.5e6
[]
[]
[AuxVariables]
[poro]
type = MooseVariableFVReal
[]
[permxx]
type = MooseVariableFVReal
[]
[permxy]
type = MooseVariableFVReal
[]
[permxz]
type = MooseVariableFVReal
[]
[permyx]
type = MooseVariableFVReal
[]
[permyy]
type = MooseVariableFVReal
[]
[permyz]
type = MooseVariableFVReal
[]
[permzx]
type = MooseVariableFVReal
[]
[permzy]
type = MooseVariableFVReal
[]
[permzz]
type = MooseVariableFVReal
[]
[poromat]
family = MONOMIAL
order = CONSTANT
[]
[permxxmat]
family = MONOMIAL
order = CONSTANT
[]
[permxymat]
family = MONOMIAL
order = CONSTANT
[]
[permxzmat]
family = MONOMIAL
order = CONSTANT
[]
[permyxmat]
family = MONOMIAL
order = CONSTANT
[]
[permyymat]
family = MONOMIAL
order = CONSTANT
[]
[permyzmat]
family = MONOMIAL
order = CONSTANT
[]
[permzxmat]
family = MONOMIAL
order = CONSTANT
[]
[permzymat]
family = MONOMIAL
order = CONSTANT
[]
[permzzmat]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[poromat]
type = ADPorousFlowPropertyAux
property = porosity
variable = poromat
[]
[permxxmat]
type = ADPorousFlowPropertyAux
property = permeability
variable = permxxmat
column = 0
row = 0
[]
[permxymat]
type = ADPorousFlowPropertyAux
property = permeability
variable = permxymat
column = 1
row = 0
[]
[permxzmat]
type = ADPorousFlowPropertyAux
property = permeability
variable = permxzmat
column = 2
row = 0
[]
[permyxmat]
type = ADPorousFlowPropertyAux
property = permeability
variable = permyxmat
column = 0
row = 1
[]
[permyymat]
type = ADPorousFlowPropertyAux
property = permeability
variable = permyymat
column = 1
row = 1
[]
[permyzmat]
type = ADPorousFlowPropertyAux
property = permeability
variable = permyzmat
column = 2
row = 1
[]
[permzxmat]
type = ADPorousFlowPropertyAux
property = permeability
variable = permzxmat
column = 0
row = 2
[]
[permzymat]
type = ADPorousFlowPropertyAux
property = permeability
variable = permzymat
column = 1
row = 2
[]
[permzzmat]
type = ADPorousFlowPropertyAux
property = permeability
variable = permzzmat
column = 2
row = 2
[]
[]
[ICs]
[poro]
type = RandomIC
seed = 0
variable = poro
max = 0.5
min = 0.1
[]
[permx]
type = FunctionIC
function = permx
variable = permxx
[]
[permy]
type = FunctionIC
function = permy
variable = permyy
[]
[permz]
type = FunctionIC
function = permz
variable = permzz
[]
[]
[Functions]
[permx]
type = ParsedFunction
expression = '(1+x)*1e-11'
[]
[permy]
type = ParsedFunction
expression = '(1+y)*1e-11'
[]
[permz]
type = ParsedFunction
expression = '(1+z)*1e-11'
[]
[]
[FVKernels]
[mass0]
type = FVPorousFlowMassTimeDerivative
variable = ppwater
[]
[flux0]
type = FVPorousFlowAdvectiveFlux
variable = ppwater
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'ppwater'
number_fluid_phases = 1
number_fluid_components = 1
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 2e9
density0 = 1000
viscosity = 1e-3
thermal_expansion = 0
cv = 2
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
[]
[ppss]
type = ADPorousFlow1PhaseFullySaturated
porepressure = ppwater
[]
[massfrac]
type = ADPorousFlowMassFraction
[]
[simple_fluid]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[porosity]
type = ADPorousFlowPorosityConst
porosity = poro
[]
[permeability]
type = ADPorousFlowPermeabilityConstFromVar
perm_xx = permxx
perm_yy = permyy
perm_zz = permzz
[]
[relperm_water]
type = ADPorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[]
[]
[Postprocessors]
[mass_ph0]
type = FVPorousFlowFluidMass
fluid_component = 0
execute_on = 'initial timestep_end'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 100
dt = 100
[]
[Outputs]
execute_on = 'initial timestep_end'
exodus = true
perf_graph = true
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_mdot.i)
rho = 'rho'
l = 10
inlet_area = 1
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 10
ny = 5
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T_fluid]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[scalar]
type = MooseVariableFVReal
initial_condition = 0.1
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
# Mass equation
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = WCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
# X component momentum equation
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_x
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
# Y component momentum equation
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_y
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
# Energy equation
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T_fluid
rho = rho
drho_dt = drho_dt
h = h
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T_fluid
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T_fluid
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T_fluid
v = power_density
[]
# Scalar concentration equation
[scalar_time]
type = FVFunctorTimeKernel
variable = scalar
[]
[scalar_advection]
type = INSFVScalarFieldAdvection
variable = scalar
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_diffusion]
type = FVDiffusion
variable = scalar
coeff = 1.1
[]
[scalar_source]
type = FVBodyForce
variable = scalar
function = 2.1
[]
[]
[FVBCs]
# Inlet
[inlet_mass]
type = WCNSFVMassFluxBC
variable = pressure
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_u]
type = WCNSFVMomentumFluxBC
variable = vel_x
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'x'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_v]
type = WCNSFVMomentumFluxBC
variable = vel_y
boundary = 'left'
mdot_pp = 0
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'y'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_T]
type = WCNSFVEnergyFluxBC
variable = T_fluid
T_fluid = T_fluid
boundary = 'left'
temperature_pp = 'inlet_T'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
cp = 'cp'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_scalar]
type = WCNSFVScalarFluxBC
variable = scalar
boundary = 'left'
scalar_value_pp = 'inlet_scalar_value'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
passive_scalar = scalar
[]
[outlet_p]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
[]
# Walls
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'top bottom'
function = 0
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_mdot]
type = Receiver
default = ${fparse 1980 * inlet_velocity * inlet_area}
[]
[area_pp_left]
type = AreaPostprocessor
boundary = 'left'
execute_on = 'INITIAL'
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[inlet_scalar_value]
type = Receiver
default = 0.2
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T_fluid
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T_fluid'
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-2
optimal_iterations = 6
[]
end_time = 1
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/dc.i)
p_initial=1.01e5
T=273.15
# u refers to the superficial velocity
u_in=1
rho_in=1.30524
sup_mom_y_in=${fparse u_in * rho_in}
user_limiter='min_mod'
friction_coeff=10
[GlobalParams]
fp = fp
two_term_boundary_expansion = true
limiter = ${user_limiter}
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
nx = 3
ymin = 0
ymax = 18
ny = 90
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
initial_condition = ${p_initial}
[]
[sup_mom_x]
type = MooseVariableFVReal
initial_condition = 1e-15
[]
[sup_mom_y]
type = MooseVariableFVReal
initial_condition = 1e-15
[]
[T_fluid]
type = MooseVariableFVReal
initial_condition = ${T}
[]
[]
[AuxVariables]
[vel_y]
type = MooseVariableFVReal
[]
[rho]
type = MooseVariableFVReal
[]
[eps]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[vel_y]
type = ADMaterialRealAux
variable = vel_y
property = vel_y
execute_on = 'timestep_end'
[]
[rho]
type = ADMaterialRealAux
variable = rho
property = rho
execute_on = 'timestep_end'
[]
[eps]
type = MaterialRealAux
variable = eps
property = porosity
execute_on = 'timestep_end'
[]
[]
[FVKernels]
[mass_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_dt'
variable = pressure
[]
[mass_advection]
type = PCNSFVKTDC
variable = pressure
eqn = "mass"
[]
[momentum_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhou_dt'
variable = sup_mom_x
[]
[momentum_advection]
type = PCNSFVKTDC
variable = sup_mom_x
eqn = "momentum"
momentum_component = 'x'
[]
[eps_grad]
type = PNSFVPGradEpsilon
variable = sup_mom_x
momentum_component = 'x'
epsilon_function = 'eps'
[]
[drag]
type = PCNSFVMomentumFriction
variable = sup_mom_x
momentum_component = 'x'
Darcy_name = 'cl'
momentum_name = superficial_rhou
[]
[momentum_time_y]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhov_dt'
variable = sup_mom_y
[]
[momentum_advection_y]
type = PCNSFVKTDC
variable = sup_mom_y
eqn = "momentum"
momentum_component = 'y'
[]
[eps_grad_y]
type = PNSFVPGradEpsilon
variable = sup_mom_y
momentum_component = 'y'
epsilon_function = 'eps'
[]
[drag_y]
type = PCNSFVMomentumFriction
variable = sup_mom_y
momentum_component = 'y'
Darcy_name = 'cl'
momentum_name = superficial_rhov
[]
[energy_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_et_dt'
variable = T_fluid
[]
[energy_advection]
type = PCNSFVKTDC
variable = T_fluid
eqn = "energy"
[]
[]
[FVBCs]
[rho_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = pressure
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'mass'
velocity_function_includes_rho = true
[]
[rhou_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = sup_mom_x
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'x'
velocity_function_includes_rho = true
[]
[rhov_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = sup_mom_y
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'y'
velocity_function_includes_rho = true
[]
[rho_et_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = T_fluid
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'energy'
velocity_function_includes_rho = true
[]
[rho_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = pressure
pressure = ${p_initial}
eqn = 'mass'
[]
[rhou_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = sup_mom_x
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'x'
[]
[rhov_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = sup_mom_y
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'y'
[]
[rho_et_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = T_fluid
pressure = ${p_initial}
eqn = 'energy'
[]
[wall_pressure_x]
type = PCNSFVImplicitMomentumPressureBC
momentum_component = 'x'
boundary = 'left right'
variable = sup_mom_x
[]
[wall_pressure_y]
type = PCNSFVImplicitMomentumPressureBC
momentum_component = 'y'
boundary = 'left right'
variable = sup_mom_y
[]
# Use these to help create more accurate cell centered gradients for cells adjacent to boundaries
[T_bottom]
type = FVDirichletBC
variable = T_fluid
value = ${T}
boundary = 'bottom'
[]
[sup_mom_x_bottom_and_walls]
type = FVDirichletBC
variable = sup_mom_x
value = 0
boundary = 'bottom left right'
[]
[sup_mom_y_walls]
type = FVDirichletBC
variable = sup_mom_y
value = 0
boundary = 'left right'
[]
[sup_mom_y_bottom]
type = FVDirichletBC
variable = sup_mom_y
value = ${sup_mom_y_in}
boundary = 'bottom'
[]
[p_top]
type = FVDirichletBC
variable = pressure
value = ${p_initial}
boundary = 'top'
[]
[]
[Functions]
[ud_in]
type = ParsedVectorFunction
expression_x = '0'
expression_y = '${sup_mom_y_in}'
[]
[eps]
type = ParsedFunction
expression = 'if(y < 2.8, 1,
if(y < 3.2, 1 - .5 / .4 * (y - 2.8),
if(y < 6.8, .5,
if(y < 7.2, .5 - .25 / .4 * (y - 6.8),
if(y < 10.8, .25,
if(y < 11.2, .25 + .25 / .4 * (y - 10.8),
if(y < 14.8, .5,
if(y < 15.2, .5 + .5 / .4 * (y - 14.8),
1))))))))'
[]
[]
[Materials]
[var_mat]
type = PorousMixedVarMaterial
pressure = pressure
T_fluid = T_fluid
superficial_rhou = sup_mom_x
superficial_rhov = sup_mom_y
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[ad_generic]
type = ADGenericConstantVectorMaterial
prop_names = 'cl'
prop_values = '${friction_coeff} ${friction_coeff} ${friction_coeff}'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = NEWTON
line_search = 'bt'
type = Transient
nl_max_its = 20
[TimeStepper]
type = IterationAdaptiveDT
dt = 5e-5
optimal_iterations = 6
growth_factor = 1.2
[]
num_steps = 10
nl_abs_tol = 1e-8
automatic_scaling = true
compute_scaling_once = false
resid_vs_jac_scaling_param = 0.5
verbose = true
steady_state_detection = true
steady_state_tolerance = 1e-8
normalize_solution_diff_norm_by_dt = false
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
[out]
type = Exodus
[]
[]
[Debug]
show_var_residual_norms = true
[]
[Postprocessors]
active = ''
[num_nl]
type = NumNonlinearIterations
[]
[total_nl]
type = CumulativeValuePostprocessor
postprocessor = num_nl
[]
[]
(modules/navier_stokes/test/tests/finite_volume/materials/ergun/ergun.i)
# This file simulates flow of fluid in a porous elbow for the purpose of verifying
# correct implementation of the various different solution variable sets. This input
# tests correct implementation of the primitive superficial variable set. Flow enters on the top
# and exits on the right. Because the purpose is only to test the equivalence of
# different equation sets, no solid energy equation is included.
porosity_left = 0.4
porosity_right = 0.6
pebble_diameter = 0.06
mu = 1.81e-5 # This has been increased to avoid refining the mesh
M = 28.97e-3
R = 8.3144598
# inlet mass flowrate, kg/s
mdot = -10.0
# inlet mass flux (superficial)
mflux_in_superficial = ${fparse mdot / (pi * 0.5 * 0.5)}
# inlet mass flux (interstitial)
mflux_in_interstitial = ${fparse mflux_in_superficial / porosity_left}
p_initial = 201325.0
T_initial = 300.0
rho_initial = ${fparse p_initial / T_initial * M / R}
vel_y_initial = ${fparse mflux_in_interstitial / rho_initial}
vel_x_initial = 0.0
superficial_vel_y_initial = ${fparse mflux_in_superficial / rho_initial}
superficial_vel_x_initial = 1e-12
# Computation parameters
velocity_interp_method = 'rc'
advected_interp_method = 'upwind'
# ==============================================================================
# GEOMETRY AND MESH
# ==============================================================================
[Mesh]
[fmg]
type = FileMeshGenerator
file = 'ergun_in.e'
[]
coord_type = RZ
[]
[UserObjects]
[rc]
type = PINSFVRhieChowInterpolator
u = superficial_vel_x
v = superficial_vel_y
pressure = pressure
porosity = porosity
[]
[]
[GlobalParams]
porosity = porosity
pebble_diameter = ${pebble_diameter}
fp = fp
# rho for the kernels. Must match fluid property!
rho = ${rho_initial}
fv = true
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
# behavior at time of test creation
two_term_boundary_expansion = false
rhie_chow_user_object = 'rc'
[]
# ==============================================================================
# VARIABLES AND KERNELS
# ==============================================================================
[Variables]
[pressure]
type = INSFVPressureVariable
initial_condition = ${p_initial}
[]
[superficial_vel_x]
type = PINSFVSuperficialVelocityVariable
initial_condition = ${superficial_vel_x_initial}
[]
[superficial_vel_y]
type = PINSFVSuperficialVelocityVariable
initial_condition = ${superficial_vel_y_initial}
[]
[]
[FVKernels]
# Mass Equation.
[mass]
type = PINSFVMassAdvection
variable = 'pressure'
[]
# Momentum x component equation.
[vel_x_time]
type = PINSFVMomentumTimeDerivative
variable = 'superficial_vel_x'
momentum_component = 'x'
[]
[vel_x_advection]
type = PINSFVMomentumAdvection
variable = 'superficial_vel_x'
momentum_component = 'x'
[]
[vel_x_viscosity]
type = PINSFVMomentumDiffusion
variable = 'superficial_vel_x'
momentum_component = 'x'
mu = 'mu'
[]
[u_pressure]
type = PINSFVMomentumPressure
variable = 'superficial_vel_x'
pressure = pressure
momentum_component = 'x'
[]
[u_friction]
type = PINSFVMomentumFriction
variable = 'superficial_vel_x'
Darcy_name = 'Darcy_coefficient'
Forchheimer_name = 'Forchheimer_coefficient'
momentum_component = 'x'
speed = speed
mu = 'mu'
[]
# Momentum y component equation.
[vel_y_time]
type = PINSFVMomentumTimeDerivative
variable = 'superficial_vel_y'
momentum_component = 'y'
[]
[vel_y_advection]
type = PINSFVMomentumAdvection
variable = 'superficial_vel_y'
momentum_component = 'y'
[]
[vel_y_viscosity]
type = PINSFVMomentumDiffusion
variable = 'superficial_vel_y'
momentum_component = 'y'
mu = 'mu'
[]
[v_pressure]
type = PINSFVMomentumPressure
variable = 'superficial_vel_y'
pressure = pressure
momentum_component = 'y'
[]
[v_friction]
type = PINSFVMomentumFriction
variable = 'superficial_vel_y'
Darcy_name = 'Darcy_coefficient'
Forchheimer_name = 'Forchheimer_coefficient'
momentum_component = 'y'
mu = 'mu'
speed = speed
[]
[gravity]
type = PINSFVMomentumGravity
variable = 'superficial_vel_y'
gravity = '0 -9.81 0'
momentum_component = 'y'
[]
[]
# ==============================================================================
# AUXVARIABLES AND AUXKERNELS
# ==============================================================================
[AuxVariables]
[T_fluid]
initial_condition = ${T_initial}
order = CONSTANT
family = MONOMIAL
[]
[vel_x]
initial_condition = ${fparse vel_x_initial}
order = CONSTANT
family = MONOMIAL
[]
[vel_y]
initial_condition = ${fparse vel_y_initial}
order = CONSTANT
family = MONOMIAL
[]
[porosity_out]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[vel_x]
type = FunctorAux
variable = vel_x
functor = vel_x_mat
[]
[vel_y]
type = FunctorAux
variable = vel_y
functor = vel_y_mat
[]
[porosity_out]
type = FunctorAux
variable = porosity_out
functor = porosity
[]
[]
# ==============================================================================
# FLUID PROPERTIES, MATERIALS AND USER OBJECTS
# ==============================================================================
[FluidProperties]
[fp]
type = IdealGasFluidProperties
k = 0.0
mu = ${mu}
gamma = 1.4
molar_mass = ${M}
[]
[]
[FunctorMaterials]
[enthalpy]
type = INSFVEnthalpyMaterial
temperature = 'T_fluid'
[]
[speed]
type = PINSFVSpeedFunctorMaterial
superficial_vel_x = 'superficial_vel_x'
superficial_vel_y = 'superficial_vel_y'
porosity = porosity
vel_x = vel_x_mat
vel_y = vel_y_mat
[]
[kappa]
type = FunctorKappaFluid
[]
[const_Fdrags_mat]
type = FunctorErgunDragCoefficients
porosity = porosity
[]
[fluidprops]
type = GeneralFunctorFluidProps
mu_rampdown = mu_func
porosity = porosity
characteristic_length = ${pebble_diameter}
T_fluid = 'T_fluid'
pressure = 'pressure'
speed = 'speed'
[]
[]
d = 0.05
[Functions]
[mu_func]
type = PiecewiseLinear
x = '1 3 5 10 15 20'
y = '1e5 1e4 1e3 1e2 1e1 1'
[]
[real_porosity_function]
type = ParsedFunction
expression = 'if (x < 0.6 - ${d}, ${porosity_left}, if (x > 0.6 + ${d}, ${porosity_right},
(x-(0.6-${d}))/(2*${d})*(${porosity_right}-${porosity_left}) + ${porosity_left}))'
[]
[porosity]
type = ParsedFunction
expression = 'if (x < 0.6 - ${d}, ${porosity_left}, if (x > 0.6 + ${d}, ${porosity_right},
(x-(0.6-${d}))/(2*${d})*(${porosity_right}-${porosity_left}) + ${porosity_left}))'
[]
[]
# ==============================================================================
# BOUNDARY CONDITIONS
# ==============================================================================
[FVBCs]
[outlet_p]
type = INSFVOutletPressureBC
variable = 'pressure'
function = ${p_initial}
boundary = 'right'
[]
## No or Free slip BC
[free-slip-wall-x]
type = INSFVNaturalFreeSlipBC
boundary = 'bottom wall_1 wall_2 left'
variable = superficial_vel_x
momentum_component = 'x'
[]
[free-slip-wall-y]
type = INSFVNaturalFreeSlipBC
boundary = 'bottom wall_1 wall_2 left'
variable = superficial_vel_y
momentum_component = 'y'
[]
## Symmetry
[symmetry-x]
type = PINSFVSymmetryVelocityBC
boundary = 'left'
variable = superficial_vel_x
u = superficial_vel_x
v = superficial_vel_y
mu = 'mu'
momentum_component = 'x'
[]
[symmetry-y]
type = PINSFVSymmetryVelocityBC
boundary = 'left'
variable = superficial_vel_y
u = superficial_vel_x
v = superficial_vel_y
mu = 'mu'
momentum_component = 'y'
[]
[symmetry-p]
type = INSFVSymmetryPressureBC
boundary = 'left'
variable = 'pressure'
[]
## inlet
[inlet_vel_x]
type = INSFVInletVelocityBC
variable = 'superficial_vel_x'
function = ${superficial_vel_x_initial}
boundary = 'top'
[]
[inlet_vel_y]
type = INSFVInletVelocityBC
variable = 'superficial_vel_y'
function = ${superficial_vel_y_initial}
boundary = 'top'
[]
[]
# ==============================================================================
# EXECUTION PARAMETERS
# ==============================================================================
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -ksp_gmres_restart'
petsc_options_value = 'asm lu NONZERO 200'
line_search = 'none'
# Problem time parameters
dtmin = 0.01
dtmax = 2000
end_time = 3000
# must be the same as the fluid
# Iterations parameters
l_max_its = 50
l_tol = 1e-8
nl_max_its = 25
# nl_rel_tol = 5e-7
nl_abs_tol = 2e-7
# Automatic scaling
automatic_scaling = true
verbose = true
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.025
cutback_factor = 0.5
growth_factor = 2.0
[]
# Steady state detection.
steady_state_detection = true
steady_state_tolerance = 1e-7
steady_state_start_time = 400
[]
# ==============================================================================
# POSTPROCESSORS DEBUG AND OUTPUTS
# ==============================================================================
[Postprocessors]
[mass_flow_in]
type = VolumetricFlowRate
boundary = 'top'
vel_x = 'superficial_vel_x'
vel_y = 'superficial_vel_y'
advected_quantity = ${rho_initial}
execute_on = 'INITIAL TIMESTEP_END'
[]
[mass_flow_out]
type = VolumetricFlowRate
boundary = 'right'
vel_x = 'superficial_vel_x'
vel_y = 'superficial_vel_y'
advected_quantity = ${rho_initial}
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_in]
type = SideAverageValue
variable = pressure
boundary = 'top'
[]
[dP]
type = LinearCombinationPostprocessor
pp_names = 'p_in'
pp_coefs = '1.0'
b = ${fparse -p_initial}
[]
[]
[Outputs]
exodus = true
print_linear_residuals = false
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_velocity.i)
rho = 'rho'
l = 10
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 10
ny = 5
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T_fluid]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[scalar]
type = MooseVariableFVReal
initial_condition = 0.1
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = WCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_x
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_y
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T_fluid
rho = rho
drho_dt = drho_dt
h = h
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T_fluid
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T_fluid
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T_fluid
v = power_density
[]
# Scalar concentration equation
[scalar_time]
type = FVFunctorTimeKernel
variable = scalar
[]
[scalar_advection]
type = INSFVScalarFieldAdvection
variable = scalar
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_diffusion]
type = FVDiffusion
variable = scalar
coeff = 1.1
[]
[scalar_source]
type = FVBodyForce
variable = scalar
function = 2.1
[]
[]
[FVBCs]
# Inlet
[inlet_mass]
type = WCNSFVMassFluxBC
variable = pressure
boundary = 'left'
velocity_pp = 'inlet_u'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_u]
type = WCNSFVMomentumFluxBC
variable = vel_x
boundary = 'left'
velocity_pp = 'inlet_u'
rho = 'rho'
momentum_component = 'x'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_v]
type = WCNSFVMomentumFluxBC
variable = vel_y
boundary = 'left'
velocity_pp = 0
rho = 'rho'
momentum_component = 'y'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_T]
type = WCNSFVEnergyFluxBC
variable = T_fluid
T_fluid = T_fluid
boundary = 'left'
velocity_pp = 'inlet_u'
temperature_pp = 'inlet_T'
rho = 'rho'
cp = 'cp'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_scalar]
type = WCNSFVScalarFluxBC
variable = scalar
boundary = 'left'
scalar_value_pp = 'inlet_scalar_value'
velocity_pp = 'inlet_u'
vel_x = vel_x
vel_y = vel_y
rho = rho
passive_scalar = scalar
[]
[outlet_p]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
[]
# Walls
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'top bottom'
function = 0
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_u]
type = Receiver
default = ${inlet_velocity}
[]
[area_pp_left]
type = AreaPostprocessor
boundary = 'left'
execute_on = 'INITIAL'
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[inlet_scalar_value]
type = Receiver
default = 0.2
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T_fluid
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T_fluid'
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-2
optimal_iterations = 6
[]
end_time = 1
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_reversal.i)
rho = 'rho'
l = 10
inlet_area = 1
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.1
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 6
ny = 3
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T_fluid]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[scalar]
type = MooseVariableFVReal
initial_condition = 0.1
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e6
[]
[]
[FVKernels]
# Mass equation
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[mean_zero_pressure]
type = FVIntegralValueConstraint
variable = pressure
lambda = lambda
phi0 = 0.0
[]
# X component momentum equation
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_x
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
# Y component momentum equation
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_y
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
# Energy equation
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T_fluid
rho = rho
drho_dt = drho_dt
dh_dt = dh_dt
h = h
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T_fluid
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T_fluid
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T_fluid
v = power_density
[]
# Scalar concentration equation
[scalar_time]
type = FVFunctorTimeKernel
variable = scalar
[]
[scalar_advection]
type = INSFVScalarFieldAdvection
variable = scalar
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_diffusion]
type = FVDiffusion
variable = scalar
coeff = 1.1
[]
[scalar_source]
type = FVBodyForce
variable = scalar
function = 2.1
[]
[]
[FVBCs]
# Inlet
[inlet_mass]
type = WCNSFVMassFluxBC
variable = pressure
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_u]
type = WCNSFVMomentumFluxBC
variable = vel_x
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'x'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_v]
type = WCNSFVMomentumFluxBC
variable = vel_y
boundary = 'left'
mdot_pp = 0
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'y'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_T]
type = WCNSFVEnergyFluxBC
variable = T_fluid
T_fluid = T_fluid
boundary = 'left'
temperature_pp = 'inlet_T'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
cp = 'cp'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_scalar]
type = WCNSFVScalarFluxBC
variable = scalar
boundary = 'left'
scalar_value_pp = 'inlet_scalar_value'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
passive_scalar = scalar
[]
[outlet_mass]
type = WCNSFVMassFluxBC
variable = pressure
boundary = 'right'
mdot_pp = 'outlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
[]
[outlet_u]
type = WCNSFVMomentumFluxBC
variable = vel_x
boundary = 'right'
mdot_pp = 'outlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'x'
vel_x = vel_x
vel_y = vel_y
[]
[outlet_v]
type = WCNSFVMomentumFluxBC
variable = vel_y
boundary = 'right'
mdot_pp = 0
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'y'
vel_x = vel_x
vel_y = vel_y
[]
[outlet_T]
type = WCNSFVEnergyFluxBC
variable = T_fluid
T_fluid = T_fluid
boundary = 'right'
temperature_pp = 'inlet_T'
mdot_pp = 'outlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
cp = 'cp'
vel_x = vel_x
vel_y = vel_y
[]
[outlet_scalar]
type = WCNSFVScalarFluxBC
variable = scalar
boundary = 'right'
scalar_value_pp = 'inlet_scalar_value'
mdot_pp = 'outlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
passive_scalar = scalar
[]
# Walls
[no_slip_x]
type = INSFVNaturalFreeSlipBC
variable = vel_x
momentum_component = x
boundary = 'top bottom'
[]
[no_slip_y]
type = INSFVNaturalFreeSlipBC
variable = vel_y
momentum_component = y
boundary = 'top bottom'
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_mdot]
type = Receiver
default = ${fparse 1980 * inlet_velocity * inlet_area}
#outputs = none
[]
[outlet_mdot]
type = Receiver
default = ${fparse -1980 * inlet_velocity * inlet_area}
outputs = none
[]
[area_pp_left]
type = AreaPostprocessor
boundary = 'left'
execute_on = 'INITIAL'
outputs = none
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
outputs = none
[]
[inlet_scalar_value]
type = Receiver
default = 0.2
outputs = none
[]
[left_mdot]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
advected_quantity = rho
boundary = left
#advected_interp_method = ${advected_interp_method}
[]
[right_mdot]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
advected_quantity = rho
boundary = right
advected_interp_method = upwind #${advected_interp_method}
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k rho'
prop_values = '${cp} ${k} 1980'
[]
#[rho]
# type = RhoFromPTFunctorMaterial
# fp = fp
# temperature = T_fluid
# pressure = pressure
#[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T_fluid'
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-1
optimal_iterations = 6
growth_factor = 4
[]
end_time = 500000
nl_abs_tol = 1e-7
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/varying-eps-basic-kt-primitive.i)
[GlobalParams]
fp = fp
limiter = 'central_difference'
two_term_boundary_expansion = true
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = .1
xmax = .6
nx = 2
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
[]
[sup_vel_x]
type = MooseVariableFVReal
[]
[T_fluid]
type = MooseVariableFVReal
[]
[]
[ICs]
[pressure]
type = FunctionIC
variable = pressure
function = 'exact_p'
[]
[sup_vel_x]
type = FunctionIC
variable = sup_vel_x
function = 'exact_sup_vel_x'
[]
[T_fluid]
type = FunctionIC
variable = T_fluid
function = 'exact_T'
[]
[]
[FVKernels]
[mass_advection]
type = PCNSFVKT
variable = pressure
eqn = "mass"
[]
[mass_fn]
type = FVBodyForce
variable = pressure
function = 'forcing_rho'
[]
[momentum_x_advection]
type = PCNSFVKT
variable = sup_vel_x
momentum_component = x
eqn = "momentum"
[]
[eps_grad]
type = PNSFVPGradEpsilon
variable = sup_vel_x
momentum_component = 'x'
epsilon_function = 'eps'
[]
[momentum_fn]
type = FVBodyForce
variable = sup_vel_x
function = 'forcing_rho_ud'
[]
[fluid_energy_advection]
type = PCNSFVKT
variable = T_fluid
eqn = "energy"
[]
[energy_fn]
type = FVBodyForce
variable = T_fluid
function = 'forcing_rho_et'
[]
[]
[FVBCs]
[mass_left]
variable = pressure
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'mass'
[]
[momentum_left]
variable = sup_vel_x
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'momentum'
momentum_component = 'x'
[]
[energy_left]
variable = T_fluid
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'energy'
[]
[mass_right]
variable = pressure
type = PCNSFVStrongBC
boundary = right
eqn = 'mass'
pressure = 'exact_p'
[]
[momentum_right]
variable = sup_vel_x
type = PCNSFVStrongBC
boundary = right
eqn = 'momentum'
momentum_component = 'x'
pressure = 'exact_p'
[]
[energy_right]
variable = T_fluid
type = PCNSFVStrongBC
boundary = right
eqn = 'energy'
pressure = 'exact_p'
[]
# help gradient reconstruction
[pressure_right]
type = FVFunctionDirichletBC
variable = pressure
function = exact_p
boundary = 'right'
[]
[sup_vel_x_left]
type = FVFunctionDirichletBC
variable = sup_vel_x
function = exact_sup_vel_x
boundary = 'left'
[]
[T_fluid_left]
type = FVFunctionDirichletBC
variable = T_fluid
function = exact_T
boundary = 'left'
[]
[]
[Materials]
[var_mat]
type = PorousPrimitiveVarMaterial
pressure = pressure
superficial_vel_x = sup_vel_x
T_fluid = T_fluid
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[]
[Functions]
[exact_rho]
type = ParsedFunction
expression = '3.48788261470924*cos(x)'
[]
[forcing_rho]
type = ParsedFunction
expression = '-3.83667087618017*sin(1.1*x)*cos(1.3*x) - 4.53424739912202*sin(1.3*x)*cos(1.1*x)'
[]
[exact_rho_ud]
type = ParsedFunction
expression = '3.48788261470924*cos(1.1*x)*cos(1.3*x)'
[]
[forcing_rho_ud]
type = ParsedFunction
expression = '(-(10.6975765229419*cos(1.5*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + (10.6975765229419*sin(x)*cos(1.5*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 16.0463647844128*sin(1.5*x)/cos(x))*cos(x))*cos(1.3*x) + 3.48788261470924*sin(x)*cos(1.1*x)^2*cos(1.3*x)/cos(x)^2 - 7.67334175236034*sin(1.1*x)*cos(1.1*x)*cos(1.3*x)/cos(x) - 4.53424739912202*sin(1.3*x)*cos(1.1*x)^2/cos(x)'
[]
[exact_rho_et]
type = ParsedFunction
expression = '26.7439413073546*cos(1.5*x)'
[]
[forcing_rho_et]
type = ParsedFunction
expression = '1.0*(3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.5*x))*sin(x)*cos(1.1*x)*cos(1.3*x)/cos(x)^2 - 1.1*(3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.5*x))*sin(1.1*x)*cos(1.3*x)/cos(x) - 1.3*(3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.5*x))*sin(1.3*x)*cos(1.1*x)/cos(x) + 1.0*(-(10.6975765229419*cos(1.5*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + (10.6975765229419*sin(x)*cos(1.5*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 16.0463647844128*sin(1.5*x)/cos(x))*cos(x) - 40.1159119610319*sin(1.5*x))*cos(1.1*x)*cos(1.3*x)/cos(x)'
[]
[exact_T]
type = ParsedFunction
expression = '0.0106975765229418*cos(1.5*x)/cos(x) - 0.000697576522941848*cos(1.1*x)^2/cos(x)^2'
[]
[exact_eps_p]
type = ParsedFunction
expression = '3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)*cos(1.3*x)'
[]
[exact_p]
type = ParsedFunction
expression = '3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)'
[]
[exact_sup_vel_x]
type = ParsedFunction
expression = '1.0*cos(1.1*x)*cos(1.3*x)/cos(x)'
[]
[eps]
type = ParsedFunction
expression = 'cos(1.3*x)'
[]
[exact_superficial_velocity]
type = ParsedVectorFunction
expression_x = '1.0*cos(1.1*x)*cos(1.3*x)/cos(x)'
[]
[]
[Executioner]
solve_type = NEWTON
type = Transient
num_steps = 1
dtmin = 1
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_max_its = 50
line_search = bt
nl_rel_tol = 1e-12
nl_abs_tol = 1e-12
[]
[Outputs]
exodus = true
csv = true
[]
[Debug]
show_var_residual_norms = true
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2pressure]
type = ElementL2Error
variable = pressure
function = exact_p
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2sup_vel_x]
variable = sup_vel_x
function = exact_sup_vel_x
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2T_fluid]
variable = T_fluid
function = exact_T
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/bfs/BFS_ERCOFTAC.i)
##########################################################
# ERCOFTAC test case foe BFS
# Case Number: 031
# Author: Dr. Mauricio Tano
# Last Update: Novomber, 2023
# Turbulent model using:
# k-epsilon model
# Equilibrium + Newton wall treatement
# SIMPLE solve
##########################################################
Re = 5100
rho = 1.0
bulk_u = 1.0
H = 1.0
mu = '${fparse rho * bulk_u * H/ Re}'
advected_interp_method = 'upwind'
pressure_tag = "pressure_grad"
### k-epslilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Initial and Boundary Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * bulk_u)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / H}'
### Modeling parameters ###
non_equilibrium_treatment = true
bulk_wall_treatment = false
walls = 'bottom wall-side top'
max_mixing_length = 1e10
linearized_yplus_mu_t = false
wall_treatment = 'eq_incremental' # Options: eq_newton, eq_incremental, eq_linearized, neq
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '${fparse 10.0*H} ${fparse 20.0*H}'
dy = '${H} ${fparse 5*H}'
ix = '8 16'
iy = '2 8'
subdomain_id = '
2 1
1 1
'
[]
[corner_walls]
type = SideSetsBetweenSubdomainsGenerator
input = gen
primary_block = '1'
paired_block = '2'
new_boundary = 'wall-side'
[]
[delete_bottom]
type = BlockDeletionGenerator
input = corner_walls
block = '2'
[]
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
velocity_interp_method = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolatorSegregated
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = ${bulk_u}
solver_sys = u_system
two_term_boundary_expansion = false
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 0
solver_sys = v_system
two_term_boundary_expansion = false
[]
[pressure]
type = INSFVPressureVariable
initial_condition = 1e-8
solver_sys = pressure_system
two_term_boundary_expansion = false
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
[]
[]
[FVKernels]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = true
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = true
u = vel_x
v = vel_y
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[p_diffusion]
type = FVAnisotropicDiffusion
variable = pressure
coeff = "Ainv"
coeff_interp_method = 'average'
[]
[p_source]
type = FVDivergence
variable = pressure
vector_field = "HbyA"
force_boundary_execution = true
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
non_equilibrium_treatment = ${non_equilibrium_treatment}
max_mixing_length = ${max_mixing_length}
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
k = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
non_equilibrium_treatment = ${non_equilibrium_treatment}
max_mixing_length = ${max_mixing_length}
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_x
functor = '${bulk_u}'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_y
functor = 0
[]
[inlet_TKE]
type = INSFVInletIntensityTKEBC
boundary = 'left'
variable = TKE
u = vel_x
v = vel_y
intensity = ${intensity}
[]
[inlet_TKED]
type = INSFVMixingLengthTKEDBC
boundary = 'left'
variable = TKED
k = TKE
characteristic_length = '${fparse 2*H}'
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
functor = 0
[]
[walls-u]
type = FVDirichletBC
boundary = ${walls}
variable = vel_x
value = 0
[]
[walls-v]
type = FVDirichletBC
boundary = ${walls}
variable = vel_y
value = 0
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = ${walls}
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
k = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
linearized_yplus = ${linearized_yplus_mu_t}
non_equilibrium_treatment = ${non_equilibrium_treatment}
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKED_system TKE_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
turbulence_equation_relaxation = '0.3 0.3'
num_iterations = 500
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
[]
[Outputs]
exodus = true
[console]
type = Console
outlier_variable_norms = false
[]
[]
(modules/porous_flow/test/tests/poroperm/PermTensorFromVar01_fv.i)
# Testing permeability calculated from scalar and tensor
# Trivial test, checking calculated permeability is correct
# k = k_anisotropy * perm
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 3
xmin = 0
xmax = 3
[]
[]
[GlobalParams]
block = 0
PorousFlowDictator = dictator
[]
[Variables]
[pp]
type = MooseVariableFVReal
[FVInitialCondition]
type = FVConstantIC
value = 0
[]
[]
[]
[FVKernels]
[flux]
type = FVPorousFlowAdvectiveFlux
gravity = '0 0 0'
variable = pp
[]
[]
[FVBCs]
[ptop]
type = FVDirichletBC
variable = pp
boundary = right
value = 0
[]
[pbase]
type = FVDirichletBC
variable = pp
boundary = left
value = 1
[]
[]
[AuxVariables]
[perm_var]
type = MooseVariableFVReal
[]
[perm_x]
type = MooseVariableFVReal
[]
[perm_y]
type = MooseVariableFVReal
[]
[perm_z]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[perm_var]
type = ConstantAux
value = 2
variable = perm_var
[]
[perm_x]
type = ADPorousFlowPropertyAux
property = permeability
variable = perm_x
row = 0
column = 0
[]
[perm_y]
type = ADPorousFlowPropertyAux
property = permeability
variable = perm_y
row = 1
column = 1
[]
[perm_z]
type = ADPorousFlowPropertyAux
property = permeability
variable = perm_z
row = 2
column = 2
[]
[]
[Postprocessors]
[perm_x_left]
type = PointValue
variable = perm_x
point = '0.5 0 0'
[]
[perm_y_left]
type = PointValue
variable = perm_y
point = '0.5 0 0'
[]
[perm_z_left]
type = PointValue
variable = perm_z
point = '0.5 0 0'
[]
[perm_x_right]
type = PointValue
variable = perm_x
point = '2.5 0 0'
[]
[perm_y_right]
type = PointValue
variable = perm_y
point = '2.5 0 0'
[]
[perm_z_right]
type = PointValue
variable = perm_z
point = '2.5 0 0'
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp'
number_fluid_phases = 1
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
# unimportant in this fully-saturated test
m = 0.8
alpha = 1e-4
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
[]
[]
[Materials]
[permeability]
type = ADPorousFlowPermeabilityTensorFromVar
k_anisotropy = '1 0 0 0 2 0 0 0 0.1'
perm = perm_var
[]
[temperature]
type = ADPorousFlowTemperature
[]
[massfrac]
type = ADPorousFlowMassFraction
[]
[eff_fluid_pressure]
type = ADPorousFlowEffectiveFluidPressure
[]
[ppss]
type = ADPorousFlow1PhaseP
porepressure = pp
capillary_pressure = pc
[]
[simple_fluid]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[porosity]
type = ADPorousFlowPorosityConst
porosity = 0.1
[]
[relperm]
type = ADPorousFlowRelativePermeabilityCorey
n = 0 # unimportant in this fully-saturated situation
phase = 0
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = Newton
l_tol = 1E-5
nl_abs_tol = 1E-3
nl_rel_tol = 1E-8
l_max_its = 200
nl_max_its = 400
[]
[Outputs]
file_base = 'PermTensorFromVar01_out'
csv = true
execute_on = 'timestep_end'
[]
(modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/porous-hllc.i)
eps=0.9
[GlobalParams]
fp = fp
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = .1
xmax = 1.1
nx = 2
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Variables]
[rho]
type = MooseVariableFVReal
[]
[rho_ud]
type = MooseVariableFVReal
[]
[rho_et]
type = MooseVariableFVReal
[]
[]
[ICs]
[rho]
type = FunctionIC
variable = rho
function = 'exact_rho'
[]
[rho_ud]
type = FunctionIC
variable = rho_ud
function = 'exact_rho_ud'
[]
[rho_et]
type = FunctionIC
variable = rho_et
function = 'exact_rho_et'
[]
[]
[FVKernels]
[mass_advection]
type = PCNSFVMassHLLC
variable = rho
fp = fp
[]
[mass_fn]
type = FVBodyForce
variable = rho
function = 'forcing_rho'
[]
[momentum_x_advection]
type = PCNSFVMomentumHLLC
variable = rho_ud
momentum_component = x
fp = fp
[]
[momentum_fn]
type = FVBodyForce
variable = rho_ud
function = 'forcing_rho_ud'
[]
[fluid_energy_advection]
type = PCNSFVFluidEnergyHLLC
variable = rho_et
fp = fp
[]
[energy_fn]
type = FVBodyForce
variable = rho_et
function = 'forcing_rho_et'
[]
[]
[FVBCs]
[mass_in]
variable = rho
type = PCNSFVHLLCSpecifiedMassFluxAndTemperatureMassBC
boundary = left
temperature = 'exact_T'
superficial_rhou = 'exact_rho_ud'
[]
[momentum_in]
variable = rho_ud
type = PCNSFVHLLCSpecifiedMassFluxAndTemperatureMomentumBC
boundary = left
temperature = 'exact_T'
superficial_rhou = 'exact_rho_ud'
momentum_component = 'x'
[]
[energy_in]
variable = rho_et
type = PCNSFVHLLCSpecifiedMassFluxAndTemperatureFluidEnergyBC
boundary = left
temperature = 'exact_T'
superficial_rhou = 'exact_rho_ud'
[]
[mass_out]
variable = rho
type = PCNSFVHLLCSpecifiedPressureMassBC
boundary = right
pressure = 'exact_p'
[]
[momentum_out]
variable = rho_ud
type = PCNSFVHLLCSpecifiedPressureMomentumBC
boundary = right
pressure = 'exact_p'
momentum_component = 'x'
[]
[energy_out]
variable = rho_et
type = PCNSFVHLLCSpecifiedPressureFluidEnergyBC
boundary = right
pressure = 'exact_p'
[]
[]
[Materials]
[var_mat]
type = PorousConservedVarMaterial
rho = rho
superficial_rhou = rho_ud
rho_et = rho_et
porosity = porosity
[]
[porosity]
type = GenericConstantMaterial
prop_names = 'porosity'
prop_values = '${eps}'
[]
[]
[Functions]
[exact_rho]
type = ParsedFunction
expression = '3.48788261470924*cos(x)'
[]
[forcing_rho]
type = ParsedFunction
expression = '-3.83667087618017*eps*sin(1.1*x)'
symbol_names = 'eps'
symbol_values = '${eps}'
[]
[exact_rho_ud]
type = ParsedFunction
expression = '3.48788261470924*eps*cos(1.1*x)'
symbol_names = 'eps'
symbol_values = '${eps}'
[]
[forcing_rho_ud]
type = ParsedFunction
expression = 'eps*(-(10.6975765229419*cos(1.2*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + (10.6975765229419*sin(x)*cos(1.2*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 12.8370918275302*sin(1.2*x)/cos(x))*cos(x)) + 3.48788261470924*eps*sin(x)*cos(1.1*x)^2/cos(x)^2 - 7.67334175236034*eps*sin(1.1*x)*cos(1.1*x)/cos(x)'
symbol_names = 'eps'
symbol_values = '${eps}'
[]
[exact_rho_et]
type = ParsedFunction
expression = '26.7439413073546*cos(1.2*x)'
[]
[forcing_rho_et]
type = ParsedFunction
expression = '1.0*eps*(3.48788261470924*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.2*x))*sin(x)*cos(1.1*x)/cos(x)^2 - 1.1*eps*(3.48788261470924*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.2*x))*sin(1.1*x)/cos(x) + 1.0*eps*(-(10.6975765229419*cos(1.2*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + (10.6975765229419*sin(x)*cos(1.2*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 12.8370918275302*sin(1.2*x)/cos(x))*cos(x) - 32.0927295688256*sin(1.2*x))*cos(1.1*x)/cos(x)'
symbol_names = 'eps'
symbol_values = '${eps}'
[]
[exact_T]
type = ParsedFunction
expression = '0.0106975765229418*cos(1.2*x)/cos(x) - 0.000697576522941848*cos(1.1*x)^2/cos(x)^2'
symbol_names = 'eps'
symbol_values = '${eps}'
[]
[exact_p]
type = ParsedFunction
expression = '3.48788261470924*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)'
symbol_names = 'eps'
symbol_values = '${eps}'
[]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_max_its = 50
line_search = none
nl_rel_tol = 1e-12
nl_abs_tol = 1e-12
[]
[Outputs]
exodus = true
csv = true
[]
[Debug]
show_var_residual_norms = true
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2rho]
type = ElementL2Error
variable = rho
function = exact_rho
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2rho_ud]
variable = rho_ud
function = exact_rho_ud
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2rho_et]
variable = rho_et
function = exact_rho_et
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/solidification/pipe_solidification.i)
mu = 8.8871e-4
rho_solid = 997.561
rho_liquid = 997.561
k_solid = 0.6203
k_liquid = 0.6203
cp_solid = 4181.72
cp_liquid = 4181.72
L = 3e5
T_liquidus = 285
T_solidus = 280
advected_interp_method = 'average'
velocity_interp_method = 'rc'
U_inlet = '${fparse 0.5 * mu / rho_liquid / 0.5}'
T_inlet = 300.0
T_cold = 200.0
Nx = 30
Ny = 5
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Mesh]
coord_type = 'RZ'
rz_coord_axis = 'X'
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = 0
ymax = '${fparse 0.5 * 1.0}'
nx = ${Nx}
ny = ${Ny}
bias_y = '${fparse 1 / 1.2}'
[]
[rename1]
type = RenameBoundaryGenerator
input = gen
old_boundary = 'left'
new_boundary = 'inlet'
[]
[rename2]
type = RenameBoundaryGenerator
input = rename1
old_boundary = 'right'
new_boundary = 'outlet'
[]
[rename3]
type = RenameBoundaryGenerator
input = rename2
old_boundary = 'bottom'
new_boundary = 'symmetry'
[]
[rename4]
type = RenameBoundaryGenerator
input = rename3
old_boundary = 'top'
new_boundary = 'wall'
[]
[rename5]
type = ParsedGenerateSideset
input = rename4
normal = '0 1 0'
combinatorial_geometry = 'x>2.0 & x<8.0 & y>0.49999'
new_sideset_name = 'cooled_wall'
[]
[]
[AuxVariables]
[U]
type = MooseVariableFVReal
[]
[fl]
type = MooseVariableFVReal
initial_condition = 1.0
[]
[density]
type = MooseVariableFVReal
[]
[th_cond]
type = MooseVariableFVReal
[]
[cp_var]
type = MooseVariableFVReal
[]
[darcy_coef]
type = MooseVariableFVReal
[]
[fch_coef]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = vel_x
y = vel_y
[]
[compute_fl]
type = NSLiquidFractionAux
variable = fl
temperature = T
T_liquidus = '${T_liquidus}'
T_solidus = '${T_solidus}'
execute_on = 'TIMESTEP_END'
[]
[rho_out]
type = FunctorAux
functor = 'rho_mixture'
variable = 'density'
[]
[th_cond_out]
type = FunctorAux
functor = 'k_mixture'
variable = 'th_cond'
[]
[cp_out]
type = FunctorAux
functor = 'cp_mixture'
variable = 'cp_var'
[]
[darcy_out]
type = FunctorAux
functor = 'Darcy_coefficient'
variable = 'darcy_coef'
[]
[fch_out]
type = FunctorAux
functor = 'Forchheimer_coefficient'
variable = 'fch_coef'
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 0.0
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 0.0
[]
[pressure]
type = INSFVPressureVariable
[]
[T]
type = INSFVEnergyVariable
initial_condition = '${T_inlet}'
scaling = 1.0
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = rho_mixture
[]
[u_time]
type = INSFVMomentumTimeDerivative
variable = vel_x
rho = rho_mixture
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = rho_mixture
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_friction]
type = INSFVMomentumFriction
variable = vel_x
momentum_component = 'x'
linear_coef_name = 'Darcy_coefficient'
quadratic_coef_name = 'Forchheimer_coefficient'
[]
[v_time]
type = INSFVMomentumTimeDerivative
variable = vel_y
rho = rho_mixture
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = rho_mixture
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[v_friction]
type = INSFVMomentumFriction
variable = vel_y
momentum_component = 'y'
linear_coef_name = 'Darcy_coefficient'
quadratic_coef_name = 'Forchheimer_coefficient'
[]
[T_time]
type = INSFVEnergyTimeDerivative
variable = T
rho = rho_mixture
dh_dt = dh_dt
[]
[energy_advection]
type = INSFVEnergyAdvection
variable = T
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[energy_diffusion]
type = FVDiffusion
coeff = k_mixture
variable = T
[]
[energy_source]
type = NSFVPhaseChangeSource
variable = T
L = ${L}
liquid_fraction = fl
T_liquidus = ${T_liquidus}
T_solidus = ${T_solidus}
rho = 'rho_mixture'
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'inlet'
variable = vel_x
function = '${U_inlet}'
[]
[sym_u]
type = INSFVSymmetryVelocityBC
boundary = 'symmetry'
variable = vel_x
u = vel_x
v = vel_y
mu = ${mu}
momentum_component = 'x'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'inlet'
variable = vel_y
function = 0
[]
[walls-u]
type = INSFVNoSlipWallBC
boundary = 'wall'
variable = vel_x
function = 0
[]
[walls-v]
type = INSFVNoSlipWallBC
boundary = 'wall'
variable = vel_y
function = 0
[]
[sym_v]
type = INSFVSymmetryVelocityBC
boundary = 'symmetry'
variable = vel_y
u = vel_x
v = vel_y
mu = ${mu}
momentum_component = y
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'outlet'
variable = pressure
function = 0
[]
[sym_p]
type = INSFVSymmetryPressureBC
boundary = 'symmetry'
variable = pressure
[]
[sym_T]
type = INSFVSymmetryScalarBC
variable = T
boundary = 'symmetry'
[]
[cooled_wall]
type = FVFunctorDirichletBC
variable = T
functor = '${T_cold}'
boundary = 'cooled_wall'
[]
[]
[FunctorMaterials]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
rho = rho_mixture
cp = cp_mixture
temperature = 'T'
[]
[eff_cp]
type = NSFVMixtureFunctorMaterial
phase_2_names = '${cp_solid} ${k_solid} ${rho_solid}'
phase_1_names = '${cp_liquid} ${k_liquid} ${rho_liquid}'
prop_names = 'cp_mixture k_mixture rho_mixture'
phase_1_fraction = fl
[]
[mushy_zone_resistance]
type = INSFVMushyPorousFrictionFunctorMaterial
liquid_fraction = 'fl'
mu = '${mu}'
rho_l = '${rho_liquid}'
[]
[]
[Executioner]
type = Transient
dt = 5e3
end_time = 1e4
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_abs_tol = 1e-8
nl_max_its = 12
[]
[Postprocessors]
[average_T]
type = ElementAverageValue
variable = T
outputs = csv
execute_on = FINAL
[]
[]
[VectorPostprocessors]
[sat]
type = LineValueSampler
warn_discontinuous_face_values = false
start_point = '0.0 0 0'
end_point = '10.0 0 0'
num_points = '${Nx}'
sort_by = x
variable = 'T'
execute_on = FINAL
[]
[]
[Outputs]
exodus = true
[csv]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/lid-driven-two-phase.i)
mu = 1.0
rho = 1.0e3
mu_d = 0.3
rho_d = 1.0
dp = 0.01
U_lid = 0.1
g = -9.81
[GlobalParams]
velocity_interp_method = 'rc'
advected_interp_method = 'upwind'
rhie_chow_user_object = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = .1
ymin = 0
ymax = .1
nx = 10
ny = 10
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
[]
[vel_y]
type = INSFVVelocityVariable
[]
[pressure]
type = INSFVPressureVariable
[]
[phase_2]
type = INSFVScalarFieldVariable
[]
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[pin_pressure]
type = NSPressurePin
variable = pressure
pin_type = point-value
point = '0 0 0'
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = 'rho_mixture'
[]
[u_time]
type = INSFVMomentumTimeDerivative
variable = vel_x
rho = 'rho_mixture'
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = 'rho_mixture'
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_mixture'
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_buoyant]
type = INSFVMomentumGravity
variable = vel_x
rho = 'rho_mixture'
momentum_component = 'x'
gravity = '0 ${g} 0'
[]
[v_time]
type = INSFVMomentumTimeDerivative
variable = vel_y
rho = 'rho_mixture'
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = 'rho_mixture'
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_mixture'
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[v_buoyant]
type = INSFVMomentumGravity
variable = vel_y
rho = 'rho_mixture'
momentum_component = 'y'
gravity = '0 ${g} 0'
[]
[phase_2_time]
type = FVFunctorTimeKernel
variable = phase_2
[]
[phase_2_advection]
type = INSFVScalarFieldAdvection
variable = phase_2
u_slip = 'vel_slip_x'
v_slip = 'vel_slip_y'
[]
[phase_2_diffusion]
type = FVDiffusion
variable = phase_2
coeff = 1e-3
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${U_lid}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[bottom_phase_2]
type = FVDirichletBC
variable = phase_2
boundary = 'bottom'
value = 1.0
[]
[top_phase_2]
type = FVDirichletBC
variable = phase_2
boundary = 'top'
value = 0.0
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[drag_coefficient]
type = MooseVariableFVReal
[]
[rho_mixture_var]
type = MooseVariableFVReal
[]
[mu_mixture_var]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = vel_x
y = vel_y
[]
[populate_cd]
type = FunctorAux
variable = drag_coefficient
functor = 'Darcy_coefficient'
[]
[populate_rho_mixture_var]
type = FunctorAux
variable = rho_mixture_var
functor = 'rho_mixture'
[]
[populate_mu_mixture_var]
type = FunctorAux
variable = mu_mixture_var
functor = 'mu_mixture'
[]
[]
[FunctorMaterials]
[populate_u_slip]
type = WCNSFV2PSlipVelocityFunctorMaterial
slip_velocity_name = 'vel_slip_x'
momentum_component = 'x'
u = 'vel_x'
v = 'vel_y'
rho = ${rho}
mu = 'mu_mixture'
rho_d = ${rho_d}
particle_diameter = ${dp}
linear_coef_name = 'Darcy_coefficient'
[]
[populate_v_slip]
type = WCNSFV2PSlipVelocityFunctorMaterial
slip_velocity_name = 'vel_slip_y'
momentum_component = 'y'
u = 'vel_x'
v = 'vel_y'
rho = ${rho}
mu = 'mu_mixture'
rho_d = ${rho_d}
particle_diameter = ${dp}
linear_coef_name = 'Darcy_coefficient'
[]
[compute_phase_1]
type = ADParsedFunctorMaterial
property_name = phase_1
functor_names = 'phase_2'
expression = '1 - phase_2'
[]
[CD]
type = NSFVDispersePhaseDragFunctorMaterial
rho = 'rho_mixture'
mu = mu_mixture
u = 'vel_x'
v = 'vel_y'
particle_diameter = ${dp}
[]
[mixing_material]
type = NSFVMixtureFunctorMaterial
phase_1_names = '${rho_d} ${mu_d}'
phase_2_names = '${rho} ${mu}'
prop_names = 'rho_mixture mu_mixture'
phase_1_fraction = 'phase_2'
[]
[]
[Postprocessors]
[average_void]
type = ElementAverageValue
variable = 'phase_2'
[]
[max_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = max
[]
[min_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = min
[]
[max_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = max
[]
[min_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = min
[]
[max_x_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_x'
value_type = max
[]
[max_y_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_y'
value_type = max
[]
[max_drag_coefficient]
type = ElementExtremeFunctorValue
functor = 'drag_coefficient'
value_type = max
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 7
iteration_window = 2
growth_factor = 2.0
cutback_factor = 0.5
dt = 1e-3
[]
nl_max_its = 10
nl_rel_tol = 1e-03
nl_abs_tol = 1e-9
l_max_its = 5
end_time = 1e8
[]
[Outputs]
exodus = false
[CSV]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/pins/mms/porosity_change/pressure-interpolation-corrected-action.i)
mu=1.1
rho=1.1
darcy=1.1
forch=1.1
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 2
ymin = -1
ymax = 1
nx = 2
ny = 2
[]
[]
[AuxVariables]
[eps_out]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[eps_out]
type = FunctorAux
variable = eps_out
functor = porosity
execute_on = 'timestep_end'
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'incompressible'
porous_medium_treatment = true
porosity = porosity
porosity_smoothing_layers = 2
friction_types = 'darcy forchheimer'
friction_coeffs = 'Darcy_coefficient Forchheimer_coefficient'
use_friction_correction = true
consistent_scaling = 1.0
density = 'rho'
dynamic_viscosity = 'mu'
initial_velocity = '1 1 0'
initial_pressure = 0.0
inlet_boundaries = 'left top bottom'
momentum_inlet_types = 'fixed-velocity fixed-velocity fixed-velocity'
momentum_inlet_function = 'exact_u exact_v; exact_u exact_v; exact_u exact_v'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = 'exact_p'
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
[]
[]
[FVKernels]
[mass_forcing]
type = FVBodyForce
variable = pressure
function = forcing_p
[]
[u_forcing]
type = INSFVBodyForce
variable = superficial_vel_x
functor = forcing_u
momentum_component = 'x'
rhie_chow_user_object = 'pins_rhie_chow_interpolator'
[]
[v_forcing]
type = INSFVBodyForce
variable = superficial_vel_y
functor = forcing_v
momentum_component = 'y'
rhie_chow_user_object = 'pins_rhie_chow_interpolator'
[]
[]
[FunctorMaterials]
[darcy]
type = ADGenericVectorFunctorMaterial
prop_names = 'Darcy_coefficient Forchheimer_coefficient'
prop_values = '${darcy} ${darcy} ${darcy} ${forch} ${forch} ${forch}'
[]
[constants]
type = ADGenericFunctorMaterial
prop_names = 'rho mu'
prop_values = '${rho} ${mu}'
[]
[]
[Functions]
[porosity]
type = ParsedFunction
expression = '.5 + .1 * sin(pi * x / 4) * cos(pi * y / 4)'
[]
[exact_u]
type = ParsedFunction
expression = 'sin((1/2)*y*pi)*cos((1/2)*x*pi)'
[]
[forcing_u]
type = ParsedFunction
expression = 'darcy*mu*sin((1/2)*y*pi)*cos((1/2)*x*pi) + (1/2)*forch*rho*sqrt(sin((1/4)*x*pi)^2*cos((1/2)*y*pi)^2 + sin((1/2)*y*pi)^2*cos((1/2)*x*pi)^2)*sin((1/2)*y*pi)*cos((1/2)*x*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5) - mu*(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5)*(0.1*pi^2*sin((1/4)*x*pi)*sin((1/4)*y*pi)*cos((1/2)*x*pi)*cos((1/2)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 + 0.025*pi^2*sin((1/4)*x*pi)*sin((1/2)*y*pi)*cos((1/2)*x*pi)*cos((1/4)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 + 0.01*pi^2*sin((1/4)*x*pi)^2*sin((1/4)*y*pi)^2*sin((1/2)*y*pi)*cos((1/2)*x*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^3 - 1/4*pi^2*sin((1/2)*y*pi)*cos((1/2)*x*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5)) - mu*(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5)*(0.025*pi^2*sin((1/4)*x*pi)*sin((1/2)*y*pi)*cos((1/2)*x*pi)*cos((1/4)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 + 0.1*pi^2*sin((1/2)*x*pi)*sin((1/2)*y*pi)*cos((1/4)*x*pi)*cos((1/4)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 + 0.01*pi^2*sin((1/2)*y*pi)*cos((1/4)*x*pi)^2*cos((1/2)*x*pi)*cos((1/4)*y*pi)^2/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^3 - 1/4*pi^2*sin((1/2)*y*pi)*cos((1/2)*x*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5)) + 0.025*pi*mu*(0.1*pi*sin((1/4)*x*pi)*sin((1/4)*y*pi)*sin((1/2)*y*pi)*cos((1/2)*x*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 + (1/2)*pi*cos((1/2)*x*pi)*cos((1/2)*y*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5))*sin((1/4)*x*pi)*sin((1/4)*y*pi) - 0.025*pi*mu*(-0.1*pi*sin((1/2)*y*pi)*cos((1/4)*x*pi)*cos((1/2)*x*pi)*cos((1/4)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 - 1/2*pi*sin((1/2)*x*pi)*sin((1/2)*y*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5))*cos((1/4)*x*pi)*cos((1/4)*y*pi) + 0.1*pi*rho*sin((1/4)*x*pi)^2*sin((1/4)*y*pi)*sin((1/2)*y*pi)*cos((1/2)*x*pi)*cos((1/2)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 - 0.1*pi*rho*sin((1/2)*y*pi)^2*cos((1/4)*x*pi)*cos((1/2)*x*pi)^2*cos((1/4)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 - 1/2*pi*rho*sin((1/4)*x*pi)*sin((1/2)*y*pi)^2*cos((1/2)*x*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5) + (1/2)*pi*rho*sin((1/4)*x*pi)*cos((1/2)*x*pi)*cos((1/2)*y*pi)^2/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5) - pi*rho*sin((1/2)*x*pi)*sin((1/2)*y*pi)^2*cos((1/2)*x*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5) - 1/4*pi*(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5)*sin((1/4)*x*pi)*sin((3/2)*y*pi)'
symbol_names = 'mu rho darcy forch'
symbol_values = '${mu} ${rho} ${darcy} ${forch}'
[]
[exact_v]
type = ParsedFunction
expression = 'sin((1/4)*x*pi)*cos((1/2)*y*pi)'
[]
[forcing_v]
type = ParsedFunction
expression = 'darcy*mu*sin((1/4)*x*pi)*cos((1/2)*y*pi) + (1/2)*forch*rho*sqrt(sin((1/4)*x*pi)^2*cos((1/2)*y*pi)^2 + sin((1/2)*y*pi)^2*cos((1/2)*x*pi)^2)*sin((1/4)*x*pi)*cos((1/2)*y*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5) - mu*(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5)*(-0.1*pi^2*sin((1/4)*x*pi)^2*sin((1/4)*y*pi)*sin((1/2)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 + 0.025*pi^2*sin((1/4)*x*pi)^2*cos((1/4)*y*pi)*cos((1/2)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 + 0.01*pi^2*sin((1/4)*x*pi)^3*sin((1/4)*y*pi)^2*cos((1/2)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^3 - 1/4*pi^2*sin((1/4)*x*pi)*cos((1/2)*y*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5)) - mu*(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5)*(0.025*pi^2*sin((1/4)*x*pi)^2*cos((1/4)*y*pi)*cos((1/2)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 - 0.05*pi^2*cos((1/4)*x*pi)^2*cos((1/4)*y*pi)*cos((1/2)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 + 0.01*pi^2*sin((1/4)*x*pi)*cos((1/4)*x*pi)^2*cos((1/4)*y*pi)^2*cos((1/2)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^3 - 1/16*pi^2*sin((1/4)*x*pi)*cos((1/2)*y*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5)) + 0.025*pi*mu*(0.1*pi*sin((1/4)*x*pi)^2*sin((1/4)*y*pi)*cos((1/2)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 - 1/2*pi*sin((1/4)*x*pi)*sin((1/2)*y*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5))*sin((1/4)*x*pi)*sin((1/4)*y*pi) - 0.025*pi*mu*(-0.1*pi*sin((1/4)*x*pi)*cos((1/4)*x*pi)*cos((1/4)*y*pi)*cos((1/2)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 + (1/4)*pi*cos((1/4)*x*pi)*cos((1/2)*y*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5))*cos((1/4)*x*pi)*cos((1/4)*y*pi) + 0.1*pi*rho*sin((1/4)*x*pi)^3*sin((1/4)*y*pi)*cos((1/2)*y*pi)^2/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 - 0.1*pi*rho*sin((1/4)*x*pi)*sin((1/2)*y*pi)*cos((1/4)*x*pi)*cos((1/2)*x*pi)*cos((1/4)*y*pi)*cos((1/2)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 - pi*rho*sin((1/4)*x*pi)^2*sin((1/2)*y*pi)*cos((1/2)*y*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5) - 1/2*pi*rho*sin((1/4)*x*pi)*sin((1/2)*x*pi)*sin((1/2)*y*pi)*cos((1/2)*y*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5) + (1/4)*pi*rho*sin((1/2)*y*pi)*cos((1/4)*x*pi)*cos((1/2)*x*pi)*cos((1/2)*y*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5) + (3/2)*pi*(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5)*cos((1/4)*x*pi)*cos((3/2)*y*pi)'
symbol_names = 'mu rho darcy forch'
symbol_values = '${mu} ${rho} ${darcy} ${forch}'
[]
[exact_p]
type = ParsedFunction
expression = 'sin((3/2)*y*pi)*cos((1/4)*x*pi)'
[]
[forcing_p]
type = ParsedFunction
expression = '-1/2*pi*rho*sin((1/4)*x*pi)*sin((1/2)*y*pi) - 1/2*pi*rho*sin((1/2)*x*pi)*sin((1/2)*y*pi)'
symbol_names = 'rho'
symbol_values = '${rho}'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm 100 lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = false
csv = true
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2u]
type = ElementL2FunctorError
approximate = superficial_vel_x
exact = exact_u
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2v]
type = ElementL2FunctorError
approximate = superficial_vel_y
exact = exact_v
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2p]
type = ElementL2FunctorError
approximate = pressure
exact = exact_p
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(test/tests/auxkernels/functor_elemental_gradient/functor_gradient.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmin = 0
xmax = 3.141
ymin = 0
ymax = 3.141
[]
[Variables]
[u]
[]
[v]
[]
[w]
type = MooseVariableFVReal
[]
[]
[ICs]
[u_ic]
type = FunctionIC
variable = 'u'
function = parsed_function
[]
[v_ic]
type = FunctionIC
variable = 'v'
function = 'x'
[]
[w_ic]
type = FunctionIC
variable = 'w'
function = 'x + y'
[]
[]
[Functions]
[parsed_function]
type = ParsedFunction
value = 'sin(x)-cos(y/2)'
[]
[parsed_grad_function]
type = ParsedVectorFunction
expression_x = 'cos(x)'
expression_y = 'sin(y/2)/2'
[]
[parsed_gradx_function]
type = ParsedFunction
value = 'cos(x)'
[]
[]
[AuxVariables]
[funcGrad_u]
order = CONSTANT
family = MONOMIAL_VEC
[]
[auxGrad_u]
order = CONSTANT
family = MONOMIAL_VEC
[]
[auxGrad_v]
order = CONSTANT
family = MONOMIAL_VEC
[]
[auxGrad_fv]
order = CONSTANT
family = MONOMIAL_VEC
[]
[auxGrad_function]
order = CONSTANT
family = MONOMIAL_VEC
[]
[funcGrad_u_x]
order = CONSTANT
family = MONOMIAL
[]
[auxGrad_u_x]
order = CONSTANT
family = MONOMIAL
[]
[auxGrad_v_x]
order = CONSTANT
family = MONOMIAL
[]
[auxGrad_fv_x]
order = CONSTANT
family = MONOMIAL
[]
[auxGrad_function_x]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
# Verification
[vec]
type = VectorFunctionAux
variable = funcGrad_u
function = parsed_grad_function
[]
# Finite element variables with and without scaling by material
[grad_u]
type = ADFunctorElementalGradientAux
variable = auxGrad_u
functor = u
[]
[grad_v]
type = ADFunctorElementalGradientAux
variable = auxGrad_v
functor = v
factor_matprop = 'trig_material'
[]
# Finite volume variable
[grad_w]
type = ADFunctorElementalGradientAux
variable = auxGrad_fv
functor = w
factor = w
[]
# Functions
[grad_function]
type = FunctorElementalGradientAux
variable = auxGrad_function
functor = parsed_gradx_function
[]
# Output a component, line sampler does not do vector variables
[funcGrad_u_x]
type = VectorVariableComponentAux
variable = funcGrad_u_x
vector_variable = funcGrad_u
component = 'x'
[]
[auxGrad_u_x]
type = VectorVariableComponentAux
variable = auxGrad_u_x
vector_variable = auxGrad_u
component = 'x'
[]
[auxGrad_v_x]
type = VectorVariableComponentAux
variable = auxGrad_v_x
vector_variable = auxGrad_v
component = 'x'
[]
[funcGrad_fv_x]
type = VectorVariableComponentAux
variable = auxGrad_fv_x
vector_variable = auxGrad_fv
component = 'x'
[]
[auxGrad_function_x]
type = VectorVariableComponentAux
variable = auxGrad_function_x
vector_variable = auxGrad_function
component = 'x'
[]
[]
[Materials]
[steel]
type = ADGenericFunctionMaterial
prop_names = 'trig_material'
prop_values = 'parsed_gradx_function'
[]
[]
[VectorPostprocessors]
[results]
type = LineValueSampler
start_point = '0 1 0'
end_point = '3.141 1 0'
variable = 'funcGrad_u_x auxGrad_u_x auxGrad_v_x auxGrad_fv_x auxGrad_function_x'
num_points = 20
sort_by = x
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(test/tests/fviks/diffusion/test.i)
L = 2
l = 1
q1 = 1
q2 = 2
uR = 1
D1 = 1
D2 = 2
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 10
xmax = ${L}
[]
[subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '${l} 0 0'
block_id = 1
top_right = '${L} 1.0 0'
[]
[interface_primary]
input = subdomain1
type = SideSetsBetweenSubdomainsGenerator
primary_block = '0'
paired_block = '1'
new_boundary = 'primary_interface'
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
block = 0
initial_condition = 0.5
[]
[v]
type = MooseVariableFVReal
block = 1
initial_condition = 0.5
[]
[]
[FVKernels]
[diff_left]
type = FVDiffusion
variable = u
coeff = 'left'
block = 0
coeff_interp_method = average
[]
[source_left]
type = FVBodyForce
variable = u
function = ${q1}
block = 0
[]
[diff_right]
type = FVDiffusion
variable = v
coeff = 'right'
block = 1
coeff_interp_method = average
[]
[source_right]
type = FVBodyForce
variable = v
function = ${q2}
block = 1
[]
[]
[FVInterfaceKernels]
[interface]
type = FVDiffusionInterface
variable1 = u
variable2 = v
boundary = 'primary_interface'
subdomain1 = '0'
subdomain2 = '1'
coeff1 = 'left'
coeff2 = 'right'
coeff_interp_method = average
[]
[]
[FVBCs]
[v_left]
type = FVDirichletBC
variable = v
boundary = 'right'
value = ${uR}
[]
[]
[Materials]
[block0]
type = ADGenericFunctorMaterial
block = '0'
prop_names = 'left'
prop_values = '${D1}'
[]
[block1]
type = ADGenericFunctorMaterial
block = '1'
prop_names = 'right'
prop_values = '${D2}'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/examples/solidification/galium_melting.i)
##########################################################
# Simulation of Galium Melting Experiment
# Ref: Gau, C., & Viskanta, R. (1986). Melting and solidification of a pure metal on a vertical wall.
# Key physics: melting/solidification, convective heat transfer, natural convection
##########################################################
mu = 1.81e-3
rho_solid = 6093
rho_liquid = 6093
k_solid = 32
k_liquid = 32
cp_solid = 381.5
cp_liquid = 381.5
L = 80160
alpha_b = 1.2e-4
T_solidus = 302.93
T_liquidus = '${fparse T_solidus + 0.1}'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
T_cold = 301.15
T_hot = 311.15
Nx = 100
Ny = 50
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 88.9e-3
ymin = 0
ymax = 63.5e-3
nx = ${Nx}
ny = ${Ny}
[]
[]
[AuxVariables]
[U]
type = MooseVariableFVReal
[]
[fl]
type = MooseVariableFVReal
initial_condition = 0.0
[]
[density]
type = MooseVariableFVReal
[]
[th_cond]
type = MooseVariableFVReal
[]
[cp_var]
type = MooseVariableFVReal
[]
[darcy_coef]
type = MooseVariableFVReal
[]
[fch_coef]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = vel_x
y = vel_y
[]
[compute_fl]
type = NSLiquidFractionAux
variable = fl
temperature = T
T_liquidus = '${T_liquidus}'
T_solidus = '${T_solidus}'
execute_on = 'TIMESTEP_END'
[]
[rho_out]
type = FunctorAux
functor = 'rho_mixture'
variable = 'density'
[]
[th_cond_out]
type = FunctorAux
functor = 'k_mixture'
variable = 'th_cond'
[]
[cp_out]
type = FunctorAux
functor = 'cp_mixture'
variable = 'cp_var'
[]
[darcy_out]
type = FunctorAux
functor = 'Darcy_coefficient'
variable = 'darcy_coef'
[]
[fch_out]
type = FunctorAux
functor = 'Forchheimer_coefficient'
variable = 'fch_coef'
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 0.0
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 0.0
[]
[pressure]
type = INSFVPressureVariable
[]
[lambda]
family = SCALAR
order = FIRST
[]
[T]
type = INSFVEnergyVariable
initial_condition = '${T_cold}'
scaling = 1.0
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = rho_mixture
[]
[mean_zero_pressure]
type = FVIntegralValueConstraint
variable = pressure
lambda = lambda
phi0 = 0.0
[]
[u_time]
type = INSFVMomentumTimeDerivative
variable = vel_x
rho = rho_mixture
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = rho_mixture
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_friction]
type = INSFVMomentumFriction
variable = vel_x
momentum_component = 'x'
linear_coef_name = 'Darcy_coefficient'
quadratic_coef_name = 'Forchheimer_coefficient'
[]
[u_buoyancy]
type = INSFVMomentumBoussinesq
variable = vel_x
T_fluid = T
gravity = '0 -9.81 0'
rho = '${rho_liquid}'
ref_temperature = ${T_cold}
momentum_component = 'x'
[]
[u_gravity]
type = INSFVMomentumGravity
variable = vel_x
gravity = '0 -9.81 0'
rho = '${rho_liquid}'
momentum_component = 'x'
[]
[v_time]
type = INSFVMomentumTimeDerivative
variable = vel_y
rho = rho_mixture
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = rho_mixture
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[v_friction]
type = INSFVMomentumFriction
variable = vel_y
momentum_component = 'y'
linear_coef_name = 'Darcy_coefficient'
quadratic_coef_name = 'Forchheimer_coefficient'
[]
[v_buoyancy]
type = INSFVMomentumBoussinesq
variable = vel_y
T_fluid = T
gravity = '0 -9.81 0'
rho = '${rho_liquid}'
ref_temperature = ${T_cold}
momentum_component = 'y'
[]
[v_gravity]
type = INSFVMomentumGravity
variable = vel_y
gravity = '0 -9.81 0'
rho = '${rho_liquid}'
momentum_component = 'y'
[]
[T_time]
type = INSFVEnergyTimeDerivative
variable = T
rho = rho_mixture
dh_dt = dh_dt
[]
[energy_advection]
type = INSFVEnergyAdvection
variable = T
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[energy_diffusion]
type = FVDiffusion
coeff = k_mixture
variable = T
[]
[energy_source]
type = NSFVPhaseChangeSource
variable = T
L = ${L}
liquid_fraction = fl
T_liquidus = ${T_liquidus}
T_solidus = ${T_solidus}
rho = 'rho_mixture'
[]
[]
[FVBCs]
[walls-u]
type = INSFVNoSlipWallBC
boundary = 'left right top bottom'
variable = vel_x
function = 0
[]
[walls-v]
type = INSFVNoSlipWallBC
boundary = 'left right top bottom'
variable = vel_y
function = 0
[]
[hot_wall]
type = FVDirichletBC
variable = T
value = '${T_hot}'
boundary = 'left'
[]
[cold_wall]
type = FVDirichletBC
variable = T
value = '${T_cold}'
boundary = 'right'
[]
[]
[Materials]
[ins_fv]
type = INSFVEnthalpyMaterial
rho = rho_mixture
cp = cp_mixture
temperature = 'T'
[]
[eff_cp]
type = NSFVMixtureMaterial
phase_2_names = '${cp_solid} ${k_solid} ${rho_solid}'
phase_1_names = '${cp_liquid} ${k_liquid} ${rho_liquid}'
prop_names = 'cp_mixture k_mixture rho_mixture'
phase_1_fraction = fl
[]
[mushy_zone_resistance]
type = INSFVMushyPorousFrictionMaterial
liquid_fraction = 'fl'
mu = '${mu}'
rho_l = '${rho_liquid}'
dendrite_spacing_scaling = 1e-1
[]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'alpha_b'
prop_values = '${alpha_b}'
[]
[]
[Executioner]
type = Transient
# Time-stepping parameters
start_time = 0.0
end_time = 200.0
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 10
dt = 0.1
[]
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-2
nl_abs_tol = 1e-4
nl_max_its = 30
[]
[Outputs]
exodus = true
csv = false
[]
(modules/navier_stokes/test/tests/finite_volume/pwcns/boundary_conditions/flux_bcs_mdot-action.i)
l = 10
inlet_area = 2
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = ${inlet_area}
nx = 10
ny = 5
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'weakly-compressible'
add_energy_equation = true
porous_medium_treatment = true
porosity = 'porosity'
density = 'rho'
dynamic_viscosity = 'mu'
thermal_conductivity = 'k'
specific_heat = 'cp'
initial_velocity = '${inlet_velocity} 1e-15 0'
initial_temperature = '${inlet_temp}'
initial_pressure = '${outlet_pressure}'
inlet_boundaries = 'left'
momentum_inlet_types = 'flux-mass'
flux_inlet_pps = 'inlet_mdot'
energy_inlet_types = 'flux-mass'
energy_inlet_function = 'inlet_T'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip noslip'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '0 0'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${outlet_pressure}'
external_heat_source = 'power_density'
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
energy_advection_interpolation = 'average'
[]
[]
[Postprocessors]
[inlet_mdot]
type = Receiver
default = ${fparse 1980 * inlet_velocity * inlet_area}
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k mu porosity'
prop_values = '${cp} ${k} ${mu} 0.5'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T_fluid
pressure = pressure
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-2
optimal_iterations = 6
[]
end_time = 1
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(test/tests/variables/caching_fv_variables/fv_caching.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '1.5 2.4 0.1'
dy = '1.3 0.9'
ix = '2 1 1'
iy = '2 3'
subdomain_id = '0 1 1 2 2 2'
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = u
coeff = 1
[]
[adv]
type = FVMatAdvection
variable = u
vel = v_mat
[]
[body_force]
type = FVBodyForce
variable = u
value = 10
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = u
boundary = 'left'
value = 1
[]
[right]
type = FVDirichletBC
variable = u
boundary = 'right'
value = 1
[]
[top]
type = FVNeumannBC
variable = u
value = 1
boundary = 'top'
[]
[]
[Materials]
[v_mat]
type = ADGenericVectorFunctorMaterial
prop_names = 'v_mat'
prop_values = '4 0 0'
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
exodus = true
[]
(modules/porous_flow/test/tests/heat_conduction/two_phase_fv.i)
# 2 phase heat conduction, with saturation fixed at 0.5
# Apply a boundary condition of T=300 to a bar that
# is initially at T=200, and observe the expected
# error-function response
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 10
xmin = 0
xmax = 100
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[phase0_porepressure]
type = MooseVariableFVReal
initial_condition = 0
[]
[phase1_saturation]
type = MooseVariableFVReal
initial_condition = 0.5
[]
[temp]
type = MooseVariableFVReal
initial_condition = 200
[]
[]
[FVKernels]
[dummy_p0]
type = FVTimeKernel
variable = phase0_porepressure
[]
[dummy_s1]
type = FVTimeKernel
variable = phase1_saturation
[]
[energy_dot]
type = FVPorousFlowEnergyTimeDerivative
variable = temp
[]
[heat_conduction]
type = FVPorousFlowHeatConduction
variable = temp
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'temp phase0_porepressure phase1_saturation'
number_fluid_phases = 2
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureConst
pc = 0
[]
[]
[FluidProperties]
[simple_fluid0]
type = SimpleFluidProperties
bulk_modulus = 1.5
density0 = 0.4
thermal_expansion = 0
cv = 1
[]
[simple_fluid1]
type = SimpleFluidProperties
bulk_modulus = 0.5
density0 = 0.3
thermal_expansion = 0
cv = 2
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
temperature = temp
[]
[thermal_conductivity]
type = ADPorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '0.3 0 0 0 0 0 0 0 0'
wet_thermal_conductivity = '1.7 0 0 0 0 0 0 0 0'
exponent = 1.0
aqueous_phase_number = 1
[]
[ppss]
type = ADPorousFlow2PhasePS
phase0_porepressure = phase0_porepressure
phase1_saturation = phase1_saturation
capillary_pressure = pc
[]
[porosity]
type = ADPorousFlowPorosityConst
porosity = 0.8
[]
[rock_heat]
type = ADPorousFlowMatrixInternalEnergy
specific_heat_capacity = 1.0
density = 0.25
[]
[simple_fluid0]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid0
phase = 0
[]
[simple_fluid1]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid1
phase = 1
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
boundary = left
value = 300
variable = temp
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 1E1
end_time = 1E2
[]
[Postprocessors]
[t005]
type = PointValue
variable = temp
point = '5 0 0'
execute_on = 'initial timestep_end'
[]
[t015]
type = PointValue
variable = temp
point = '15 0 0'
execute_on = 'initial timestep_end'
[]
[t025]
type = PointValue
variable = temp
point = '25 0 0'
execute_on = 'initial timestep_end'
[]
[t035]
type = PointValue
variable = temp
point = '35 0 0'
execute_on = 'initial timestep_end'
[]
[t045]
type = PointValue
variable = temp
point = '45 0 0'
execute_on = 'initial timestep_end'
[]
[t055]
type = PointValue
variable = temp
point = '55 0 0'
execute_on = 'initial timestep_end'
[]
[t065]
type = PointValue
variable = temp
point = '65 0 0'
execute_on = 'initial timestep_end'
[]
[t075]
type = PointValue
variable = temp
point = '75 0 0'
execute_on = 'initial timestep_end'
[]
[t085]
type = PointValue
variable = temp
point = '85 0 0'
execute_on = 'initial timestep_end'
[]
[t095]
type = PointValue
variable = temp
point = '95 0 0'
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
file_base = two_phase_fv
csv = true
[]
(test/tests/misc/rename-parameters/rename-functor.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 20
[]
[Variables]
[v]
type = MooseVariableFVReal
[]
[]
[FVKernels]
[diff]
type = RenamedCoeffFVDiffusion
variable = v
diffusion_coeff = diff
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = v
boundary = left
value = 7
[]
[right]
type = FVDirichletBC
variable = v
boundary = right
value = 42
[]
[]
[Materials]
[diff]
type = ADGenericFunctorMaterial
prop_names = 'diff'
prop_values = '1'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
csv = true
[]
[Postprocessors]
[avg]
type = ElementAverageValue
variable = v
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/boussinesq/wcnsfv.i)
mu = 1
rho = 'rho'
k = 1
cp = 1
alpha = 1
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# rayleigh=1e3
cold_temp=300
hot_temp=310
[GlobalParams]
two_term_boundary_expansion = true
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = 0
ymax = 10
nx = 64
ny = 64
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = 1e5
[]
[T]
type = INSFVEnergyVariable
scaling = 1e-4
initial_condition = ${cold_temp}
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[vel_x]
order = FIRST
family = MONOMIAL
[]
[vel_y]
order = FIRST
family = MONOMIAL
[]
[viz_T]
order = FIRST
family = MONOMIAL
[]
[rho_out]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = u
y = v
execute_on = 'initial timestep_end'
[]
[vel_x]
type = ParsedAux
variable = vel_x
expression = 'u'
execute_on = 'initial timestep_end'
coupled_variables = 'u'
[]
[vel_y]
type = ParsedAux
variable = vel_y
expression = 'v'
execute_on = 'initial timestep_end'
coupled_variables = 'v'
[]
[viz_T]
type = ParsedAux
variable = viz_T
expression = 'T'
execute_on = 'initial timestep_end'
coupled_variables = 'T'
[]
[rho_out]
type = FunctorAux
functor = 'rho'
variable = 'rho_out'
execute_on = 'initial timestep_end'
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[mean_zero_pressure]
type = FVIntegralValueConstraint
variable = pressure
lambda = lambda
phi0 = 1e5
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[u_gravity]
type = INSFVMomentumGravity
variable = u
gravity = '0 -1 0'
rho = ${rho}
momentum_component = 'x'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[v_gravity]
type = INSFVMomentumGravity
variable = v
gravity = '0 -1 0'
rho = ${rho}
momentum_component = 'y'
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[]
[FVBCs]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'left right top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = v
boundary = 'left right top bottom'
function = 0
[]
[T_hot]
type = FVDirichletBC
variable = T
boundary = left
value = ${hot_temp}
[]
[T_cold]
type = FVDirichletBC
variable = T
boundary = right
value = ${cold_temp}
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Materials]
[const]
type = ADGenericConstantMaterial
prop_names = 'alpha'
prop_values = '${alpha}'
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = ${rho}
[]
[]
[Functions]
[lid_function]
type = ParsedFunction
expression = '4*x*(1-x)'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[]
[Outputs]
exodus = true
[]
(test/tests/fvkernels/constraints/bounded_value.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 20
[]
[Variables]
[v]
type = MooseVariableFVReal
# breaks the constraint
initial_condition = -1
[]
[lambda]
type = MooseVariableScalar
[]
[]
[FVKernels]
[time]
type = FVTimeKernel
variable = v
[]
[diff]
type = FVDiffusion
variable = v
coeff = coeff
[]
[average]
type = FVBoundedValueConstraint
variable = v
phi0 = 0
lambda = lambda
bound_type = 'HIGHER_THAN'
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = v
boundary = left
value = 7
[]
[right]
type = FVDirichletBC
variable = v
boundary = right
value = 0
[]
[]
[Materials]
[diff]
type = ADGenericFunctorMaterial
prop_names = 'coeff'
prop_values = '1'
[]
[]
[Executioner]
type = Transient
solve_type = 'Newton'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
num_steps = 2
dt = 0.001
nl_abs_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(test/tests/auxkernels/divergence_aux/test_fv.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '1.5 1 0.1'
dy = '1.3 1 0.9'
ix = '2 4 1'
iy = '2 3 3'
subdomain_id = '1 1 1
1 2 1
1 1 1'
[]
[add_inner_boundaries_top]
type = SideSetsAroundSubdomainGenerator
input = cmg
new_boundary = 'block_2_top'
block = 2
normal = '0 1 0'
[]
[add_inner_boundaries_bot]
type = SideSetsAroundSubdomainGenerator
input = add_inner_boundaries_top
new_boundary = 'block_2_bot'
block = 2
normal = '0 -1 0'
[]
[add_inner_boundaries_right]
type = SideSetsAroundSubdomainGenerator
input = add_inner_boundaries_bot
new_boundary = 'block_2_right'
block = 2
normal = '1 0 0'
[]
[add_inner_boundaries_left]
type = SideSetsAroundSubdomainGenerator
input = add_inner_boundaries_right
new_boundary = 'block_2_left'
block = 2
normal = '-1 0 0'
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
[]
[v]
type = MooseVariableFVReal
[]
[]
[FVKernels]
[diff_u]
type = FVDiffusion
variable = u
coeff = 1
[]
[reaction_u]
type = FVReaction
variable = u
[]
[diff_v]
type = FVDiffusion
variable = v
coeff = 2
[]
[reaction_v]
type = FVReaction
variable = v
[]
[]
[AuxVariables]
[div]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[divergence]
type = ADDivergenceAux
variable = div
u = 'u'
v = 'v'
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = u
boundary = left
value = 2
[]
[right]
type = FVDirichletBC
variable = u
boundary = right
value = 1
[]
[top]
type = FVDirichletBC
variable = v
boundary = top
value = 2
[]
[bottom]
type = FVDirichletBC
variable = v
boundary = bottom
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Postprocessors]
[int_divergence]
type = ElementL1Error
block = 2
variable = div
function = 0
[]
[sum_surface_current]
type = ParsedPostprocessor
expression = 's1 - s2 + s3 - s4'
pp_names = 's1 s2 s3 s4'
[]
[s1]
type = ADSideIntegralFunctorPostprocessor
boundary = 'block_2_right'
functor = 'u'
[]
[s2]
type = ADSideIntegralFunctorPostprocessor
boundary = 'block_2_left'
functor = 'u'
[]
[s3]
type = ADSideIntegralFunctorPostprocessor
boundary = 'block_2_top'
functor = 'v'
[]
[s4]
type = ADSideIntegralFunctorPostprocessor
boundary = 'block_2_bot'
functor = 'v'
[]
[]
[Outputs]
csv = true
hide = 's1 s2 s3 s4'
[]
(test/tests/fvkernels/constraints/point_value.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 4
[]
[Variables]
[v]
type = MooseVariableFVReal
[]
[lambda]
type = MooseVariableScalar
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = v
coeff = coeff
[]
[average]
type = FVPointValueConstraint
variable = v
phi0 = 13
lambda = lambda
point = '0.3 0 0'
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = v
boundary = left
value = 7
[]
[]
[Materials]
[diff]
type = ADGenericFunctorMaterial
prop_names = 'coeff'
prop_values = '1'
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[]
[Outputs]
exodus = true
[]
(test/tests/fvkernels/fv_constant_scalar_advection/2D_constant_scalar_advection.i)
[Mesh]
[gen_mesh]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 2
ymin = 0
ymax = 4
nx = 10
ny = 20
[]
[]
[Variables]
[v]
type = MooseVariableFVReal
two_term_boundary_expansion = false
[]
[]
[ICs]
[v_ic]
type = FunctionIC
variable = v
function = 'r2 := (x - 0.5)*(x - 0.5) + (y - 0.3)*(y - 0.3); exp(-r2 * 20)'
[]
[]
[FVKernels]
[advection]
type = FVAdvection
variable = v
velocity = '1 0.5 0'
[]
[time]
type = FVTimeKernel
variable = v
[]
[]
[FVBCs]
[fv_outflow]
type = FVConstantScalarOutflowBC
velocity = '1 0.5 0'
variable = v
boundary = 'right top'
[]
[]
[Executioner]
type = Transient
petsc_options = '-snes_converged_reason'
num_steps = 10
dt = 0.25
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/bernoulli-1d-parsed-function.i)
rho = 1.1
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 1
dx = '1 1'
ix = '3 3'
subdomain_id = '1 2'
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = PINSFVRhieChowInterpolator
u = u
pressure = pressure
porosity = porosity
[]
[]
[Variables]
[u]
type = PINSFVSuperficialVelocityVariable
initial_condition = 1
[]
[pressure]
type = BernoulliPressureVariable
u = u
porosity = porosity
rho = ${rho}
[]
[]
[Functions]
[porosity]
type = ParsedFunction
expression = 'if(x > 1, 0.5, 1)'
[]
[]
[AuxVariables]
[has_porosity_jump_face]
type = MooseVariableFVReal
[]
[porosity_out]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[has_porosity_jump_face]
type = HasPorosityJumpFace
porosity = porosity
execute_on = 'initial timestep_end'
variable = has_porosity_jump_face
[]
[porosity_out]
type = FunctorAux
variable = porosity_out
functor = porosity
execute_on = 'initial timestep_end'
[]
[]
[FVKernels]
[mass]
type = PINSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_advection]
type = PINSFVMomentumAdvection
variable = u
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
porosity = porosity
momentum_component = 'x'
[]
[u_pressure]
type = PINSFVMomentumPressure
variable = u
pressure = pressure
porosity = porosity
momentum_component = 'x'
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = u
function = '1'
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = 'none'
[]
[Postprocessors]
[inlet_p]
type = SideAverageValue
variable = 'pressure'
boundary = 'left'
[]
[outlet-u]
type = SideIntegralVariablePostprocessor
variable = u
boundary = 'right'
[]
[]
[Outputs]
exodus = true
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/multiapp-scalar-transport/scalar-transport_action.i)
diff=1e-3
[Modules]
[NavierStokesFV]
# General parameters
compressibility = 'incompressible'
add_flow_equations = false
add_scalar_equation = true
# Variables, defined below
velocity_variable = 'u v'
pressure_variable = 'pressure'
# Numerical scheme
passive_scalar_advection_interpolation = 'average'
# Precursor equations
passive_scalar_names = 'scalar'
passive_scalar_diffusivity = '${diff}'
passive_scalar_source = '0.1'
# Inlet boundary conditions
inlet_boundaries = 'left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_function = '1 0'
passive_scalar_inlet_types = 'fixed-value'
passive_scalar_inlet_function = '1'
# Outlet boundary conditions
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = 0
[]
[]
[GlobalParams]
block = 0
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = -1
ymax = 1
nx = 100
ny = 20
[]
[]
[Variables]
[scalar]
type = INSFVScalarFieldVariable
[]
[]
[AuxVariables]
[ax]
type = MooseVariableFVReal
[]
[ay]
type = MooseVariableFVReal
[]
[u]
type = INSFVVelocityVariable
[]
[v]
type = INSFVVelocityVariable
[]
[pressure]
type = INSFVPressureVariable
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/heated/2d-transient.i)
# Fluid properties
mu = 1
rho = 1
cp = 1
k = 1e-3
# Solid properties
cp_s = 2
rho_s = 4
k_s = 1e-2
h_fs = 10
# Operating conditions
u_inlet = 1
T_inlet = 200
p_outlet = 10
top_side_temperature = 150
# Numerical scheme
advected_interp_method = 'average'
velocity_interp_method = 'rc'
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = 0
ymax = 1
nx = 100
ny = 20
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = PINSFVRhieChowInterpolator
u = superficial_vel_x
v = superficial_vel_y
pressure = pressure
porosity = porosity
[]
[]
[Variables]
[superficial_vel_x]
type = PINSFVSuperficialVelocityVariable
initial_condition = ${u_inlet}
[]
[superficial_vel_y]
type = PINSFVSuperficialVelocityVariable
initial_condition = 1e-6
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${p_outlet}
[]
[T_fluid]
type = INSFVEnergyVariable
[]
[T_solid]
type = MooseVariableFVReal
initial_condition = 100
[]
[]
[AuxVariables]
[porosity]
type = MooseVariableFVReal
initial_condition = 0.5
[]
[]
[FVKernels]
[mass]
type = PINSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = INSFVMomentumTimeDerivative
variable = superficial_vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_advection]
type = PINSFVMomentumAdvection
variable = superficial_vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
porosity = porosity
momentum_component = 'x'
[]
[u_viscosity]
type = PINSFVMomentumDiffusion
variable = superficial_vel_x
mu = ${mu}
porosity = porosity
momentum_component = 'x'
[]
[u_pressure]
type = PINSFVMomentumPressure
variable = superficial_vel_x
momentum_component = 'x'
pressure = pressure
porosity = porosity
[]
[v_time]
type = INSFVMomentumTimeDerivative
variable = superficial_vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_advection]
type = PINSFVMomentumAdvection
variable = superficial_vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
porosity = porosity
momentum_component = 'y'
[]
[v_viscosity]
type = PINSFVMomentumDiffusion
variable = superficial_vel_y
mu = ${mu}
porosity = porosity
momentum_component = 'y'
[]
[v_pressure]
type = PINSFVMomentumPressure
variable = superficial_vel_y
momentum_component = 'y'
pressure = pressure
porosity = porosity
[]
[energy_time]
type = PINSFVEnergyTimeDerivative
variable = T_fluid
cp = ${cp}
rho = ${rho}
is_solid = false
porosity = porosity
[]
[energy_advection]
type = PINSFVEnergyAdvection
variable = T_fluid
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[energy_diffusion]
type = PINSFVEnergyDiffusion
variable = T_fluid
k = ${k}
porosity = porosity
[]
[energy_convection]
type = PINSFVEnergyAmbientConvection
variable = T_fluid
is_solid = false
T_fluid = 'T_fluid'
T_solid = 'T_solid'
h_solid_fluid = 'h_cv'
[]
[solid_energy_time]
type = PINSFVEnergyTimeDerivative
variable = T_solid
cp = ${cp_s}
rho = ${rho_s}
is_solid = true
porosity = porosity
[]
[solid_energy_diffusion]
type = FVDiffusion
variable = T_solid
coeff = ${k_s}
[]
[solid_energy_convection]
type = PINSFVEnergyAmbientConvection
variable = T_solid
is_solid = true
T_fluid = 'T_fluid'
T_solid = 'T_solid'
h_solid_fluid = 'h_cv'
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = superficial_vel_x
function = ${u_inlet}
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = superficial_vel_y
function = 0
[]
[inlet-T]
type = FVNeumannBC
variable = T_fluid
value = '${fparse u_inlet * rho * cp * T_inlet}'
boundary = 'left'
[]
[no-slip-u]
type = INSFVNoSlipWallBC
boundary = 'top'
variable = superficial_vel_x
function = 0
[]
[no-slip-v]
type = INSFVNoSlipWallBC
boundary = 'top'
variable = superficial_vel_y
function = 0
[]
[heated-side]
type = FVDirichletBC
boundary = 'top'
variable = 'T_solid'
value = ${top_side_temperature}
[]
[symmetry-u]
type = PINSFVSymmetryVelocityBC
boundary = 'bottom'
variable = superficial_vel_x
u = superficial_vel_x
v = superficial_vel_y
mu = ${mu}
momentum_component = 'x'
[]
[symmetry-v]
type = PINSFVSymmetryVelocityBC
boundary = 'bottom'
variable = superficial_vel_y
u = superficial_vel_x
v = superficial_vel_y
mu = ${mu}
momentum_component = 'y'
[]
[symmetry-p]
type = INSFVSymmetryPressureBC
boundary = 'bottom'
variable = pressure
[]
[outlet-p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = ${p_outlet}
[]
[]
[FunctorMaterials]
[constants]
type = ADGenericFunctorMaterial
prop_names = 'h_cv'
prop_values = '${h_fs}'
[]
[functor_constants]
type = ADGenericFunctorMaterial
prop_names = 'cp'
prop_values = '${cp}'
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
rho = ${rho}
temperature = 'T_fluid'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
end_time = 1.5
[]
# Some basic Postprocessors to examine the solution
[Postprocessors]
[inlet-p]
type = SideAverageValue
variable = pressure
boundary = 'left'
[]
[outlet-u]
type = SideAverageValue
variable = superficial_vel_x
boundary = 'right'
[]
[outlet-temp]
type = SideAverageValue
variable = T_fluid
boundary = 'right'
[]
[solid-temp]
type = ElementAverageValue
variable = T_solid
[]
[]
[Outputs]
exodus = true
csv = false
[]
(modules/navier_stokes/test/tests/finite_volume/cell_value_reconst/velocity_reconst.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = '${fparse 2*pi}'
ymin = 0
ymax = '${fparse 2*pi}'
nx = 4
ny = 4
[]
[]
[Problem]
kernel_coverage_check = false
[]
[Variables]
[dummy]
type = MooseVariableFVReal
initial_condition = 1
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
[]
[L2u]
type = TestFaceToCellReconstruction
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/basic-conserved-pcnsfv-kt.i)
[GlobalParams]
fp = fp
limiter = 'central_difference'
two_term_boundary_expansion = true
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = .1
xmax = .6
nx = 2
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[rho]
type = MooseVariableFVReal
[]
[rho_ud]
type = MooseVariableFVReal
[]
[rho_et]
type = MooseVariableFVReal
[]
[]
[ICs]
[pressure]
type = FunctionIC
variable = rho
function = 'exact_rho'
[]
[sup_vel_x]
type = FunctionIC
variable = rho_ud
function = 'exact_rho_ud'
[]
[T_fluid]
type = FunctionIC
variable = rho_et
function = 'exact_rho_et'
[]
[]
[FVKernels]
[mass_advection]
type = PCNSFVKT
variable = rho
eqn = "mass"
[]
[mass_fn]
type = FVBodyForce
variable = rho
function = 'forcing_rho'
[]
[momentum_x_advection]
type = PCNSFVKT
variable = rho_ud
momentum_component = x
eqn = "momentum"
[]
[momentum_fn]
type = FVBodyForce
variable = rho_ud
function = 'forcing_rho_ud'
[]
[fluid_energy_advection]
type = PCNSFVKT
variable = rho_et
eqn = "energy"
[]
[energy_fn]
type = FVBodyForce
variable = rho_et
function = 'forcing_rho_et'
[]
[]
[FVBCs]
[mass_left]
variable = rho
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'mass'
[]
[momentum_left]
variable = rho_ud
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'momentum'
momentum_component = 'x'
[]
[energy_left]
variable = rho_et
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'energy'
[]
[mass_right]
variable = rho
type = PCNSFVStrongBC
boundary = right
eqn = 'mass'
pressure = 'exact_p'
[]
[momentum_right]
variable = rho_ud
type = PCNSFVStrongBC
boundary = right
eqn = 'momentum'
momentum_component = 'x'
pressure = 'exact_p'
[]
[energy_right]
variable = rho_et
type = PCNSFVStrongBC
boundary = right
eqn = 'energy'
pressure = 'exact_p'
[]
# help gradient reconstruction
[rho_right]
type = FVFunctionDirichletBC
variable = rho
function = exact_rho
boundary = 'right'
[]
[rho_ud_left]
type = FVFunctionDirichletBC
variable = rho_ud
function = exact_rho_ud
boundary = 'left'
[]
[rho_et_left]
type = FVFunctionDirichletBC
variable = rho_et
function = exact_rho_et
boundary = 'left'
[]
[]
[Materials]
[var_mat]
type = PorousConservedVarMaterial
rho = rho
superficial_rhou = rho_ud
rho_et = rho_et
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[]
[Functions]
[exact_rho]
type = ParsedFunction
expression = '3.48788261470924*cos(x)'
[]
[forcing_rho]
type = ParsedFunction
expression = '-3.45300378856215*sin(1.1*x)'
[]
[exact_rho_ud]
type = ParsedFunction
expression = '3.13909435323832*cos(1.1*x)'
[]
[forcing_rho_ud]
type = ParsedFunction
expression = '-0.9*(10.6975765229419*cos(1.2*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + 0.9*(10.6975765229419*sin(x)*cos(1.2*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 12.8370918275302*sin(1.2*x)/cos(x))*cos(x) + 3.13909435323832*sin(x)*cos(1.1*x)^2/cos(x)^2 - 6.9060075771243*sin(1.1*x)*cos(1.1*x)/cos(x)'
[]
[exact_rho_et]
type = ParsedFunction
expression = '26.7439413073546*cos(1.2*x)'
[]
[forcing_rho_et]
type = ParsedFunction
expression = '0.9*(3.48788261470924*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.2*x))*sin(x)*cos(1.1*x)/cos(x)^2 - 0.99*(3.48788261470924*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.2*x))*sin(1.1*x)/cos(x) + 0.9*(-(10.6975765229419*cos(1.2*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + (10.6975765229419*sin(x)*cos(1.2*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 12.8370918275302*sin(1.2*x)/cos(x))*cos(x) - 32.0927295688256*sin(1.2*x))*cos(1.1*x)/cos(x)'
[]
[exact_T]
type = ParsedFunction
expression = '0.0106975765229418*cos(1.2*x)/cos(x) - 0.000697576522941848*cos(1.1*x)^2/cos(x)^2'
[]
[exact_eps_p]
type = ParsedFunction
expression = '3.13909435323832*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)'
[]
[exact_p]
type = ParsedFunction
expression = '3.48788261470924*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)'
[]
[exact_sup_vel_x]
type = ParsedFunction
expression = '0.9*cos(1.1*x)/cos(x)'
[]
[exact_superficial_velocity]
type = ParsedVectorFunction
expression_x = '0.9*cos(1.1*x)/cos(x)'
[]
[eps]
type = ParsedFunction
expression = '0.9'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = NEWTON
type = Transient
num_steps = 1
dtmin = 1
petsc_options = '-snes_linesearch_monitor'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_max_its = 50
line_search = bt
[]
[Outputs]
exodus = true
csv = true
[]
[Debug]
show_var_residual_norms = true
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2rho]
type = ElementL2Error
variable = rho
function = exact_rho
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2rho_ud]
variable = rho_ud
function = exact_rho_ud
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2rho_et]
variable = rho_et
function = exact_rho_et
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(test/tests/fviks/continuity/test.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 20
xmax = 2
[]
[subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '1.0 0 0'
block_id = 1
top_right = '2.0 1.0 0'
[]
[interface_primary_side]
input = subdomain1
type = SideSetsBetweenSubdomainsGenerator
primary_block = '0'
paired_block = '1'
new_boundary = 'primary_interface'
[]
[]
[GlobalParams]
# retain behavior at time of test creation
two_term_boundary_expansion = false
[]
[Variables]
[u]
type = MooseVariableFVReal
block = 0
initial_condition = 0.5
[]
[v]
type = MooseVariableFVReal
block = 1
initial_condition = 0.5
[]
[lambda]
type = MooseVariableScalar
[]
[]
[Problem]
kernel_coverage_check = false
[]
[FVKernels]
[diff_left]
type = FVDiffusion
variable = u
coeff = 'left'
block = 0
[]
[diff_right]
type = FVDiffusion
variable = v
coeff = 'right'
block = 1
[]
[]
[FVInterfaceKernels]
[interface]
type = FVTwoVarContinuityConstraint
variable1 = u
variable2 = v
boundary = 'primary_interface'
subdomain1 = '0'
subdomain2 = '1'
lambda = 'lambda'
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = u
boundary = 'left'
value = 1
[]
[v_left]
type = FVDirichletBC
variable = v
boundary = 'right'
value = 0
[]
[]
[Materials]
[block0]
type = ADGenericFunctorMaterial
block = '0'
prop_names = 'left'
prop_values = '1'
[]
[block1]
type = ADGenericFunctorMaterial
block = '1'
prop_names = 'right'
prop_values = '1'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm lu NONZERO'
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/rotated-2d-bkt-function-porosity.i)
p_initial=1.01e5
T=273.15
# u refers to the superficial velocity
u_in=1
user_limiter='upwind'
friction_coeff=10
[GlobalParams]
fp = fp
two_term_boundary_expansion = true
limiter = ${user_limiter}
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
nx = 3
ymin = 0
ymax = 18
ny = 90
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
initial_condition = ${p_initial}
[]
[sup_vel_x]
type = MooseVariableFVReal
initial_condition = 1e-15
scaling = 1e-2
[]
[sup_vel_y]
type = MooseVariableFVReal
initial_condition = 1e-15
scaling = 1e-2
[]
[T_fluid]
type = MooseVariableFVReal
initial_condition = ${T}
scaling = 1e-5
[]
[]
[AuxVariables]
[vel_y]
type = MooseVariableFVReal
[]
[sup_mom_y]
type = MooseVariableFVReal
[]
[rho]
type = MooseVariableFVReal
[]
[eps]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[vel_y]
type = ADMaterialRealAux
variable = vel_y
property = vel_y
execute_on = 'timestep_end'
[]
[sup_mom_y]
type = ADMaterialRealAux
variable = sup_mom_y
property = superficial_rhov
execute_on = 'timestep_end'
[]
[rho]
type = ADMaterialRealAux
variable = rho
property = rho
execute_on = 'timestep_end'
[]
[eps]
type = MaterialRealAux
variable = eps
property = porosity
execute_on = 'timestep_end'
[]
[]
[FVKernels]
[mass_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_dt'
variable = pressure
[]
[mass_advection]
type = PCNSFVKT
variable = pressure
eqn = "mass"
[]
[momentum_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhou_dt'
variable = sup_vel_x
[]
[momentum_advection]
type = PCNSFVKT
variable = sup_vel_x
eqn = "momentum"
momentum_component = 'x'
[]
[eps_grad]
type = PNSFVPGradEpsilon
variable = sup_vel_x
momentum_component = 'x'
epsilon_function = 'eps'
[]
[drag]
type = PCNSFVMomentumFriction
variable = sup_vel_x
momentum_component = 'x'
Darcy_name = 'cl'
momentum_name = superficial_rhou
[]
[momentum_time_y]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhov_dt'
variable = sup_vel_y
[]
[momentum_advection_y]
type = PCNSFVKT
variable = sup_vel_y
eqn = "momentum"
momentum_component = 'y'
[]
[eps_grad_y]
type = PNSFVPGradEpsilon
variable = sup_vel_y
momentum_component = 'y'
epsilon_function = 'eps'
[]
[drag_y]
type = PCNSFVMomentumFriction
variable = sup_vel_y
momentum_component = 'y'
Darcy_name = 'cl'
momentum_name = superficial_rhov
[]
[energy_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_et_dt'
variable = T_fluid
[]
[energy_advection]
type = PCNSFVKT
variable = T_fluid
eqn = "energy"
[]
[]
[FVBCs]
[rho_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = pressure
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'mass'
[]
[rhou_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = sup_vel_x
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'x'
[]
[rhov_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = sup_vel_y
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'y'
[]
[rho_et_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = T_fluid
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'energy'
[]
[rho_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = pressure
pressure = ${p_initial}
eqn = 'mass'
[]
[rhou_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = sup_vel_x
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'x'
[]
[rhov_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = sup_vel_y
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'y'
[]
[rho_et_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = T_fluid
pressure = ${p_initial}
eqn = 'energy'
[]
[wall_pressure_x]
type = PCNSFVImplicitMomentumPressureBC
momentum_component = 'x'
boundary = 'left right'
variable = sup_vel_x
[]
[wall_pressure_y]
type = PCNSFVImplicitMomentumPressureBC
momentum_component = 'y'
boundary = 'left right'
variable = sup_vel_y
[]
# Use these to help create more accurate cell centered gradients for cells adjacent to boundaries
[T_bottom]
type = FVDirichletBC
variable = T_fluid
value = ${T}
boundary = 'bottom'
[]
[sup_vel_x_bottom_and_walls]
type = FVDirichletBC
variable = sup_vel_x
value = 0
boundary = 'bottom left right'
[]
[sup_vel_y_walls]
type = FVDirichletBC
variable = sup_vel_y
value = 0
boundary = 'left right'
[]
[sup_vel_y_bottom]
type = FVDirichletBC
variable = sup_vel_y
value = ${u_in}
boundary = 'bottom'
[]
[p_top]
type = FVDirichletBC
variable = pressure
value = ${p_initial}
boundary = 'top'
[]
[]
[Functions]
[ud_in]
type = ParsedVectorFunction
expression_x = '0'
expression_y = '${u_in}'
[]
[eps]
type = ParsedFunction
expression = 'if(y < 2.8, 1,
if(y < 3.2, 1 - .5 / .4 * (y - 2.8),
if(y < 6.8, .5,
if(y < 7.2, .5 - .25 / .4 * (y - 6.8),
if(y < 10.8, .25,
if(y < 11.2, .25 + .25 / .4 * (y - 10.8),
if(y < 14.8, .5,
if(y < 15.2, .5 + .5 / .4 * (y - 14.8),
1))))))))'
[]
[]
[Materials]
[var_mat]
type = PorousPrimitiveVarMaterial
pressure = pressure
T_fluid = T_fluid
superficial_vel_x = sup_vel_x
superficial_vel_y = sup_vel_y
fp = fp
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[ad_generic]
type = ADGenericConstantVectorMaterial
prop_names = 'cl'
prop_values = '${friction_coeff} ${friction_coeff} ${friction_coeff}'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = NEWTON
line_search = 'bt'
type = Transient
nl_max_its = 20
[TimeStepper]
type = IterationAdaptiveDT
dt = 5e-5
optimal_iterations = 6
growth_factor = 1.2
[]
num_steps = 10000
end_time = 500
nl_abs_tol = 1e-7
petsc_options_iname = '-pc_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu mumps'
[]
[Outputs]
[out]
type = Exodus
execute_on = 'final'
[]
checkpoint = true
[]
[Debug]
show_var_residual_norms = true
[]
(test/tests/vectorpostprocessors/positions_functor_value_sampler/positions_functor_sampler.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Problem]
solve = false
[]
[AuxVariables]
[fv]
type = MooseVariableFVReal
initial_condition = 3
[]
[]
[Functions]
[fx]
type = ParsedFunction
expression = 'x'
[]
[fy]
type = ParsedFunction
expression = 'y'
[]
[]
[Positions]
[pos]
type = InputPositions
positions = '0.11 0.11 0
0.21 0.15 0
0.11 0.21 0'
[]
[]
[VectorPostprocessors]
[point_sample]
type = PositionsFunctorValueSampler
functors = 'fv 2 fx fy'
positions = 'pos'
sort_by = id
execute_on = TIMESTEP_END
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
execute_on = 'timestep_end'
csv = true
[]
(test/tests/fvkernels/mms/advective-outflow/kt-limited-advection.i)
a=1.1
c=343
max_abs_eig=${fparse c + a}
[Mesh]
[./gen_mesh]
type = GeneratedMeshGenerator
dim = 1
xmin = 0.1
xmax = 1.1
nx = 2
[../]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[ICs]
[u]
type = FunctionIC
variable = u
function = exact
[]
[]
[Variables]
[./u]
two_term_boundary_expansion = true
type = MooseVariableFVReal
[../]
[]
[FVKernels]
[./advection_u]
type = FVKTLimitedAdvection
variable = u
velocity = '${a} 0 0'
limiter = 'vanLeer'
max_abs_eig = ${max_abs_eig}
add_artificial_diff = true
[../]
[body_u]
type = FVBodyForce
variable = u
function = 'forcing'
[]
[]
[FVBCs]
[left_u]
type = FVFunctionNeumannBC
boundary = 'left'
function = 'advection'
variable = u
[]
[diri_left]
type = FVFunctionDirichletBC
boundary = 'left'
function = 'exact'
variable = u
[]
[right]
type = FVConstantScalarOutflowBC
variable = u
velocity = '${a} 0 0'
boundary = 'right'
[]
[]
[Functions]
[exact]
type = ParsedFunction
expression = 'cos(x)'
[]
[advection]
type = ParsedFunction
expression = '${a} * cos(x)'
[]
[forcing]
type = ParsedFunction
expression = '-${a} * sin(x)'
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-snes_linesearch_minlambda'
petsc_options_value = '1e-3'
nl_abs_tol = 1e-9
[]
[Outputs]
file_base = 'kt-limited-advection_out'
[csv]
type = CSV
execute_on = 'final'
[]
[exo]
type = Exodus
execute_on = 'final'
[]
[]
[Postprocessors]
[./L2u]
type = ElementL2Error
variable = u
function = exact
outputs = 'console csv'
execute_on = 'timestep_end'
[../]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_velocity-action.i)
l = 10
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 10
ny = 5
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'weakly-compressible'
add_energy_equation = true
add_scalar_equation = true
passive_scalar_names = 'scalar'
density = 'rho'
dynamic_viscosity = 'mu'
thermal_conductivity = 'k'
specific_heat = 'cp'
passive_scalar_diffusivity = 1.1
initial_velocity = '${inlet_velocity} 1e-15 0'
initial_temperature = '${inlet_temp}'
initial_pressure = '${outlet_pressure}'
initial_scalar_variables = 0.1
inlet_boundaries = 'left'
momentum_inlet_types = 'flux-velocity'
flux_inlet_pps = 'inlet_u'
energy_inlet_types = 'flux-velocity'
energy_inlet_function = 'inlet_T'
passive_scalar_inlet_types = 'flux-velocity'
passive_scalar_inlet_function = 'inlet_scalar_value'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip noslip'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '0 0'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${outlet_pressure}'
external_heat_source = 'power_density'
passive_scalar_source = 2.1
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
energy_advection_interpolation = 'average'
[]
[]
[Postprocessors]
[inlet_u]
type = Receiver
default = ${inlet_velocity}
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[inlet_scalar_value]
type = Receiver
default = 0.2
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k mu'
prop_values = '${cp} ${k} ${mu}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T_fluid
pressure = pressure
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-2
optimal_iterations = 6
[]
end_time = 1
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/pwcns/channel-flow/2d-transient-gas.i)
# Fluid properties
mu = 'mu'
rho = 'rho'
k = 'k'
# Solid properties
cp_s = 2
rho_s = 4
k_s = 1e-2
h_fs = 10
# Operating conditions
u_inlet = 1
T_inlet = 200
p_outlet = 10
top_side_temperature = 150
# Numerical scheme
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = 0
ymax = 1
nx = 20
ny = 5
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = PINSFVRhieChowInterpolator
u = superficial_vel_x
v = superficial_vel_y
pressure = pressure
porosity = porosity
[]
[]
[Variables]
[superficial_vel_x]
type = PINSFVSuperficialVelocityVariable
initial_condition = ${u_inlet}
[]
[superficial_vel_y]
type = PINSFVSuperficialVelocityVariable
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${p_outlet}
[]
[T_fluid]
type = INSFVEnergyVariable
initial_condition = ${T_inlet}
[]
[T_solid]
type = MooseVariableFVReal
initial_condition = 100
[]
[]
[AuxVariables]
[porosity]
type = MooseVariableFVReal
initial_condition = 0.5
[]
[]
[FVKernels]
[mass_time]
type = PWCNSFVMassTimeDerivative
variable = pressure
porosity = 'porosity'
drho_dt = 'drho_dt'
[]
[mass]
type = PWCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = superficial_vel_x
rho = ${rho}
drho_dt = 'drho_dt'
momentum_component = 'x'
[]
[u_advection]
type = PINSFVMomentumAdvection
variable = superficial_vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
porosity = porosity
momentum_component = 'x'
[]
[u_viscosity]
type = PINSFVMomentumDiffusion
variable = superficial_vel_x
mu = ${mu}
porosity = porosity
momentum_component = 'x'
[]
[u_pressure]
type = PINSFVMomentumPressure
variable = superficial_vel_x
momentum_component = 'x'
pressure = pressure
porosity = porosity
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = superficial_vel_y
rho = ${rho}
drho_dt = 'drho_dt'
momentum_component = 'y'
[]
[v_advection]
type = PINSFVMomentumAdvection
variable = superficial_vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
porosity = porosity
momentum_component = 'y'
[]
[v_viscosity]
type = PINSFVMomentumDiffusion
variable = superficial_vel_y
mu = ${mu}
porosity = porosity
momentum_component = 'y'
[]
[v_pressure]
type = PINSFVMomentumPressure
variable = superficial_vel_y
momentum_component = 'y'
pressure = pressure
porosity = porosity
[]
[energy_time]
type = PINSFVEnergyTimeDerivative
variable = T_fluid
h = 'h'
dh_dt = 'dh_dt'
rho = ${rho}
drho_dt = 'drho_dt'
is_solid = false
porosity = porosity
[]
[energy_advection]
type = PINSFVEnergyAdvection
variable = T_fluid
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[energy_diffusion]
type = PINSFVEnergyDiffusion
variable = T_fluid
k = ${k}
porosity = porosity
[]
[energy_convection]
type = PINSFVEnergyAmbientConvection
variable = T_fluid
is_solid = false
T_fluid = T_fluid
T_solid = T_solid
h_solid_fluid = 'h_cv'
[]
[solid_energy_time]
type = PINSFVEnergyTimeDerivative
variable = T_solid
cp = ${cp_s}
rho = ${rho_s}
is_solid = true
porosity = porosity
[]
[solid_energy_diffusion]
type = FVDiffusion
variable = T_solid
coeff = ${k_s}
[]
[solid_energy_convection]
type = PINSFVEnergyAmbientConvection
variable = T_solid
is_solid = true
T_fluid = T_fluid
T_solid = T_solid
h_solid_fluid = 'h_cv'
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = superficial_vel_x
function = ${u_inlet}
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = superficial_vel_y
function = 0
[]
[inlet-T]
type = FVDirichletBC
variable = T_fluid
value = ${T_inlet}
boundary = 'left'
[]
[no-slip-u]
type = INSFVNoSlipWallBC
boundary = 'top'
variable = superficial_vel_x
function = 0
[]
[no-slip-v]
type = INSFVNoSlipWallBC
boundary = 'top'
variable = superficial_vel_y
function = 0
[]
[heated-side]
type = FVDirichletBC
boundary = 'top'
variable = 'T_solid'
value = ${top_side_temperature}
[]
[symmetry-u]
type = PINSFVSymmetryVelocityBC
boundary = 'bottom'
variable = superficial_vel_x
u = superficial_vel_x
v = superficial_vel_y
mu = ${mu}
momentum_component = 'x'
[]
[symmetry-v]
type = PINSFVSymmetryVelocityBC
boundary = 'bottom'
variable = superficial_vel_y
u = superficial_vel_x
v = superficial_vel_y
mu = ${mu}
momentum_component = 'y'
[]
[symmetry-p]
type = INSFVSymmetryPressureBC
boundary = 'bottom'
variable = pressure
[]
[outlet-p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = ${p_outlet}
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
[]
[]
[FunctorMaterials]
[fluid_props_to_mat_props]
type = GeneralFunctorFluidProps
fp = fp
pressure = 'pressure'
T_fluid = 'T_fluid'
speed = 'speed'
# To initialize with a high viscosity
mu_rampdown = 'mu_rampdown'
# For porous flow
characteristic_length = 1
porosity = 'porosity'
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
rho = ${rho}
temperature = 'T_fluid'
[]
[constants]
type = ADGenericFunctorMaterial
prop_names = 'h_cv'
prop_values = '${h_fs}'
[]
[speed]
type = PINSFVSpeedFunctorMaterial
porosity = 'porosity'
superficial_vel_x = 'superficial_vel_x'
superficial_vel_y = 'superficial_vel_y'
[]
[]
[Functions]
[mu_rampdown]
type = PiecewiseLinear
x = '1 2 3 4'
y = '1e3 1e2 1e1 1'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm 100 lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-12
nl_abs_tol = 1e-10
automatic_scaling = true
end_time = 3.0
[]
# Some basic Postprocessors to examine the solution
[Postprocessors]
[inlet-p]
type = SideAverageValue
variable = pressure
boundary = 'left'
[]
[outlet-u]
type = VolumetricFlowRate
boundary = 'right'
advected_quantity = '1'
advected_interp_method = ${advected_interp_method}
vel_x = 'superficial_vel_x'
vel_y = 'superficial_vel_y'
[]
[outlet-temp]
type = SideAverageValue
variable = T_fluid
boundary = 'right'
[]
[solid-temp]
type = ElementAverageValue
variable = T_solid
[]
[]
[Outputs]
exodus = true
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/with-direction/errors/flux_bcs.i)
l = 5
inlet_area = 2
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
rho = 1000
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '${l} ${l}'
dy = '${inlet_area}'
ix = '5 5'
iy = '2'
subdomain_id = '1 2'
[]
[side_set]
type = SideSetsBetweenSubdomainsGenerator
input = gen
primary_block = '1'
paired_block = '2'
new_boundary = 'mid-inlet'
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
block = 2
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
block = 2
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1e-15
block = 2
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
block = 2
[]
[T_fluid]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
block = 2
[]
[scalar]
type = MooseVariableFVReal
initial_condition = 0.1
block = 2
[]
[T_solid]
type = MooseVariableFVReal
initial_condition = ${inlet_temp}
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
# Mass equation
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
# X component momentum equation
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
# Y component momentum equation
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
# Energy equation
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T_fluid
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T_fluid
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T_fluid
v = power_density
[]
# Scalar concentration equation
[scalar_advection]
type = INSFVScalarFieldAdvection
variable = scalar
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_diffusion]
type = FVDiffusion
variable = scalar
coeff = 1.1
[]
[scalar_source]
type = FVBodyForce
variable = scalar
function = 2.1
[]
# Solid temperature
[solid_temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T_solid
[]
[]
[FVBCs]
# Inlet
[inlet_mass]
type = WCNSFVMassFluxBC
variable = pressure
boundary = 'mid-inlet'
velocity_pp = 'inlet_velocity'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_u]
type = WCNSFVMomentumFluxBC
variable = vel_x
boundary = 'mid-inlet'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'x'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_v]
type = WCNSFVMomentumFluxBC
variable = vel_y
boundary = 'mid-inlet'
mdot_pp = 0
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'y'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_T]
type = WCNSFVEnergyFluxBC
variable = T_fluid
T_fluid = T_fluid
boundary = 'mid-inlet'
temperature_pp = 'inlet_T'
velocity_pp = 'inlet_velocity'
area_pp = 'area_pp_left'
rho = 'rho'
cp = 'cp'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_scalar]
type = WCNSFVScalarFluxBC
variable = scalar
boundary = 'mid-inlet'
scalar_value_pp = 'inlet_scalar_value'
velocity_pp = 'inlet_velocity'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
passive_scalar = scalar
[]
[outlet_p]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
[]
# Walls
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'top bottom'
function = 0
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_mdot]
type = Receiver
default = '${fparse 1980 * inlet_velocity * inlet_area}'
[]
[inlet_velocity]
type = Receiver
default = ${inlet_velocity}
[]
[area_pp_left]
type = AreaPostprocessor
boundary = 'left'
execute_on = 'INITIAL'
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[inlet_scalar_value]
type = Receiver
default = 0.2
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k rho'
prop_values = '${cp} ${k} ${rho}'
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T_fluid'
rho = ${rho}
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
(test/tests/materials/functor_properties/vector-magnitude/test.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[u]
type = MooseVariableFVReal
[]
[v]
type = MooseVariableFVReal
[]
[]
[AuxVariables]
[mag]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[mag]
type = FunctorAux
variable = mag
functor = mat_mag
[]
[]
[FVKernels]
[v_diff]
type = FVDiffusion
variable = v
coeff = 1
[]
[u_diff]
type = FVDiffusion
variable = u
coeff = 1
[]
[]
[FVBCs]
[v_left]
type = FVDirichletBC
variable = v
boundary = 'left'
value = 0
[]
[v_right]
type = FVDirichletBC
variable = v
boundary = 'right'
value = 1
[]
[u_bottom]
type = FVDirichletBC
variable = u
boundary = 'bottom'
value = 0
[]
[u_top]
type = FVDirichletBC
variable = u
boundary = 'top'
value = 1
[]
[]
[Materials]
[functor]
type = ADVectorMagnitudeFunctorMaterial
x_functor = u
y_functor = v
vector_magnitude_name = mat_mag
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
exodus = true
[]
(test/tests/fvkernels/fv_simple_diffusion/grad-adaptive.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 100
[]
[Variables]
[v]
type = MooseVariableFVReal
initial_condition = 0
[]
[]
[AuxVariables]
[dummy]
type = MooseVariableFVReal
[]
[]
[FVKernels]
[time]
type = FVTimeKernel
variable = v
[]
[diff]
type = FVDiffusion
variable = v
coeff = coeff
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = v
boundary = left
value = 0
[]
[right]
type = FVDirichletBC
variable = v
boundary = right
value = 1
[]
[]
[Materials]
[diff]
type = ADGenericFunctorMaterial
prop_names = 'coeff'
prop_values = '1'
[]
[]
[Postprocessors]
[average]
type = ElementAverageValue
variable = v
[]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-6
optimal_iterations = 6
[]
end_time = 1000
nl_abs_tol = 1e-8
[]
[Outputs]
exodus = false
[csv]
type = CSV
execute_on = 'final'
[]
[]
[Adaptivity]
steps = 1
marker = error
[Indicators]
[jump]
type = GradientJumpIndicator
variable = v
[]
[]
[Markers]
[error]
type = ErrorFractionMarker
coarsen = 0.1
refine = 0.7
indicator = jump
[]
[]
max_h_level = 1
[]
(test/tests/fvics/constant_ic/constant_ic.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
nx = 2
ny = 2
dim = 2
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
[FVInitialCondition]
type = FVConstantIC
value = 6.2
[]
[]
[v]
type = MooseVariableFVReal
initial_condition = 3.1
[]
[w]
type = MooseVariableFVReal
[]
[]
[AuxVariables]
[u_aux]
type = MooseVariableFVReal
[FVInitialCondition]
type = FVConstantIC
value = 1.65
[]
[]
[]
[FVICs]
[cu]
type = FVConstantIC
variable = w
value = 9.3
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
exodus = true
[]
(modules/porous_flow/test/tests/dispersion/disp01_fv.i)
# Test dispersive part of FVPorousFlowDispersiveFlux kernel by setting diffusion
# coefficients to zero. A pressure gradient is applied over the mesh to give a
# uniform velocity. Gravity is set to zero.
# Mass fraction is set to 1 on the left hand side and 0 on the right hand side.
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
xmax = 10
bias_x = 1.1
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[Variables]
[pp]
type = MooseVariableFVReal
[]
[massfrac0]
type = MooseVariableFVReal
[]
[]
[AuxVariables]
[velocity]
family = MONOMIAL
order = FIRST
[]
[]
[AuxKernels]
[velocity]
type = ADPorousFlowDarcyVelocityComponent
variable = velocity
component = x
[]
[]
[ICs]
[pp]
type = FunctionIC
variable = pp
function = pic
[]
[massfrac0]
type = ConstantIC
variable = massfrac0
value = 0
[]
[]
[Functions]
[pic]
type = ParsedFunction
expression = '1.1e5-x*1e3'
[]
[]
[FVBCs]
[xleft]
type = FVDirichletBC
value = 1
variable = massfrac0
boundary = left
[]
[xright]
type = FVDirichletBC
value = 0
variable = massfrac0
boundary = right
[]
[pright]
type = FVDirichletBC
variable = pp
boundary = right
value = 1e5
[]
[pleft]
type = FVDirichletBC
variable = pp
boundary = left
value = 1.1e5
[]
[]
[FVKernels]
[mass0]
type = FVPorousFlowMassTimeDerivative
fluid_component = 0
variable = pp
[]
[adv0]
type = FVPorousFlowAdvectiveFlux
fluid_component = 0
variable = pp
[]
[diff0]
type = FVPorousFlowDispersiveFlux
variable = pp
disp_trans = 0
disp_long = 0.2
[]
[mass1]
type = FVPorousFlowMassTimeDerivative
fluid_component = 1
variable = massfrac0
[]
[adv1]
type = FVPorousFlowAdvectiveFlux
fluid_component = 1
variable = massfrac0
[]
[diff1]
type = FVPorousFlowDispersiveFlux
fluid_component = 1
variable = massfrac0
disp_trans = 0
disp_long = 0.2
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp massfrac0'
number_fluid_phases = 1
number_fluid_components = 2
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 1e9
density0 = 1000
viscosity = 0.001
thermal_expansion = 0
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
[]
[ppss]
type = ADPorousFlow1PhaseFullySaturated
porepressure = pp
[]
[massfrac]
type = ADPorousFlowMassFraction
mass_fraction_vars = massfrac0
[]
[simple_fluid]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[poro]
type = ADPorousFlowPorosityConst
porosity = 0.3
[]
[diff]
type = ADPorousFlowDiffusivityConst
diffusion_coeff = '0 0'
tortuosity = 0.1
[]
[relp]
type = ADPorousFlowRelativePermeabilityConst
phase = 0
[]
[permeability]
type = ADPorousFlowPermeabilityConst
permeability = '1e-9 0 0 0 1e-9 0 0 0 1e-9'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'gmres asm lu NONZERO'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 3e2
dtmax = 100
nl_abs_tol = 1e-12
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 2
cutback_factor = 0.5
dt = 10
[]
[]
[VectorPostprocessors]
[xmass]
type = ElementValueSampler
sort_by = id
variable = 'massfrac0 velocity'
[]
[]
[Outputs]
[out]
type = CSV
execute_on = final
[]
[]
(modules/navier_stokes/test/tests/ics/pns_test.i)
p_initial=1.01e5
T=273.15
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
ymin = 1
ymax = 2
nx = 4
ny = 4
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
kernel_coverage_check = false
solve = false
skip_nl_system_check = true
[]
[AuxVariables]
[porosity]
initial_condition = 0.2
[]
[pressure]
type = MooseVariableFVReal
[]
[superficial_vel_x]
type = MooseVariableFVReal
[]
[superficial_vel_y]
type = MooseVariableFVReal
[]
[superficial_vel_z]
type = MooseVariableFVReal
[]
[temperature]
type = MooseVariableFVReal
[]
[vel_x]
type = MooseVariableFVReal
[]
[vel_y]
type = MooseVariableFVReal
[]
[vel_z]
type = MooseVariableFVReal
[]
[superficial_rho_ht]
type = MooseVariableFVReal
[]
[ht]
type = MooseVariableFVReal
[]
[e]
type = MooseVariableFVReal
[]
[Mach]
type = MooseVariableFVReal
[]
[superficial_rho]
type = MooseVariableFVReal
[]
[superficial_rhou]
type = MooseVariableFVReal
[]
[superficial_rhov]
type = MooseVariableFVReal
[]
[superficial_rhow]
type = MooseVariableFVReal
[]
[superficial_rho_et]
type = MooseVariableFVReal
[]
[rho]
type = MooseVariableFVReal
[]
[rhou]
type = MooseVariableFVReal
[]
[rhov]
type = MooseVariableFVReal
[]
[rhow]
type = MooseVariableFVReal
[]
[rho_et]
type = MooseVariableFVReal
[]
[specific_volume]
type = MooseVariableFVReal
[]
[pressure_2]
[]
[superficial_vel_x_2]
[]
[superficial_vel_y_2]
[]
[superficial_vel_z_2]
[]
[vel_x_2]
[]
[vel_y_2]
[]
[vel_z_2]
[]
[temperature_2]
[]
[ht_2]
[]
[superficial_rho_ht_2]
[]
[e_2]
[]
[Mach_2]
[]
[superficial_rho_2]
[]
[superficial_rhou_2]
[]
[superficial_rhov_2]
[]
[superficial_rhow_2]
[]
[superficial_rho_et_2]
[]
[rho_2]
[]
[rhou_2]
[]
[rhov_2]
[]
[rhow_2]
[]
[rho_et_2]
[]
[specific_volume_2]
[]
[]
[GlobalParams]
fluid_properties = 'fp'
initial_pressure = ${p_initial}
initial_temperature = ${T}
initial_superficial_velocity = '1 0.2 18'
porosity = porosity
[]
[ICs]
[p]
type = PNSInitialCondition
variable = 'pressure'
[]
[vel_x]
type = PNSInitialCondition
variable = 'vel_x'
[]
[vel_y]
type = PNSInitialCondition
variable = 'vel_y'
[]
[vel_z]
type = PNSInitialCondition
variable = 'vel_z'
[]
[superficial_vel_x]
type = PNSInitialCondition
variable = 'superficial_vel_x'
[]
[superficial_vel_y]
type = PNSInitialCondition
variable = 'superficial_vel_y'
[]
[superficial_vel_z]
type = PNSInitialCondition
variable = 'superficial_vel_z'
[]
[temperature]
type = PNSInitialCondition
variable = 'temperature'
[]
[ht]
type = PNSInitialCondition
variable = 'ht'
[]
[superficial_rho_ht]
type = PNSInitialCondition
variable = 'superficial_rho_ht'
[]
[e]
type = PNSInitialCondition
variable = 'e'
[]
[Mach]
type = PNSInitialCondition
variable = 'Mach'
[]
[superficial_rho]
type = PNSInitialCondition
variable = 'superficial_rho'
[]
[superficial_rhou]
type = PNSInitialCondition
fluid_properties = 'fp'
initial_pressure = ${p_initial}
initial_temperature = ${T}
initial_superficial_velocity = '1 0.2 18'
porosity = porosity
variable = 'superficial_rhou'
[]
[superficial_rhov]
type = PNSInitialCondition
variable = 'superficial_rhov'
[]
[superficial_rhow]
type = PNSInitialCondition
variable = 'superficial_rhow'
[]
[rho]
type = PNSInitialCondition
variable = 'rho'
[]
[rhou]
type = PNSInitialCondition
variable = 'rhou'
[]
[rhov]
type = PNSInitialCondition
variable = 'rhov'
[]
[rhow]
type = PNSInitialCondition
variable = 'rhow'
[]
[rho_et]
type = PNSInitialCondition
variable = 'rho_et'
[]
[superficial_rho_et]
type = PNSInitialCondition
variable = 'superficial_rho_et'
[]
[specific_volume]
type = PNSInitialCondition
variable = 'specific_volume'
[]
[p_2]
type = PNSInitialCondition
variable = 'pressure_2'
variable_type = 'pressure'
[]
[superficial_vel_x_2]
type = PNSInitialCondition
variable = 'superficial_vel_x_2'
variable_type = 'superficial_vel_x'
[]
[superficial_vel_y_2]
type = PNSInitialCondition
variable = 'superficial_vel_y_2'
variable_type = 'superficial_vel_y'
[]
[superficial_vel_z_2]
type = PNSInitialCondition
variable = 'superficial_vel_z_2'
variable_type = 'superficial_vel_z'
[]
[vel_x_2]
type = PNSInitialCondition
variable = 'vel_x_2'
variable_type = 'vel_x'
[]
[vel_y_2]
type = PNSInitialCondition
variable = 'vel_y_2'
variable_type = 'vel_y'
[]
[vel_z_2]
type = PNSInitialCondition
variable = 'vel_z_2'
variable_type = 'vel_z'
[]
[temperature_2]
type = PNSInitialCondition
variable = 'temperature_2'
variable_type = 'temperature'
[]
[superficial_ht_2]
type = PNSInitialCondition
variable = 'superficial_rho_ht_2'
variable_type = 'superficial_rho_ht'
[]
[ht_2]
type = PNSInitialCondition
variable = 'ht_2'
variable_type = 'ht'
[]
[e_2]
type = PNSInitialCondition
variable = 'e_2'
variable_type = 'e'
[]
[Mach_2]
type = PNSInitialCondition
variable = 'Mach_2'
variable_type = 'Mach'
[]
[superficial_rho_2]
type = PNSInitialCondition
variable = 'superficial_rho_2'
variable_type = 'superficial_rho'
[]
[superficial_rhou_2]
type = PNSInitialCondition
variable = 'superficial_rhou_2'
variable_type = 'superficial_rhou'
[]
[superficial_rhov_2]
type = PNSInitialCondition
variable = 'superficial_rhov_2'
variable_type = 'superficial_rhov'
[]
[superficial_rhow_2]
type = PNSInitialCondition
variable = 'superficial_rhow_2'
variable_type = 'superficial_rhow'
[]
[superficial_rho_et_2]
type = PNSInitialCondition
variable = 'superficial_rho_et_2'
variable_type = 'superficial_rho_et'
[]
[rho_2]
type = PNSInitialCondition
variable = 'rho_2'
variable_type = 'rho'
[]
[rhou_2]
type = PNSInitialCondition
variable = 'rhou_2'
variable_type = 'rhou'
[]
[rhov_2]
type = PNSInitialCondition
variable = 'rhov_2'
variable_type = 'rhov'
[]
[rhow_2]
type = PNSInitialCondition
variable = 'rhow_2'
variable_type = 'rhow'
[]
[rho_et_2]
type = PNSInitialCondition
variable = 'rho_et_2'
variable_type = 'rho_et'
[]
[specific_volume_2]
type = PNSInitialCondition
variable = 'specific_volume_2'
variable_type = 'specific_volume'
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
[]
(test/tests/postprocessors/side_advection_flux_integral/side_advection_flux_integral_fv.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '0.75 0.75 0.75'
dy = '0.75 0.75 0.75'
ix = '2 2 2'
iy = '2 2 2'
subdomain_id = '1 1 1
1 2 1
1 1 1'
[]
[add_inner_boundaries_top]
type = SideSetsAroundSubdomainGenerator
input = cmg
new_boundary = 'block_2_top'
block = 2
normal = '0 1 0'
[]
[add_inner_boundaries_bot]
type = SideSetsAroundSubdomainGenerator
input = add_inner_boundaries_top
new_boundary = 'block_2_bot'
block = 2
normal = '0 -1 0'
[]
[add_inner_boundaries_right]
type = SideSetsAroundSubdomainGenerator
input = add_inner_boundaries_bot
new_boundary = 'block_2_right'
block = 2
normal = '1 0 0'
[]
[add_inner_boundaries_left]
type = SideSetsAroundSubdomainGenerator
input = add_inner_boundaries_right
new_boundary = 'block_2_left'
block = 2
normal = '-1 0 0'
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
two_term_boundary_expansion = false
[]
[]
[ICs]
[u_blob]
type = FunctionIC
variable = u
function = 'if(x<0.75,if(y<0.75,1,0),0)'
[]
[]
[FVKernels]
[advection]
type = FVAdvection
variable = u
velocity = '2 1.5 0'
[]
[time]
type = FVTimeKernel
variable = u
[]
[]
[FVBCs]
[fv_outflow]
type = FVConstantScalarOutflowBC
velocity = '2 1.5 0'
variable = u
boundary = 'right top'
[]
[]
[Executioner]
type = Transient
solve_type = LINEAR
dt = 0.01
end_time = 0.02
l_tol = 1E-14
[]
[Postprocessors]
[flux_right]
type = SideAdvectiveFluxIntegral
boundary = 'block_2_right'
vel_x = 2
vel_y = 1.5
component = x
advected_quantity = u
[]
[flux_left_exact]
type = SideAdvectiveFluxIntegral
boundary = 'block_2_left'
vel_x = 2
vel_y = 1.5
component = x
advected_quantity = u
[]
[]
[Outputs]
csv = true
[]
(test/tests/bounds/constant_bounds_fv.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = 1
nx = 10
[]
[Variables]
[u]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[v]
type = MooseVariableFVReal
[]
[]
[AuxVariables]
[bounds_dummy]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[FVKernels]
[diff_u]
type = FVDiffusion
variable = u
coeff = 4
[]
[reaction_u]
type = FVReaction
variable = u
[]
[diff_v]
type = FVDiffusion
variable = v
coeff = 2
[]
[reaction_v]
type = FVReaction
variable = v
[]
[]
[FVBCs]
[left_u]
type = FVDirichletBC
variable = u
boundary = '0'
value = -0.5
[]
[right_u]
type = FVNeumannBC
variable = u
boundary = 1
value = 30
[]
[left_v]
type = FVDirichletBC
variable = v
boundary = '0'
value = 4
[]
[right_v]
type = FVNeumannBC
variable = v
boundary = 1
value = -40
[]
[]
[Bounds]
[u_upper_bound]
type = ConstantBounds
variable = bounds_dummy
bounded_variable = u
bound_type = upper
bound_value = 1
[]
[u_lower_bound]
type = ConstantBounds
variable = bounds_dummy
bounded_variable = u
bound_type = lower
bound_value = 0
[]
[v_upper_bound]
type = ConstantBounds
variable = bounds_dummy
bounded_variable = v
bound_type = upper
bound_value = 3
[]
[v_lower_bound]
type = ConstantBounds
variable = bounds_dummy
bounded_variable = v
bound_type = lower
bound_value = -1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-snes_type'
petsc_options_value = 'vinewtonrsls'
[]
[Outputs]
exodus = true
[]
(test/tests/postprocessors/element_extreme_functor_value/extreme_proxy_value.i)
[Problem]
type = FEProblem
solve = false
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 40
ny = 40
[]
[AuxVariables]
[u]
type = MooseVariableFVReal
[]
[w]
type = MooseVariableFVReal
[]
[v_x]
type = MooseVariableFVReal
[]
[v_y]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[u]
type = FunctionAux
variable = u
function = u_f
[]
[w]
type = FunctionAux
variable = w
function = w_f
[]
[v_x]
type = FunctionAux
variable = v_x
function = v_x_f
[]
[v_y]
type = FunctionAux
variable = v_y
function = v_y_f
[]
[]
[Functions]
[u_f] # reaches a maximum value at (0.5, 0.6)
type = ParsedFunction
expression = 'sin(pi*x)*sin(pi*y/1.2)'
[]
[w_f] # reaches a minium expression at (0.7, 0.8)
type = ParsedFunction
expression = '-sin(pi*x/1.4)*sin(pi*y/1.6)'
[]
[v_x_f]
type = ParsedFunction
expression = 'x'
[]
[v_y_f]
type = ParsedFunction
expression = 'y'
[]
[]
[Postprocessors]
[max_u]
type = ADElementExtremeFunctorValue
functor = 'u'
[]
[min_w_f]
type = ElementExtremeFunctorValue
functor = 'w_f'
value_type = min
[]
[max_v_x]
type = ADElementExtremeFunctorValue
functor = 'v_x'
[]
[min_v_y]
type = ADElementExtremeFunctorValue
functor = 'v_y'
value_type = min
[]
# because we set v_x and v_y equal to the x and y coordinates, these two postprocessors
# should just return the point at which u reaches a maximum value
[max_v_from_proxy_x]
type = ADElementExtremeFunctorValue
functor = v_x
proxy_functor = u
value_type = max
[]
[max_v_from_proxy_y]
type = ADElementExtremeFunctorValue
functor = v_y
proxy_functor = u
value_type = max
[]
# because we set v_x and v_y equal to the x and y coordinates, these two postprocessors
# should just return the point at which w reaches a minimum value
[min_v_from_proxy_x]
type = ADElementExtremeFunctorValue
functor = v_x
proxy_functor = w
value_type = min
[]
[min_v_from_proxy_y]
type = ADElementExtremeFunctorValue
functor = v_y
proxy_functor = w
value_type = min
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(modules/porous_flow/test/tests/gravity/grav02e_fv.i)
# Checking that gravity head is established in the transient situation when 0<=saturation<=1 (note the less-than-or-equal-to).
# 2phase (PS), 2components, constant capillary pressure, constant fluid bulk-moduli for each phase, constant viscosity,
# constant permeability, Corey relative permeabilities with no residual saturation
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
xmax = 100
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '-10 0 0'
[]
[Variables]
[ppwater]
type = MooseVariableFVReal
initial_condition = 1.5e6
[]
[sgas]
type = MooseVariableFVReal
initial_condition = 0.3
[]
[]
[AuxVariables]
[massfrac_ph0_sp0]
type = MooseVariableFVReal
initial_condition = 1
[]
[massfrac_ph1_sp0]
type = MooseVariableFVReal
initial_condition = 0
[]
[ppgas]
type = MooseVariableFVReal
[]
[swater]
type = MooseVariableFVReal
[]
[relpermwater]
type = MooseVariableFVReal
[]
[relpermgas]
type = MooseVariableFVReal
[]
[]
[FVKernels]
[mass0]
type = FVPorousFlowMassTimeDerivative
fluid_component = 0
variable = ppwater
[]
[flux0]
type = FVPorousFlowAdvectiveFlux
fluid_component = 0
variable = ppwater
[]
[mass1]
type = FVPorousFlowMassTimeDerivative
fluid_component = 1
variable = sgas
[]
[flux1]
type = FVPorousFlowAdvectiveFlux
fluid_component = 1
variable = sgas
[]
[]
[AuxKernels]
[ppgas]
type = ADPorousFlowPropertyAux
property = pressure
phase = 1
variable = ppgas
execute_on = 'initial timestep_end'
[]
[swater]
type = ADPorousFlowPropertyAux
property = saturation
phase = 0
variable = swater
execute_on = 'initial timestep_end'
[]
[relpermwater]
type = ADPorousFlowPropertyAux
property = relperm
phase = 0
variable = relpermwater
execute_on = 'initial timestep_end'
[]
[relpermgas]
type = ADPorousFlowPropertyAux
property = relperm
phase = 1
variable = relpermgas
execute_on = 'initial timestep_end'
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'ppwater sgas'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureConst
pc = 1e5
[]
[]
[FluidProperties]
[simple_fluid0]
type = SimpleFluidProperties
bulk_modulus = 2e9
density0 = 1000
viscosity = 1e-3
thermal_expansion = 0
[]
[simple_fluid1]
type = SimpleFluidProperties
bulk_modulus = 2e9
density0 = 10
viscosity = 1e-5
thermal_expansion = 0
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
[]
[ppss]
type = ADPorousFlow2PhasePS
phase0_porepressure = ppwater
phase1_saturation = sgas
capillary_pressure = pc
[]
[massfrac]
type = ADPorousFlowMassFraction
mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
[]
[simple_fluid0]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid0
phase = 0
[]
[simple_fluid1]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid1
phase = 1
[]
[porosity]
type = ADPorousFlowPorosityConst
porosity = 0.1
[]
[permeability]
type = ADPorousFlowPermeabilityConst
permeability = '1e-11 0 0 0 1e-11 0 0 0 1e-11'
[]
[relperm_water]
type = ADPorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[]
[relperm_gas]
type = ADPorousFlowRelativePermeabilityCorey
n = 2
phase = 1
[]
[]
[VectorPostprocessors]
[vars]
type = ElementValueSampler
variable = 'ppgas ppwater sgas swater'
sort_by = x
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 5e3
nl_abs_tol = 1e-12
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e3
[]
[]
[Outputs]
execute_on = 'final'
perf_graph = true
csv = true
[]
(test/tests/materials/functor_properties/ad_conversion/1d_dirichlet.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
xmax = 2
[]
[Variables]
[v]
type = MooseVariableFVReal
[]
[]
[AuxVariables]
[sink]
type = MooseVariableFVReal
[]
[]
[ICs]
[sink]
type = FunctionIC
variable = sink
function = 'x^3'
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = v
coeff = 1
[]
[sink]
type = FVFunctorElementalKernel
variable = v
functor_name = 'ad_sink'
[]
[]
[FVBCs]
[bounds]
type = FVDirichletBC
variable = v
boundary = 'left right'
value = 0
[]
[]
[Materials]
[converter_to_regular]
type = FunctorADConverter
ad_props_in = 'sink'
reg_props_out = 'regular_sink_0'
[]
# Just to change the name
[functor]
type = GenericFunctorMaterial
prop_names = 'regular_sink_1'
prop_values = 'regular_sink_0'
[]
[converter_to_ad]
type = FunctorADConverter
reg_props_in = 'regular_sink_1'
ad_props_out = 'ad_sink'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/heated/2d-transient-action.i)
# Fluid properties
mu = 1
rho = 1
cp = 1
k = 1e-3
# Solid properties
cp_s = 2
rho_s = 4
k_s = 1e-2
h_fs = 10
# Operating conditions
u_inlet = 1
T_inlet = 200
p_outlet = 10
top_side_temperature = 150
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = 0
ymax = 1
nx = 100
ny = 20
[]
[]
[Variables]
[T_solid]
type = MooseVariableFVReal
initial_condition = 100
[]
[]
[AuxVariables]
[porosity]
type = MooseVariableFVReal
initial_condition = 0.5
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'incompressible'
porous_medium_treatment = true
add_energy_equation = true
density = 'rho'
dynamic_viscosity = 'mu'
thermal_conductivity = 'k'
specific_heat = 'cp'
porosity = 'porosity'
initial_velocity = '${u_inlet} 1e-6 0'
initial_pressure = ${p_outlet}
initial_temperature = 0.0
inlet_boundaries = 'left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_function = '${u_inlet} 0'
energy_inlet_types = 'heatflux'
energy_inlet_function = '${fparse u_inlet * rho * cp * T_inlet}'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip symmetry'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '0 0'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${p_outlet}'
ambient_convection_alpha = 'h_cv'
ambient_temperature = 'T_solid'
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
energy_advection_interpolation = 'average'
[]
[]
[FVKernels]
[solid_energy_time]
type = PINSFVEnergyTimeDerivative
variable = T_solid
cp = ${cp_s}
rho = ${rho_s}
is_solid = true
porosity = porosity
[]
[solid_energy_diffusion]
type = FVDiffusion
variable = T_solid
coeff = ${k_s}
[]
[solid_energy_convection]
type = PINSFVEnergyAmbientConvection
variable = T_solid
is_solid = true
T_fluid = T_fluid
T_solid = T_solid
h_solid_fluid = 'h_cv'
[]
[]
[FVBCs]
[heated-side]
type = FVDirichletBC
boundary = 'top'
variable = 'T_solid'
value = ${top_side_temperature}
[]
[]
[FunctorMaterials]
[constants]
type = ADGenericFunctorMaterial
prop_names = 'h_cv cp rho mu k'
prop_values = '${h_fs} ${cp} ${rho} ${mu} ${k}'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
end_time = 1.5
[]
# Some basic Postprocessors to examine the solution
[Postprocessors]
[inlet-p]
type = SideAverageValue
variable = pressure
boundary = 'left'
[]
[outlet-u]
type = SideAverageValue
variable = superficial_vel_x
boundary = 'right'
[]
[outlet-temp]
type = SideAverageValue
variable = T_fluid
boundary = 'right'
[]
[solid-temp]
type = ElementAverageValue
variable = T_solid
[]
[]
[Outputs]
exodus = true
csv = false
[]
(test/tests/fvkernels/constraints/integral_transient.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 4
[]
[Variables]
[v]
type = MooseVariableFVReal
[]
[lambda]
type = MooseVariableScalar
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = v
coeff = coeff
[]
[average]
type = FVIntegralValueConstraint
variable = v
phi0 = phi0_pp
lambda = lambda
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = v
boundary = left
value = 7
[]
[]
[Materials]
[diff]
type = ADGenericFunctorMaterial
prop_names = 'coeff'
prop_values = '1'
[]
[]
[Postprocessors]
[phi0_pp]
type = FunctionValuePostprocessor
function = 't + 13'
execute_on = 'INITIAL TIMESTEP_BEGIN'
[]
[]
[Executioner]
type = Transient
dt = 1
num_steps = 2
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[]
[Outputs]
exodus = true
[]
(modules/heat_transfer/test/tests/gap_heat_transfer_mortar/fv_modular_gap_heat_transfer_mortar_radiation_conduction.i)
[Mesh]
inactive = 'translate'
[file]
type = FileMeshGenerator
file = 2blk-gap.e
[]
[secondary]
type = LowerDBlockFromSidesetGenerator
sidesets = '101'
new_block_id = 10001
new_block_name = 'secondary_lower'
input = file
[]
[primary]
type = LowerDBlockFromSidesetGenerator
sidesets = '100'
new_block_id = 10000
new_block_name = 'primary_lower'
input = secondary
[]
[translate]
type = TransformGenerator
transform = translate
input = primary
vector_value = '1 0 0'
[]
[]
[Problem]
kernel_coverage_check = false
material_coverage_check = false
[]
[Variables]
[temp]
type = MooseVariableFVReal
block = '1 2'
[]
[lm]
order = CONSTANT
family = MONOMIAL
block = 'secondary_lower'
[]
[]
[Materials]
[left]
type = ADGenericFunctorMaterial
block = 1
prop_names = 'thermal_conductivity'
prop_values = '0.01'
[]
[right]
type = ADGenericFunctorMaterial
block = 2
prop_names = 'thermal_conductivity'
prop_values = '0.005'
[]
[]
[FVKernels]
[hc]
type = FVDiffusion
variable = temp
block = '1 2'
coeff = 'thermal_conductivity'
[]
[]
[UserObjects]
[radiation]
type = FunctorGapFluxModelRadiation
temperature = temp
boundary = 100
primary_emissivity = 1.0
secondary_emissivity = 1.0
[]
[conduction]
type = FunctorGapFluxModelConduction
temperature = temp
boundary = 100
gap_conductivity = 0.02
[]
[]
[Constraints]
[ced]
type = ModularGapConductanceConstraint
variable = lm
secondary_variable = temp
primary_boundary = 100
primary_subdomain = 10000
secondary_boundary = 101
secondary_subdomain = 10001
gap_flux_models = 'radiation conduction'
ghost_higher_d_neighbors = true
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = temp
boundary = 'left'
value = 100
[]
[right]
type = FVDirichletBC
variable = temp
boundary = 'right'
value = 0
[]
[]
[Executioner]
type = Steady
nl_rel_tol = 1e-11
nl_abs_tol = 1.0e-10
solve_type = NEWTON
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/pwcns/channel-flow/2d-transient-action.i)
# Solid properties
cp_s = 2
rho_s = 4
k_s = 1e-2
h_fs = 10
# Operating conditions
u_inlet = 1
T_inlet = 200
p_outlet = 10
top_side_temperature = 150
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = 0
ymax = 1
nx = 20
ny = 5
[]
[]
[Variables]
[T_solid]
type = MooseVariableFVReal
initial_condition = 100
[]
[]
[AuxVariables]
[porosity]
type = MooseVariableFVReal
initial_condition = 0.5
[]
[velocity_norm]
type = MooseVariableFVReal
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'weakly-compressible'
add_energy_equation = true
porous_medium_treatment = true
density = 'rho'
dynamic_viscosity = 'mu'
thermal_conductivity = 'k'
specific_heat = 'cp'
initial_velocity = '${u_inlet} 1e-6 0'
initial_pressure = '${p_outlet}'
initial_temperature = '${T_inlet}'
inlet_boundaries = 'left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_function = '${u_inlet} 0'
energy_inlet_types = 'fixed-temperature'
energy_inlet_function = '${T_inlet}'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip symmetry'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '0 0'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${p_outlet}'
ambient_convection_alpha = 'h_cv'
ambient_temperature = 'T_solid'
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
energy_advection_interpolation = 'average'
[]
[]
[FVKernels]
[solid_energy_time]
type = PINSFVEnergyTimeDerivative
variable = T_solid
cp = ${cp_s}
rho = ${rho_s}
is_solid = true
porosity = 'porosity'
[]
[solid_energy_diffusion]
type = FVDiffusion
variable = T_solid
coeff = ${k_s}
[]
[solid_energy_convection]
type = PINSFVEnergyAmbientConvection
variable = T_solid
is_solid = true
T_fluid = 'T_fluid'
T_solid = 'T_solid'
h_solid_fluid = 'h_cv'
[]
[]
[FVBCs]
[heated-side]
type = FVDirichletBC
boundary = 'top'
variable = 'T_solid'
value = ${top_side_temperature}
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'h_cv'
prop_values = '${h_fs}'
[]
[fluid_props_to_mat_props]
type = GeneralFunctorFluidProps
fp = fp
pressure = 'pressure'
T_fluid = 'T_fluid'
speed = 'velocity_norm'
# To initialize with a high viscosity
mu_rampdown = 'mu_rampdown'
# For porous flow
characteristic_length = 1
porosity = 'porosity'
[]
[]
[Functions]
[mu_rampdown]
type = PiecewiseLinear
x = '1 2 3 4'
y = '1e3 1e2 1e1 1'
[]
[]
[AuxKernels]
[speed]
type = ParsedAux
variable = 'velocity_norm'
coupled_variables = 'superficial_vel_x superficial_vel_y porosity'
expression = 'sqrt(superficial_vel_x*superficial_vel_x + superficial_vel_y*superficial_vel_y) / '
'porosity'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm 100 lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-12
end_time = 3.0
[]
# Some basic Postprocessors to examine the solution
[Postprocessors]
[inlet-p]
type = SideAverageValue
variable = pressure
boundary = 'left'
[]
[outlet-u]
type = SideAverageValue
variable = superficial_vel_x
boundary = 'right'
[]
[outlet-temp]
type = SideAverageValue
variable = T_fluid
boundary = 'right'
[]
[solid-temp]
type = ElementAverageValue
variable = T_solid
[]
[]
[Outputs]
exodus = true
csv = false
[]
(test/tests/tag/tag-fv.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
[]
[Variables]
[v]
type = MooseVariableFVReal
initial_condition = 7
[]
[]
[AuxVariables]
[soln_dof]
type = MooseVariableFVReal
[]
[soln_old_dof]
type = MooseVariableFVReal
[]
[soln_older_dof]
type = MooseVariableFVReal
[]
[resid_nontime_dof]
type = MooseVariableFVReal
[]
[soln]
type = MooseVariableFVReal
[]
[soln_old]
type = MooseVariableFVReal
[]
[soln_older]
type = MooseVariableFVReal
[]
[resid_nontime]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[soln_dof]
type = TagVectorDofValueAux
variable = soln_dof
v = v
vector_tag = 'solution'
[]
[soln_old_dof]
type = TagVectorDofValueAux
variable = soln_old_dof
v = v
vector_tag = 'solution_state_1'
[]
[soln_older_dof]
type = TagVectorDofValueAux
variable = soln_older_dof
v = v
vector_tag = 'solution_state_2'
[]
[nontime_dof]
type = TagVectorDofValueAux
variable = resid_nontime_dof
v = v
vector_tag = 'nontime'
[]
[soln]
type = TagVectorAux
variable = soln
v = v
vector_tag = 'solution'
[]
[soln_old]
type = TagVectorAux
variable = soln_old
v = v
vector_tag = 'solution_state_1'
[]
[soln_older]
type = TagVectorAux
variable = soln_older
v = v
vector_tag = 'solution_state_2'
[]
[nontime]
type = TagVectorAux
variable = resid_nontime
v = v
vector_tag = 'nontime'
[]
[]
[FVKernels]
[time]
type = FVTimeKernel
variable = v
[]
[diff]
type = FVDiffusion
variable = v
coeff = coeff
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = v
boundary = left
value = 7
[]
[right]
type = FVDirichletBC
variable = v
boundary = right
value = 42
[]
[]
[Materials]
[diff]
type = ADGenericFunctorMaterial
prop_names = 'coeff'
prop_values = '.2'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
num_steps = 5
dt = 0.1
[]
[Outputs]
exodus = true
[]
(test/tests/functors/fe-var-for-fv-neumann/test.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 20
[]
[]
[Variables]
[fe][]
[fv]
type = MooseVariableFVReal
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = fe
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = fv
coeff = 1
[]
[]
[BCs]
[left]
type = DirichletBC
variable = fe
value = 0
boundary = left
[]
[right]
type = DirichletBC
variable = fe
value = 1
boundary = right
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = fv
value = 0
boundary = left
[]
[right]
type = FVFunctorNeumannBC
variable = fv
functor = fe
boundary = right
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
exodus = true
[]
(test/tests/fviks/one-var-diffusion/no-ik.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 10
xmax = 2
[]
[subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '1.0 0 0'
block_id = 1
top_right = '2.0 1.0 0'
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = u
coeff = 'coeff'
coeff_interp_method = average
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = u
boundary = 'left'
value = 1
[]
[right]
type = FVDirichletBC
variable = u
boundary = 'right'
value = 0
[]
[]
[Materials]
[block0]
type = ADGenericFunctorMaterial
block = '0'
prop_names = 'coeff'
prop_values = '4'
[]
[block1]
type = ADGenericFunctorMaterial
block = '1'
prop_names = 'coeff'
prop_values = '2'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
csv = true
[]
[Functions]
[exact_u]
type = ParsedFunction
expression = 'if(x<1, 1 - x/3, 4/3 - 2*x/3)'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2u]
type = ElementL2Error
variable = u
function = exact_u
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/2d-scalar-transport-action.i)
mu = 1
rho = 1
k = 1e-3
diff = 1e-3
cp = 1
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = -1
ymax = 1
nx = 100
ny = 20
[]
[]
[Variables]
inactive = 'vel_x vel_y pressure T_fluid scalar'
[vel_x]
type = 'INSFVVelocityVariable'
initial_condition = 1
[]
[vel_y]
type = 'INSFVVelocityVariable'
initial_condition = 1
[]
[pressure]
type = 'INSFVPressureVariable'
initial_condition = 0
[]
[T_fluid]
type = 'INSFVEnergyVariable'
initial_condition = 0
[]
[scalar]
type = MooseVariableFVReal
initial_condition = 0
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'incompressible'
add_energy_equation = true
add_scalar_equation = true
passive_scalar_names = 'scalar'
density = ${rho}
dynamic_viscosity = ${mu}
thermal_conductivity = ${k}
specific_heat = ${cp}
passive_scalar_diffusivity = ${diff}
passive_scalar_source = 0.1
passive_scalar_coupled_source = U
passive_scalar_coupled_source_coeff = 0.1
inlet_boundaries = 'left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_function = '1 0'
energy_inlet_types = 'fixed-temperature'
energy_inlet_function = '1'
passive_scalar_inlet_types = 'fixed-value'
passive_scalar_inlet_function = '1'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip noslip'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '0 0'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '0'
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
energy_advection_interpolation = 'average'
passive_scalar_advection_interpolation = 'average'
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = vel_x
y = vel_y
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/pwcns/channel-flow/2d-transient.i)
# Fluid properties
mu = 'mu'
rho = 'rho'
cp = 'cp'
k = 'k'
# Solid properties
cp_s = 2
rho_s = 4
k_s = 1e-2
h_fs = 10
# Operating conditions
u_inlet = 1
T_inlet = 200
p_outlet = 10
top_side_temperature = 150
# Numerical scheme
advected_interp_method = 'average'
velocity_interp_method = 'rc'
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = 0
ymax = 1
nx = 20
ny = 5
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = PINSFVRhieChowInterpolator
u = superficial_vel_x
v = superficial_vel_y
pressure = pressure
porosity = porosity
[]
[]
[Variables]
[superficial_vel_x]
type = PINSFVSuperficialVelocityVariable
initial_condition = ${u_inlet}
[]
[superficial_vel_y]
type = PINSFVSuperficialVelocityVariable
initial_condition = 1e-6
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${p_outlet}
[]
[T_fluid]
type = INSFVEnergyVariable
initial_condition = ${T_inlet}
[]
[T_solid]
type = MooseVariableFVReal
initial_condition = 100
[]
[]
[AuxVariables]
[porosity]
type = MooseVariableFVReal
initial_condition = 0.5
[]
[velocity_norm]
type = MooseVariableFVReal
[]
[]
[FVKernels]
[mass_time]
type = PWCNSFVMassTimeDerivative
variable = pressure
porosity = 'porosity'
drho_dt = 'drho_dt'
[]
[mass]
type = PWCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = superficial_vel_x
rho = ${rho}
drho_dt = 'drho_dt'
momentum_component = 'x'
[]
[u_advection]
type = PINSFVMomentumAdvection
variable = superficial_vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
porosity = porosity
momentum_component = 'x'
[]
[u_viscosity]
type = PINSFVMomentumDiffusion
variable = superficial_vel_x
mu = ${mu}
porosity = porosity
momentum_component = 'x'
[]
[u_pressure]
type = PINSFVMomentumPressure
variable = superficial_vel_x
momentum_component = 'x'
pressure = pressure
porosity = porosity
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = superficial_vel_y
rho = ${rho}
drho_dt = 'drho_dt'
momentum_component = 'y'
[]
[v_advection]
type = PINSFVMomentumAdvection
variable = superficial_vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
porosity = porosity
momentum_component = 'y'
[]
[v_viscosity]
type = PINSFVMomentumDiffusion
variable = superficial_vel_y
mu = ${mu}
porosity = porosity
momentum_component = 'y'
[]
[v_pressure]
type = PINSFVMomentumPressure
variable = superficial_vel_y
momentum_component = 'y'
pressure = pressure
porosity = porosity
[]
[energy_time]
type = PINSFVEnergyTimeDerivative
variable = T_fluid
cp = ${cp}
rho = ${rho}
drho_dt = 'drho_dt'
is_solid = false
porosity = porosity
[]
[energy_advection]
type = PINSFVEnergyAdvection
variable = T_fluid
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[energy_diffusion]
type = PINSFVEnergyDiffusion
variable = T_fluid
k = ${k}
porosity = porosity
[]
[energy_convection]
type = PINSFVEnergyAmbientConvection
variable = T_fluid
is_solid = false
T_fluid = T_fluid
T_solid = T_solid
h_solid_fluid = 'h_cv'
[]
[solid_energy_time]
type = PINSFVEnergyTimeDerivative
variable = T_solid
cp = ${cp_s}
rho = ${rho_s}
is_solid = true
porosity = porosity
[]
[solid_energy_diffusion]
type = FVDiffusion
variable = T_solid
coeff = ${k_s}
[]
[solid_energy_convection]
type = PINSFVEnergyAmbientConvection
variable = T_solid
is_solid = true
T_fluid = T_fluid
T_solid = T_solid
h_solid_fluid = 'h_cv'
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = superficial_vel_x
function = ${u_inlet}
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = superficial_vel_y
function = 0
[]
[inlet-T]
type = FVDirichletBC
variable = T_fluid
value = ${T_inlet}
boundary = 'left'
[]
[no-slip-u]
type = INSFVNoSlipWallBC
boundary = 'top'
variable = superficial_vel_x
function = 0
[]
[no-slip-v]
type = INSFVNoSlipWallBC
boundary = 'top'
variable = superficial_vel_y
function = 0
[]
[heated-side]
type = FVDirichletBC
boundary = 'top'
variable = 'T_solid'
value = ${top_side_temperature}
[]
[symmetry-u]
type = PINSFVSymmetryVelocityBC
boundary = 'bottom'
variable = superficial_vel_x
u = superficial_vel_x
v = superficial_vel_y
mu = ${mu}
momentum_component = 'x'
[]
[symmetry-v]
type = PINSFVSymmetryVelocityBC
boundary = 'bottom'
variable = superficial_vel_y
u = superficial_vel_x
v = superficial_vel_y
mu = ${mu}
momentum_component = 'y'
[]
[symmetry-p]
type = INSFVSymmetryPressureBC
boundary = 'bottom'
variable = pressure
[]
[outlet-p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = ${p_outlet}
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[fluid_props_to_mat_props]
type = GeneralFunctorFluidProps
fp = fp
pressure = 'pressure'
T_fluid = 'T_fluid'
speed = 'velocity_norm'
# To initialize with a high viscosity
mu_rampdown = 'mu_rampdown'
# For porous flow
characteristic_length = 1
porosity = 'porosity'
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
rho = ${rho}
temperature = 'T_fluid'
[]
[constants]
type = ADGenericFunctorMaterial
prop_names = 'h_cv'
prop_values = '${h_fs}'
[]
[]
[Functions]
[mu_rampdown]
type = PiecewiseLinear
x = '1 2 3 4'
y = '1e3 1e2 1e1 1'
[]
[]
[AuxKernels]
[speed]
type = ParsedAux
variable = 'velocity_norm'
coupled_variables = 'superficial_vel_x superficial_vel_y porosity'
expression = 'sqrt(superficial_vel_x*superficial_vel_x + superficial_vel_y*superficial_vel_y) / '
'porosity'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm 100 lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-12
end_time = 3.0
[]
# Some basic Postprocessors to examine the solution
[Postprocessors]
[inlet-p]
type = SideAverageValue
variable = pressure
boundary = 'left'
[]
[outlet-u]
type = SideAverageValue
variable = superficial_vel_x
boundary = 'right'
[]
[outlet-temp]
type = SideAverageValue
variable = T_fluid
boundary = 'right'
[]
[solid-temp]
type = ElementAverageValue
variable = T_solid
[]
[]
[Outputs]
exodus = true
csv = false
[]
(modules/navier_stokes/test/tests/finite_volume/ins/action/errors/2d-rc-error-action.i)
mu=1
rho=1
k=1e-3
cp=1
alpha=1
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 5
ymin = -1
ymax = 1
nx = 10
ny = 4
[]
[right]
type = ParsedSubdomainMeshGenerator
input = gen
combinatorial_geometry = 'x > 2.5'
block_id = 1
[]
[left]
type = ParsedSubdomainMeshGenerator
input = right
combinatorial_geometry = 'x < 2.5'
block_id = 2
[]
[]
[Variables]
inactive = 'vel_x vel_y pressure T_fluid scalar'
[vel_x]
type = 'INSFVVelocityVariable'
initial_condition = 1
block=1
[]
[vel_y]
type = 'INSFVVelocityVariable'
initial_condition = 1
block=1
[]
[pressure]
type = 'INSFVPressureVariable'
initial_condition = 0
block=1
[]
[T_fluid]
type = 'INSFVEnergyVariable'
initial_condition = 0
[]
[scalar]
type = MooseVariableFVReal
initial_condition = 0
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'incompressible'
porous_medium_treatment = false
add_energy_equation = true
add_scalar_equation = true
passive_scalar_names = 'scalar'
density = 'rho'
dynamic_viscosity = 'mu'
thermal_conductivity = 'k'
specific_heat = 'cp'
passive_scalar_diffusivity = 1e-3
passive_scalar_source = 0.1
initial_velocity = '1 1 0'
initial_pressure = 0.0
initial_temperature = 0.0
inlet_boundaries = 'left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_function = '1 0'
energy_inlet_types = 'fixed-temperature'
energy_inlet_function = '1'
passive_scalar_inlet_types = 'fixed-value'
passive_scalar_inlet_function = '1'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip noslip'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '0 0'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '0'
ambient_convection_alpha = 'alpha'
ambient_temperature = '100'
friction_blocks = '1; 2'
friction_types = 'darcy; darcy'
friction_coeffs = '1.0; 1.0'
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k rho mu alpha'
prop_values = '${cp} ${k} ${rho} ${mu} ${alpha}'
[]
[kappa]
type = ADGenericVectorFunctorMaterial
prop_names = 'kappa'
prop_values = '1 1 1'
[]
[]
[Postprocessors]
[temp]
type = ElementAverageValue
variable = T_fluid
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm 100 lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-12
[]
(modules/heat_transfer/test/tests/fvbcs/fv_radiative_heat_flux/test.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmax = 2
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
initial_condition = 0.5
[]
[]
[FVKernels]
[diff_left]
type = FVDiffusion
variable = u
coeff = 4
[]
[gradient_creating]
type = FVBodyForce
variable = u
[]
[]
[FVBCs]
[left]
type = FVInfiniteCylinderRadiativeBC
variable = u
boundary = 'left'
boundary_radius = 1
cylinder_radius = 12
cylinder_emissivity = 0.4
[]
[top]
type = FVInfiniteCylinderRadiativeBC
variable = u
# Test setting it separately
temperature = 'u'
boundary = 'top'
boundary_radius = 1
cylinder_radius = 12
cylinder_emissivity = 0.4
[]
[other]
type = FVDirichletBC
variable = u
boundary = 'right bottom'
value = 0
[]
[]
[Materials]
[cht]
type = ADGenericConstantMaterial
prop_names = 'htc'
prop_values = '1'
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/rotated-2d-bkt-function-porosity-mixed.i)
p_initial=1.01e5
T=273.15
# u refers to the superficial velocity
u_in=1
rho_in=1.30524
sup_mom_y_in=${fparse u_in * rho_in}
user_limiter='upwind'
friction_coeff=10
[GlobalParams]
fp = fp
two_term_boundary_expansion = true
limiter = ${user_limiter}
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
nx = 3
ymin = 0
ymax = 18
ny = 90
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
initial_condition = ${p_initial}
[]
[sup_mom_x]
type = MooseVariableFVReal
initial_condition = 1e-15
scaling = 1e-2
[]
[sup_mom_y]
type = MooseVariableFVReal
initial_condition = 1e-15
scaling = 1e-2
[]
[T_fluid]
type = MooseVariableFVReal
initial_condition = ${T}
scaling = 1e-5
[]
[]
[AuxVariables]
[vel_y]
type = MooseVariableFVReal
[]
[rho]
type = MooseVariableFVReal
[]
[eps]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[vel_y]
type = ADMaterialRealAux
variable = vel_y
property = vel_y
execute_on = 'timestep_end'
[]
[rho]
type = ADMaterialRealAux
variable = rho
property = rho
execute_on = 'timestep_end'
[]
[eps]
type = MaterialRealAux
variable = eps
property = porosity
execute_on = 'timestep_end'
[]
[]
[FVKernels]
[mass_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_dt'
variable = pressure
[]
[mass_advection]
type = PCNSFVKT
variable = pressure
eqn = "mass"
[]
[momentum_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhou_dt'
variable = sup_mom_x
[]
[momentum_advection]
type = PCNSFVKT
variable = sup_mom_x
eqn = "momentum"
momentum_component = 'x'
[]
[eps_grad]
type = PNSFVPGradEpsilon
variable = sup_mom_x
momentum_component = 'x'
epsilon_function = 'eps'
[]
[drag]
type = PCNSFVMomentumFriction
variable = sup_mom_x
momentum_component = 'x'
Darcy_name = 'cl'
momentum_name = superficial_rhou
[]
[momentum_time_y]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhov_dt'
variable = sup_mom_y
[]
[momentum_advection_y]
type = PCNSFVKT
variable = sup_mom_y
eqn = "momentum"
momentum_component = 'y'
[]
[eps_grad_y]
type = PNSFVPGradEpsilon
variable = sup_mom_y
momentum_component = 'y'
epsilon_function = 'eps'
[]
[drag_y]
type = PCNSFVMomentumFriction
variable = sup_mom_y
momentum_component = 'y'
Darcy_name = 'cl'
momentum_name = superficial_rhov
[]
[energy_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_et_dt'
variable = T_fluid
[]
[energy_advection]
type = PCNSFVKT
variable = T_fluid
eqn = "energy"
[]
[]
[FVBCs]
[rho_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = pressure
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'mass'
velocity_function_includes_rho = true
[]
[rhou_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = sup_mom_x
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'x'
velocity_function_includes_rho = true
[]
[rhov_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = sup_mom_y
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'y'
velocity_function_includes_rho = true
[]
[rho_et_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = T_fluid
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'energy'
velocity_function_includes_rho = true
[]
[rho_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = pressure
pressure = ${p_initial}
eqn = 'mass'
[]
[rhou_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = sup_mom_x
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'x'
[]
[rhov_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = sup_mom_y
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'y'
[]
[rho_et_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = T_fluid
pressure = ${p_initial}
eqn = 'energy'
[]
[wall_pressure_x]
type = PCNSFVImplicitMomentumPressureBC
momentum_component = 'x'
boundary = 'left right'
variable = sup_mom_x
[]
[wall_pressure_y]
type = PCNSFVImplicitMomentumPressureBC
momentum_component = 'y'
boundary = 'left right'
variable = sup_mom_y
[]
# Use these to help create more accurate cell centered gradients for cells adjacent to boundaries
[T_bottom]
type = FVDirichletBC
variable = T_fluid
value = ${T}
boundary = 'bottom'
[]
[sup_mom_x_bottom_and_walls]
type = FVDirichletBC
variable = sup_mom_x
value = 0
boundary = 'bottom left right'
[]
[sup_mom_y_walls]
type = FVDirichletBC
variable = sup_mom_y
value = 0
boundary = 'left right'
[]
[sup_mom_y_bottom]
type = FVDirichletBC
variable = sup_mom_y
value = ${sup_mom_y_in}
boundary = 'bottom'
[]
[p_top]
type = FVDirichletBC
variable = pressure
value = ${p_initial}
boundary = 'top'
[]
[]
[Functions]
[ud_in]
type = ParsedVectorFunction
expression_x = '0'
expression_y = '${sup_mom_y_in}'
[]
[eps]
type = ParsedFunction
expression = 'if(y < 2.8, 1,
if(y < 3.2, 1 - .5 / .4 * (y - 2.8),
if(y < 6.8, .5,
if(y < 7.2, .5 - .25 / .4 * (y - 6.8),
if(y < 10.8, .25,
if(y < 11.2, .25 + .25 / .4 * (y - 10.8),
if(y < 14.8, .5,
if(y < 15.2, .5 + .5 / .4 * (y - 14.8),
1))))))))'
[]
[]
[Materials]
[var_mat]
type = PorousMixedVarMaterial
pressure = pressure
T_fluid = T_fluid
superficial_rhou = sup_mom_x
superficial_rhov = sup_mom_y
fp = fp
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[ad_generic]
type = ADGenericConstantVectorMaterial
prop_names = 'cl'
prop_values = '${friction_coeff} ${friction_coeff} ${friction_coeff}'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = NEWTON
line_search = 'bt'
type = Transient
nl_max_its = 20
[TimeStepper]
type = IterationAdaptiveDT
dt = 5e-5
optimal_iterations = 6
growth_factor = 1.2
[]
num_steps = 10000
end_time = 500
nl_abs_tol = 1e-7
petsc_options_iname = '-pc_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu mumps'
[]
[Outputs]
[out]
type = Exodus
execute_on = 'final'
[]
checkpoint = true
[]
[Debug]
show_var_residual_norms = true
[]
(modules/porous_flow/test/tests/pressure_pulse/pressure_pulse_1d_fully_saturated_fv.i)
# Pressure pulse in 1D with 1 phase fully saturated - transient FV model
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
xmin = 0
xmax = 100
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[pp]
type = MooseVariableFVReal
initial_condition = 2E6
[]
[]
[FVKernels]
[mass0]
type = FVPorousFlowMassTimeDerivative
fluid_component = 0
variable = pp
[]
[flux]
type = FVPorousFlowAdvectiveFlux
variable = pp
gravity = '0 0 0'
fluid_component = 0
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp'
number_fluid_phases = 1
number_fluid_components = 1
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 2e9
density0 = 1000
thermal_expansion = 0
viscosity = 1e-3
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
temperature = 293
[]
[ppss]
type = ADPorousFlow1PhaseFullySaturated
porepressure = pp
[]
[massfrac]
type = ADPorousFlowMassFraction
[]
[simple_fluid]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[porosity]
type = ADPorousFlowPorosityConst
porosity = 0.1
[]
[permeability]
type = ADPorousFlowPermeabilityConst
permeability = '1E-15 0 0 0 1E-15 0 0 0 1E-15'
[]
[relperm]
type = ADPorousFlowRelativePermeabilityConst
kr = 1
phase = 0
[]
[]
[FVBCs]
[left]
type = FVPorousFlowAdvectiveFluxBC
boundary = left
porepressure_value = 3E6
variable = pp
gravity = '0 0 0'
fluid_component = 0
phase = 0
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 1E3
end_time = 1E4
[]
[Postprocessors]
[p005]
type = PointValue
variable = pp
point = '5 0 0'
execute_on = 'initial timestep_end'
[]
[p015]
type = PointValue
variable = pp
point = '15 0 0'
execute_on = 'initial timestep_end'
[]
[p025]
type = PointValue
variable = pp
point = '25 0 0'
execute_on = 'initial timestep_end'
[]
[p035]
type = PointValue
variable = pp
point = '35 0 0'
execute_on = 'initial timestep_end'
[]
[p045]
type = PointValue
variable = pp
point = '45 0 0'
execute_on = 'initial timestep_end'
[]
[p055]
type = PointValue
variable = pp
point = '55 0 0'
execute_on = 'initial timestep_end'
[]
[p065]
type = PointValue
variable = pp
point = '65 0 0'
execute_on = 'initial timestep_end'
[]
[p075]
type = PointValue
variable = pp
point = '75 0 0'
execute_on = 'initial timestep_end'
[]
[p085]
type = PointValue
variable = pp
point = '85 0 0'
execute_on = 'initial timestep_end'
[]
[p095]
type = PointValue
variable = pp
point = '95 0 0'
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
file_base = pressure_pulse_1d_fv
print_linear_residuals = false
csv = true
[]
(test/tests/auxkernels/projection_aux/2d.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 10
ny = 20
elem_type = QUAD9
[]
[ICs]
active = 'constant_elem constant_nodal'
[constant_elem]
type = ConstantIC
variable = base_elem
value = 4
[]
[constant_nodal]
type = ConstantIC
variable = base_nodal
value = 3.5
[]
[linear_elem]
type = FunctionIC
variable = base_elem
function = 2+2*x-y
[]
[linear_nodal]
type = FunctionIC
variable = base_nodal
function = 3+3*x-y
[]
[cubic_elem]
type = FunctionIC
variable = base_elem
function = 2+2*x*x-3*y*y*y
[]
[cubic_nodal]
type = FunctionIC
variable = base_nodal
function = 3+3*x*x-4*y*y*y
[]
[]
[AuxVariables]
# Families:
# LAGRANGE, MONOMIAL, HERMITE, SCALAR, HIERARCHIC, CLOUGH, XYZ, SZABAB, BERNSTEIN,
# L2_LAGRANGE, L2_HIERARCHIC, RATIONAL_BERNSTEIN, SIDE_HIERARCHIC
# Notes:
# - 'elemental': MONOMIAL, XYZ, L2_LAGRANGE, L2_HIERARCHIC
# - 'nodal': LAGRANGE, HERMITE, HIERARCHIC, CLOUGH, SZABAB, BERNSTEIN, RATIONAL_BERNSTEIN
# - Clough, rational Berstein cannot be created in 2D QUAD9
# - Hermite cannot be created on 2D Tri6
# - Clough, Szabab, Hermite, hierarchic, L2_lagrange, L2_hierarchic, Bernstein cannot be created as constant
[base_elem]
family = MONOMIAL
order = CONSTANT
[]
[base_nodal]
[]
[test_elem_lagrange]
[]
[test_elem_lagrange_high]
order = SECOND
[]
[test_elem_mono]
family = MONOMIAL
order = CONSTANT
[]
[test_elem_mono_high]
family = MONOMIAL
order = SECOND
[]
[test_elem_fv]
type = MooseVariableFVReal
[]
[test_elem_hierarchic]
family = HIERARCHIC
order = FIRST
[]
[test_elem_xyz]
family = XYZ
order = CONSTANT
[]
[test_elem_xyz_high]
family = XYZ
order = SECOND
[]
[test_elem_szabab]
family = SZABAB
order = FIRST
[]
[test_elem_bernstein]
family = BERNSTEIN
order = FIRST
[]
[test_elem_l2_lagrange]
family = L2_LAGRANGE
order = FIRST
[]
[test_elem_l2_lagrange_high]
family = L2_LAGRANGE
order = SECOND
[]
[test_elem_l2_hierarchic]
family = L2_HIERARCHIC
order = FIRST
[]
[test_elem_l2_hierarchic_high]
family = L2_HIERARCHIC
order = SECOND
[]
[test_nodal_lagrange]
[]
[test_nodal_lagrange_high]
order = SECOND
[]
[test_nodal_mono]
family = MONOMIAL
order = CONSTANT
[]
[test_nodal_mono_high]
family = MONOMIAL
order = SECOND
[]
[test_nodal_fv]
type = MooseVariableFVReal
[]
[test_nodal_hierarchic]
family = HIERARCHIC
order = FIRST
[]
[test_nodal_xyz]
family = XYZ
order = CONSTANT
[]
[test_nodal_xyz_high]
family = XYZ
order = SECOND
[]
[test_nodal_szabab]
family = SZABAB
order = FIRST
[]
[test_nodal_bernstein]
family = BERNSTEIN
order = FIRST
[]
[test_nodal_l2_lagrange]
family = L2_LAGRANGE
order = FIRST
[]
[test_nodal_l2_lagrange_high]
family = L2_LAGRANGE
order = SECOND
[]
[test_nodal_l2_hierarchic]
family = L2_HIERARCHIC
order = FIRST
[]
[test_nodal_l2_hierarchic_high]
family = L2_HIERARCHIC
order = SECOND
[]
[]
[AuxKernels]
# Project from constant monomial
[base_elem_proj_lagrange]
type = ProjectionAux
variable = test_elem_lagrange
v = base_elem
[]
[base_elem_proj_lagrange_high]
type = ProjectionAux
variable = test_elem_lagrange_high
v = base_elem
[]
[base_elem_proj_mono]
type = ProjectionAux
variable = test_elem_mono
v = base_elem
[]
[base_elem_proj_mono_high]
type = ProjectionAux
variable = test_elem_mono_high
v = base_elem
[]
[base_elem_proj_fv]
type = ProjectionAux
variable = test_elem_fv
v = base_elem
[]
[base_elem_proj_hierarchic]
type = ProjectionAux
variable = test_elem_hierarchic
v = base_elem
[]
[base_elem_proj_xyz]
type = ProjectionAux
variable = test_elem_xyz
v = base_elem
[]
[base_elem_proj_xyz_high]
type = ProjectionAux
variable = test_elem_xyz_high
v = base_elem
[]
[base_elem_proj_szabab]
type = ProjectionAux
variable = test_elem_szabab
v = base_elem
[]
[base_elem_proj_bernstein]
type = ProjectionAux
variable = test_elem_bernstein
v = base_elem
[]
[base_elem_proj_l2_lagrange]
type = ProjectionAux
variable = test_elem_l2_lagrange
v = base_elem
[]
[base_elem_proj_l2_lagrange_high]
type = ProjectionAux
variable = test_elem_l2_lagrange_high
v = base_elem
[]
[base_elem_proj_l2_hierarchic]
type = ProjectionAux
variable = test_elem_l2_hierarchic
v = base_elem
[]
[base_elem_proj_l2_hierarchic_high]
type = ProjectionAux
variable = test_elem_l2_hierarchic_high
v = base_elem
[]
# Project from constant nodal
[base_nodal_proj_lagrange]
type = ProjectionAux
variable = test_nodal_lagrange
v = base_nodal
[]
[base_nodal_proj_lagrange_high]
type = ProjectionAux
variable = test_nodal_lagrange_high
v = base_nodal
[]
[base_nodal_proj_mono]
type = ProjectionAux
variable = test_nodal_mono
v = base_nodal
[]
[base_nodal_proj_mono_high]
type = ProjectionAux
variable = test_nodal_mono_high
v = base_nodal
[]
[base_nodal_proj_fv]
type = ProjectionAux
variable = test_nodal_fv
v = base_nodal
[]
[base_nodal_proj_hierarchic]
type = ProjectionAux
variable = test_nodal_hierarchic
v = base_nodal
[]
[base_nodal_proj_xyz]
type = ProjectionAux
variable = test_nodal_xyz
v = base_nodal
[]
[base_nodal_proj_xyz_high]
type = ProjectionAux
variable = test_nodal_xyz_high
v = base_nodal
[]
[base_nodal_proj_szabab]
type = ProjectionAux
variable = test_nodal_szabab
v = base_nodal
[]
[base_nodal_proj_bernstein]
type = ProjectionAux
variable = test_nodal_bernstein
v = base_nodal
[]
[base_nodal_proj_l2_lagrange]
type = ProjectionAux
variable = test_nodal_l2_lagrange
v = base_nodal
[]
[base_nodal_proj_l2_lagrange_high]
type = ProjectionAux
variable = test_nodal_l2_lagrange_high
v = base_nodal
[]
[base_nodal_proj_l2_hierarchic]
type = ProjectionAux
variable = test_nodal_l2_hierarchic
v = base_nodal
[]
[base_nodal_proj_l2_hierarchic_high]
type = ProjectionAux
variable = test_nodal_l2_hierarchic_high
v = base_nodal
[]
[]
[Postprocessors]
[base_elem_proj_lagrange]
type = ElementL2Difference
variable = test_elem_lagrange
other_variable = base_elem
[]
[base_elem_proj_lagrange_high]
type = ElementL2Difference
variable = test_elem_lagrange_high
other_variable = base_elem
[]
[base_elem_proj_mono]
type = ElementL2Difference
variable = test_elem_mono
other_variable = base_elem
[]
[base_elem_proj_mono_high]
type = ElementL2Difference
variable = test_elem_mono_high
other_variable = base_elem
[]
[base_elem_proj_fv]
type = ElementL2Difference
variable = test_elem_fv
other_variable = base_elem
[]
[base_elem_proj_hierarchic]
type = ElementL2Difference
variable = test_elem_hierarchic
other_variable = base_elem
[]
[base_elem_proj_xyz]
type = ElementL2Difference
variable = test_elem_xyz
other_variable = base_elem
[]
[base_elem_proj_xyz_high]
type = ElementL2Difference
variable = test_elem_xyz_high
other_variable = base_elem
[]
[base_elem_proj_szabab]
type = ElementL2Difference
variable = test_elem_szabab
other_variable = base_elem
[]
[base_elem_proj_bernstein]
type = ElementL2Difference
variable = test_elem_bernstein
other_variable = base_elem
[]
[base_elem_proj_l2_lagrange]
type = ElementL2Difference
variable = test_elem_l2_lagrange
other_variable = base_elem
[]
[base_elem_proj_l2_lagrange_high]
type = ElementL2Difference
variable = test_elem_l2_lagrange_high
other_variable = base_elem
[]
[base_elem_proj_l2_hierarchic]
type = ElementL2Difference
variable = test_elem_l2_hierarchic
other_variable = base_elem
[]
[base_elem_proj_l2_hierarchic_high]
type = ElementL2Difference
variable = test_elem_l2_hierarchic_high
other_variable = base_elem
[]
[base_nodal_proj_lagrange]
type = ElementL2Difference
variable = test_nodal_lagrange
other_variable = base_nodal
[]
[base_nodal_proj_lagrange_high]
type = ElementL2Difference
variable = test_nodal_lagrange_high
other_variable = base_nodal
[]
[base_nodal_proj_mono]
type = ElementL2Difference
variable = test_nodal_mono
other_variable = base_nodal
[]
[base_nodal_proj_mono_high]
type = ElementL2Difference
variable = test_nodal_mono_high
other_variable = base_nodal
[]
[base_nodal_proj_fv]
type = ElementL2Difference
variable = test_nodal_fv
other_variable = base_nodal
[]
[base_nodal_proj_hierarchic]
type = ElementL2Difference
variable = test_nodal_hierarchic
other_variable = base_nodal
[]
[base_nodal_proj_xyz]
type = ElementL2Difference
variable = test_nodal_xyz
other_variable = base_nodal
[]
[base_nodal_proj_xyz_high]
type = ElementL2Difference
variable = test_nodal_xyz_high
other_variable = base_nodal
[]
[base_nodal_proj_szabab]
type = ElementL2Difference
variable = test_nodal_szabab
other_variable = base_nodal
[]
[base_nodal_proj_bernstein]
type = ElementL2Difference
variable = test_nodal_bernstein
other_variable = base_nodal
[]
[base_nodal_proj_l2_lagrange]
type = ElementL2Difference
variable = test_nodal_l2_lagrange
other_variable = base_nodal
[]
[base_nodal_proj_l2_lagrange_high]
type = ElementL2Difference
variable = test_nodal_l2_lagrange_high
other_variable = base_nodal
[]
[base_nodal_proj_l2_hierarchic]
type = ElementL2Difference
variable = test_nodal_l2_hierarchic
other_variable = base_nodal
[]
[base_nodal_proj_l2_hierarchic_high]
type = ElementL2Difference
variable = test_nodal_l2_hierarchic_high
other_variable = base_nodal
[]
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
csv = true
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
(modules/heat_transfer/test/tests/fvbcs/fv_thermal_resistance/test_functor.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmax = 2
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
initial_condition = 0.5
[]
[]
[FVKernels]
[diff_left]
type = FVDiffusion
variable = u
coeff = 4
[]
[gradient_creating]
type = FVBodyForce
variable = u
[]
[]
[FVBCs]
[left]
type = FunctorThermalResistanceBC
geometry = 'cartesian'
variable = u
T_ambient = 10
htc = 'htc'
emissivity = 0.2
thermal_conductivities = '0.1 0.2 0.3'
conduction_thicknesses = '1 0.7 0.2'
boundary = 'left'
# Test setting iteration parameters
step_size = 0.02
max_iterations = 120
tolerance = 1e-4
[]
[top]
type = FunctorThermalResistanceBC
geometry = 'cartesian'
variable = u
# Test setting the temperature separately from the variable
temperature = 'u'
T_ambient = 14
htc = 'htc'
emissivity = 0
thermal_conductivities = '0.1 0.2 0.3'
conduction_thicknesses = '1 0.7 0.4'
boundary = 'top'
[]
[other]
type = FVDirichletBC
variable = u
boundary = 'right bottom'
value = 0
[]
[]
[Materials]
[cht]
type = ADGenericFunctorMaterial
prop_names = 'htc'
prop_values = '1'
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/segregated/2d-momentum.i)
mu = 1.1
rho = 1.1
pressure_tag = "pressure_grad"
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 5
ymin = 0
ymax = 1
nx = 40
ny = 6
[]
[]
[GlobalParams]
advected_interp_method = 'average'
velocity_interp_method = 'rc'
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = PINSFVRhieChowInterpolatorSegregated
u = superficial_vel_x
v = superficial_vel_y
pressure = pressure
porosity = porosity
[]
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[Variables]
[superficial_vel_x]
type = PINSFVSuperficialVelocityVariable
initial_condition = 1
solver_sys = u_system
two_term_boundary_expansion = false
[]
[superficial_vel_y]
type = PINSFVSuperficialVelocityVariable
initial_condition = 1e-6
solver_sys = v_system
two_term_boundary_expansion = false
[]
[pressure]
type = INSFVPressureVariable
two_term_boundary_expansion = false
solver_sys = pressure_system
[]
[]
[AuxVariables]
[porosity]
type = MooseVariableFVReal
initial_condition = 0.5
[]
[]
[FVKernels]
inactive = "u_friction v_friction"
[u_advection]
type = PINSFVMomentumAdvection
variable = superficial_vel_x
rho = ${rho}
porosity = porosity
momentum_component = 'x'
[]
[u_viscosity]
type = PINSFVMomentumDiffusion
variable = superficial_vel_x
mu = ${mu}
porosity = porosity
momentum_component = 'x'
[]
[u_pressure]
type = PINSFVMomentumPressure
variable = superficial_vel_x
momentum_component = 'x'
pressure = pressure
porosity = porosity
extra_vector_tags = ${pressure_tag}
[]
[u_friction]
type = PINSFVMomentumFriction
variable = superficial_vel_x
momentum_component = 'y'
Darcy_name = 'Darcy_coefficient'
Forchheimer_name = 'Forchheimer_coefficient'
rho = ${rho}
speed = speed
mu = ${mu}
[]
[v_advection]
type = PINSFVMomentumAdvection
variable = superficial_vel_y
rho = ${rho}
porosity = porosity
momentum_component = 'y'
[]
[v_viscosity]
type = PINSFVMomentumDiffusion
variable = superficial_vel_y
mu = ${mu}
porosity = porosity
momentum_component = 'y'
[]
[v_pressure]
type = PINSFVMomentumPressure
variable = superficial_vel_y
momentum_component = 'y'
pressure = pressure
porosity = porosity
extra_vector_tags = ${pressure_tag}
[]
[v_friction]
type = PINSFVMomentumFriction
variable = superficial_vel_y
momentum_component = 'y'
Darcy_name = 'Darcy_coefficient'
Forchheimer_name = 'Forchheimer_coefficient'
rho = ${rho}
speed = speed
mu = ${mu}
[]
[p_diffusion]
type = FVAnisotropicDiffusion
variable = pressure
coeff = "Ainv"
coeff_interp_method = 'average'
[]
[p_source]
type = FVDivergence
variable = pressure
vector_field = "HbyA"
force_boundary_execution = true
[]
[]
[FVBCs]
inactive = 'slip-u slip-v'
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = superficial_vel_x
function = '1'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = superficial_vel_y
function = 0
[]
[no-slip-u]
type = INSFVNoSlipWallBC
boundary = 'top'
variable = superficial_vel_x
function = 0
[]
[no-slip-v]
type = INSFVNoSlipWallBC
boundary = 'top'
variable = superficial_vel_y
function = 0
[]
[symmetry-u]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = superficial_vel_x
u = superficial_vel_x
v = superficial_vel_y
mu = ${mu}
momentum_component = 'x'
[]
[symmetry-v]
type = PINSFVSymmetryVelocityBC
boundary = 'bottom'
variable = superficial_vel_y
u = superficial_vel_x
v = superficial_vel_y
mu = ${mu}
momentum_component = 'y'
[]
[symmetry-p]
type = INSFVSymmetryPressureBC
boundary = 'bottom'
variable = pressure
[]
[outlet-p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = 0.4
[]
### Are disabled by default but we switch it on for certain tests ###
[slip-u]
type = INSFVNaturalFreeSlipBC
boundary = 'top'
variable = superficial_vel_x
momentum_component = 'x'
[]
[slip-v]
type = INSFVNaturalFreeSlipBC
boundary = 'top'
variable = superficial_vel_y
momentum_component = 'y'
[]
#####################################################################
[]
[FunctorMaterials]
[darcy]
type = ADGenericVectorFunctorMaterial
prop_names = 'Darcy_coefficient Forchheimer_coefficient'
prop_values = '0.01 0.02 0.03 0.01 0.02 0.03'
[]
[speed]
type = PINSFVSpeedFunctorMaterial
superficial_vel_x = superficial_vel_x
superficial_vel_y = superficial_vel_y
porosity = porosity
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
momentum_l_tol = 0
pressure_l_tol = 0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.85
pressure_variable_relaxation = 0.45
num_iterations = 150
pressure_absolute_tolerance = 1e-13
momentum_absolute_tolerance = 1e-13
print_fields = false
[]
[Outputs]
exodus = true
[]
(test/tests/fvkernels/mms/advective-outflow/limited-advection.i)
a=1.1
[Mesh]
[./gen_mesh]
type = GeneratedMeshGenerator
dim = 1
xmin = 0.1
xmax = 1.1
nx = 2
[../]
[]
[ICs]
[u]
type = FunctionIC
variable = u
function = exact
[]
[]
[Variables]
[./u]
two_term_boundary_expansion = true
type = MooseVariableFVReal
[../]
[]
[FVKernels]
[./advection_u]
type = FVLimitedAdvection
variable = u
velocity = '${a} 0 0'
boundaries_to_force = 'right'
limiter = 'vanLeer'
[../]
[body_u]
type = FVBodyForce
variable = u
function = 'forcing'
[]
[]
[FVBCs]
[left_u]
type = FVFunctionNeumannBC
boundary = 'left'
function = 'advection'
variable = u
[]
[]
[Functions]
[exact]
type = ParsedFunction
expression = 'cos(x)'
[]
[advection]
type = ParsedFunction
expression = '${a} * cos(x)'
[]
[forcing]
type = ParsedFunction
expression = '-${a} * sin(x)'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
nl_abs_tol = 1e-13
[]
[Outputs]
exodus = true
csv = true
[]
[Postprocessors]
[./L2u]
type = ElementL2Error
variable = u
function = exact
outputs = 'console csv'
execute_on = 'timestep_end'
[../]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(test/tests/misc/multiple-nl-systems/test-fv.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 20
[]
[Problem]
nl_sys_names = 'u v'
error_on_jacobian_nonzero_reallocation = true
[]
[Variables]
[u]
type = MooseVariableFVReal
solver_sys = 'u'
[]
[v]
type = MooseVariableFVReal
solver_sys = 'v'
[]
[]
[FVKernels]
[diff_u]
type = FVDiffusion
variable = u
coeff = 1.0
[]
[diff_v]
type = FVDiffusion
variable = v
coeff = 1.0
[]
[force]
type = FVCoupledForce
variable = v
v = u
[]
[]
[FVBCs]
[left_u]
type = FVDirichletBC
variable = u
boundary = left
value = 0
[]
[right_u]
type = FVDirichletBC
variable = u
boundary = right
value = 1
[]
[left_v]
type = FVDirichletBC
variable = v
boundary = left
value = 0
[]
[right_v]
type = FVDirichletBC
variable = v
boundary = right
value = 1
[]
[]
[Executioner]
type = SteadySolve2
solve_type = 'NEWTON'
petsc_options = '-snes_monitor'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
first_nl_sys_to_solve = 'u'
second_nl_sys_to_solve = 'v'
[]
[Functions]
[exact]
type = ParsedFunction
value = '-1/6*x*x*x +7/6*x'
[]
[]
[Postprocessors]
[error]
type = ElementL2Error
function = exact
variable = v
execute_on = FINAL
outputs = 'csv'
[]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = FINAL
[]
[]
[Outputs]
print_nonlinear_residuals = false
print_linear_residuals = false
exodus = true
[csv]
type = CSV
execute_on = 'FINAL'
[]
[]
(test/tests/auxkernels/nodal_aux_var/multi_update_fv_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 2
ny = 2
[]
[Variables]
[u]
order = FIRST
family = LAGRANGE
[]
[]
[AuxVariables]
[tt]
type = MooseVariableFVReal
initial_condition = 0
[]
[ten]
type = MooseVariableFVReal
initial_condition = 1
[]
[2k]
type = MooseVariableFVReal
initial_condition = 2
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[]
[AuxKernels]
[all]
variable = tt
type = MultipleUpdateAux
u = u
var1 = ten
var2 = 2k
[]
[]
[BCs]
active = 'left right'
[left]
type = DirichletBC
variable = u
boundary = 1
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = 3
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[Quadrature]
order = CONSTANT
[]
[]
[Outputs]
file_base = out_multi_var_fv
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/basic-primitive-pcnsfv-kt.i)
[GlobalParams]
fp = fp
limiter = 'central_difference'
two_term_boundary_expansion = true
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = .1
xmax = .6
nx = 2
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
[]
[sup_vel_x]
type = MooseVariableFVReal
[]
[T_fluid]
type = MooseVariableFVReal
[]
[]
[ICs]
[pressure]
type = FunctionIC
variable = pressure
function = 'exact_p'
[]
[sup_vel_x]
type = FunctionIC
variable = sup_vel_x
function = 'exact_sup_vel_x'
[]
[T_fluid]
type = FunctionIC
variable = T_fluid
function = 'exact_T'
[]
[]
[FVKernels]
[mass_advection]
type = PCNSFVKT
variable = pressure
eqn = "mass"
[]
[mass_fn]
type = FVBodyForce
variable = pressure
function = 'forcing_rho'
[]
[momentum_x_advection]
type = PCNSFVKT
variable = sup_vel_x
momentum_component = x
eqn = "momentum"
[]
[momentum_fn]
type = FVBodyForce
variable = sup_vel_x
function = 'forcing_rho_ud'
[]
[fluid_energy_advection]
type = PCNSFVKT
variable = T_fluid
eqn = "energy"
[]
[energy_fn]
type = FVBodyForce
variable = T_fluid
function = 'forcing_rho_et'
[]
[]
[FVBCs]
[mass_left]
variable = pressure
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'mass'
[]
[momentum_left]
variable = sup_vel_x
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'momentum'
momentum_component = 'x'
[]
[energy_left]
variable = T_fluid
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'energy'
[]
[mass_right]
variable = pressure
type = PCNSFVStrongBC
boundary = right
eqn = 'mass'
pressure = 'exact_p'
[]
[momentum_right]
variable = sup_vel_x
type = PCNSFVStrongBC
boundary = right
eqn = 'momentum'
momentum_component = 'x'
pressure = 'exact_p'
[]
[energy_right]
variable = T_fluid
type = PCNSFVStrongBC
boundary = right
eqn = 'energy'
pressure = 'exact_p'
[]
# help gradient reconstruction
[pressure_right]
type = FVFunctionDirichletBC
variable = pressure
function = exact_p
boundary = 'right'
[]
[sup_vel_x_left]
type = FVFunctionDirichletBC
variable = sup_vel_x
function = exact_sup_vel_x
boundary = 'left'
[]
[T_fluid_left]
type = FVFunctionDirichletBC
variable = T_fluid
function = exact_T
boundary = 'left'
[]
[]
[Materials]
[var_mat]
type = PorousPrimitiveVarMaterial
pressure = pressure
superficial_vel_x = sup_vel_x
T_fluid = T_fluid
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[]
[Functions]
[exact_rho]
type = ParsedFunction
expression = '3.48788261470924*cos(x)'
[]
[forcing_rho]
type = ParsedFunction
expression = '-3.45300378856215*sin(1.1*x)'
[]
[exact_rho_ud]
type = ParsedFunction
expression = '3.13909435323832*cos(1.1*x)'
[]
[forcing_rho_ud]
type = ParsedFunction
expression = '-0.9*(10.6975765229419*cos(1.2*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + 0.9*(10.6975765229419*sin(x)*cos(1.2*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 12.8370918275302*sin(1.2*x)/cos(x))*cos(x) + 3.13909435323832*sin(x)*cos(1.1*x)^2/cos(x)^2 - 6.9060075771243*sin(1.1*x)*cos(1.1*x)/cos(x)'
[]
[exact_rho_et]
type = ParsedFunction
expression = '26.7439413073546*cos(1.2*x)'
[]
[forcing_rho_et]
type = ParsedFunction
expression = '0.9*(3.48788261470924*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.2*x))*sin(x)*cos(1.1*x)/cos(x)^2 - 0.99*(3.48788261470924*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.2*x))*sin(1.1*x)/cos(x) + 0.9*(-(10.6975765229419*cos(1.2*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + (10.6975765229419*sin(x)*cos(1.2*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 12.8370918275302*sin(1.2*x)/cos(x))*cos(x) - 32.0927295688256*sin(1.2*x))*cos(1.1*x)/cos(x)'
[]
[exact_T]
type = ParsedFunction
expression = '0.0106975765229418*cos(1.2*x)/cos(x) - 0.000697576522941848*cos(1.1*x)^2/cos(x)^2'
[]
[exact_eps_p]
type = ParsedFunction
expression = '3.13909435323832*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)'
[]
[exact_p]
type = ParsedFunction
expression = '3.48788261470924*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)'
[]
[exact_sup_vel_x]
type = ParsedFunction
expression = '0.9*cos(1.1*x)/cos(x)'
[]
[exact_superficial_velocity]
type = ParsedVectorFunction
expression_x = '0.9*cos(1.1*x)/cos(x)'
[]
[eps]
type = ParsedFunction
expression = '0.9'
[]
[]
[Executioner]
solve_type = NEWTON
type = Transient
num_steps = 1
dtmin = 1
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_max_its = 50
line_search = bt
nl_rel_tol = 1e-12
nl_abs_tol = 1e-12
[]
[Outputs]
exodus = true
csv = true
[]
[Debug]
show_var_residual_norms = true
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2pressure]
type = ElementL2Error
variable = pressure
function = exact_p
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2sup_vel_x]
variable = sup_vel_x
function = exact_sup_vel_x
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2T_fluid]
variable = T_fluid
function = exact_T
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(test/tests/fvbcs/fv_functor_dirichlet/fv_other_side.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '1 2'
dy = '1.3'
ix = '5 10'
iy = '3'
subdomain_id = '0 1'
[]
[mid]
type = SideSetsBetweenSubdomainsGenerator
input = 'cmg'
primary_block = '0'
paired_block = '1'
new_boundary = 'mid'
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
block = 0
[]
[v]
type = MooseVariableFVReal
block = 1
[]
[]
[FVKernels]
[diffu]
type = FVDiffusion
variable = u
coeff = 1
[]
[diffv]
type = FVDiffusion
variable = v
coeff = 2
block = 1
[]
[source]
type = FVBodyForce
variable = v
value = 1
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = u
boundary = left
value = 4
[]
[mid]
type = FVADFunctorDirichletBC
variable = u
functor = v
functor_only_defined_on_other_side = true
ghost_layers = 3
boundary = mid
[]
[right]
type = FVDirichletBC
variable = v
boundary = right
value = 0.5
[]
[]
[Executioner]
type = Steady
solve_type = 'Newton'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_abs_tol = 1e-12
[]
[VectorPostprocessors]
[u_sample]
type = LineValueSampler
variable = 'u'
start_point = '0.01 0.3 0'
end_point = '0.99 0.3 0'
num_points = 4
sort_by = x
[]
[v_sample]
type = LineValueSampler
variable = 'v'
start_point = '1.01 0.3 0'
end_point = '1.99 0.3 0'
num_points = 4
sort_by = x
[]
[]
[Outputs]
exodus = true
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/lid-driven-turb-no-wall.i)
##########################################################
# Lid-driven cavity test
# Reynolds: 5,000
# Author: Dr. Mauricio Tano
# Last Update: Novomber, 2023
# Turbulent model using:
# k-epsilon model
# No wall functions
# SIMPLE Solve
##########################################################
### Thermophsyical Properties ###
mu = 2e-5
rho = 1.0
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epslilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Modeling parameters ###
non_equilibrium_treatment = false
bulk_wall_treatment = false
walls = ''
max_mixing_length = 1e10
linearized_yplus_mu_t = false
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
pressure_tag = "pressure_grad"
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolatorSegregated
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 0.0
solver_sys = u_system
two_term_boundary_expansion = false
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 0.0
solver_sys = v_system
two_term_boundary_expansion = false
[]
[pressure]
type = INSFVPressureVariable
solver_sys = pressure_system
initial_condition = 0.2
two_term_boundary_expansion = false
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
[]
[]
[FVKernels]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = true
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = true
u = vel_x
v = vel_y
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[p_diffusion]
type = FVAnisotropicDiffusion
variable = pressure
coeff = "Ainv"
coeff_interp_method = 'average'
[]
[p_source]
type = FVDivergence
variable = pressure
vector_field = "HbyA"
force_boundary_execution = true
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
non_equilibrium_treatment = ${non_equilibrium_treatment}
max_mixing_length = ${max_mixing_length}
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
k = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
non_equilibrium_treatment = ${non_equilibrium_treatment}
max_mixing_length = ${max_mixing_length}
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${lid_velocity}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = 'left right top bottom'
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
wall_treatment = ${wall_treatment}
[]
[walls_TKED]
type = INSFVTKEDWallFunctionBC
boundary = 'left right top bottom'
variable = TKED
u = vel_x
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
[]
[walls_TKE]
type = FVDirichletBC
boundary = 'left right top bottom'
variable = TKE
value = ${k_init}
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
k = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
linearized_yplus = ${linearized_yplus_mu_t}
non_equilibrium_treatment = ${non_equilibrium_treatment}
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKED_system TKE_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.5
turbulence_equation_relaxation = '0.9 0.9'
num_iterations = 1000
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
[]
[Outputs]
exodus = true
csv = false
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/lid-driven-turb-energy-wall.i)
##########################################################
# Lid-driven cavity test
# Reynolds: 5,000
# Author: Dr. Mauricio Tano
# Last Update: Novomber, 2023
# Turbulent model using:
# k-epsilon model
# Standard wall functions with temperature wall functions
# SIMPLE Solve
##########################################################
### Thermophsyical Properties ###
mu = 2e-5
rho = 1.0
k = 0.01
cp = 10.0
Pr_t = 0.9
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epslilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Modeling parameters ###
non_equilibrium_treatment = false
bulk_wall_treatment = false
walls = 'left top right bottom'
max_mixing_length = 1e10
linearized_yplus_mu_t = false
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
pressure_tag = "pressure_grad"
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system energy_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolatorSegregated
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 0.0
solver_sys = u_system
two_term_boundary_expansion = false
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 0.0
solver_sys = v_system
two_term_boundary_expansion = false
[]
[pressure]
type = INSFVPressureVariable
solver_sys = pressure_system
initial_condition = 0.2
two_term_boundary_expansion = false
[]
[T_fluid]
type = INSFVEnergyVariable
solver_sys = energy_system
initial_condition = 1.0
two_term_boundary_expansion = false
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
[]
[]
[FVKernels]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = true
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = true
u = vel_x
v = vel_y
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[p_diffusion]
type = FVAnisotropicDiffusion
variable = pressure
coeff = "Ainv"
coeff_interp_method = 'average'
[]
[p_source]
type = FVDivergence
variable = pressure
vector_field = "HbyA"
force_boundary_execution = true
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T_fluid
[]
[temp_conduction]
type = FVDiffusion
coeff = ${k}
variable = T_fluid
[]
[temp_turb_conduction]
type = FVDiffusion
coeff = 'k_t'
variable = T_fluid
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
non_equilibrium_treatment = ${non_equilibrium_treatment}
max_mixing_length = ${max_mixing_length}
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
k = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
non_equilibrium_treatment = ${non_equilibrium_treatment}
max_mixing_length = ${max_mixing_length}
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${lid_velocity}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[T_hot]
type = INSFVTurbulentTemperatureWallFunction
variable = T_fluid
boundary = 'top'
T_w = 1
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
cp = ${cp}
kappa = ${k}
[]
[T_cold]
type = INSFVTurbulentTemperatureWallFunction
variable = T_fluid
boundary = 'bottom'
T_w = 0
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
cp = ${cp}
kappa = ${k}
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = 'left right top bottom'
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[k_t]
type = MooseVariableFVReal
initial_condition = 1.0
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
k = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
linearized_yplus = ${linearized_yplus_mu_t}
non_equilibrium_treatment = ${non_equilibrium_treatment}
execute_on = 'NONLINEAR'
[]
[compute_k_t]
type = TurbulentConductivityAux
variable = k_t
Pr_t = ${Pr_t}
cp = ${cp}
mu_t = 'mu_t'
execute_on = 'NONLINEAR'
[]
[]
[Materials]
[ins_fv]
type = INSFVEnthalpyMaterial
temperature = 'T_fluid'
rho = ${rho}
cp = ${cp}
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
energy_system = 'energy_system'
turbulence_systems = 'TKED_system TKE_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.5
energy_equation_relaxation = 0.9
turbulence_equation_relaxation = '0.8 0.8'
num_iterations = 500
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
energy_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
energy_petsc_options_iname = '-pc_type -pc_hypre_type'
energy_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-14
energy_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
energy_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
[]
[Outputs]
exodus = true
csv = false
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
(test/tests/fvkernels/mms/non-orthogonal/advection-diffusion-reaction.i)
a=1.1
diff=1.1
[Mesh]
[./gen_mesh]
type = GeneratedMeshGenerator
dim = 2
xmin = 2
xmax = 3
ymin = 0
ymax = 1
nx = 2
ny = 2
elem_type = TRI3
[../]
[]
[Variables]
[v]
type = MooseVariableFVReal
initial_condition = 1
[]
[]
[FVKernels]
[advection]
type = FVAdvection
variable = v
velocity = '${a} ${fparse 2*a} 0'
advected_interp_method = 'average'
[]
[reaction]
type = FVReaction
variable = v
[]
[diff_v]
type = FVDiffusion
variable = v
coeff = ${diff}
[]
[body_v]
type = FVBodyForce
variable = v
function = 'forcing'
[]
[]
[FVBCs]
[exact]
type = FVFunctionDirichletBC
boundary = 'left right top bottom'
function = 'exact'
variable = v
[]
[]
[Functions]
[exact]
type = ParsedFunction
expression = 'sin(x)*cos(y)'
[]
[forcing]
type = ParsedFunction
expression = '-2*a*sin(x)*sin(y) + a*cos(x)*cos(y) + 2*diff*sin(x)*cos(y) + sin(x)*cos(y)'
symbol_names = 'a diff'
symbol_values = '${a} ${diff}'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
csv = true
[]
[Postprocessors]
[error]
type = ElementL2Error
variable = v
function = exact
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(test/tests/fviks/diffusion/multisystem.i)
[Mesh]
[gmg]
type = CartesianMeshGenerator
dim = 1
ix = '50 50'
dx = '1 1'
subdomain_id = '0 1'
[]
[sds]
type = SideSetsBetweenSubdomainsGenerator
input = gmg
new_boundary = 'between'
paired_block = '1'
primary_block = '0'
[]
[]
[Problem]
nl_sys_names = 'u v'
error_on_jacobian_nonzero_reallocation = true
[]
[Variables]
[u]
type = MooseVariableFVReal
solver_sys = 'u'
block = 0
[]
[v]
type = MooseVariableFVReal
solver_sys = 'v'
block = 1
[]
[]
[FVKernels]
[diff_u]
type = FVDiffusion
variable = u
coeff = 3.0
[]
[force_u]
type = FVBodyForce
variable = u
function = 5
[]
[diff_v]
type = FVDiffusion
variable = v
coeff = 1.0
[]
[force_v]
type = FVBodyForce
variable = v
function = 5
[]
[]
[FVInterfaceKernels]
[diff_ik]
type = FVDiffusionInterface
variable1 = u
variable2 = v
boundary = 'between'
coeff1 = 3
coeff2 = 1
subdomain1 = 0
subdomain2 = 1
[]
[diff_ik_v]
type = FVDiffusionInterface
variable1 = v
variable2 = u
boundary = 'between'
coeff1 = 1
coeff2 = 3
subdomain1 = 1
subdomain2 = 0
[]
[]
[FVBCs]
[left_u]
type = FVDirichletBC
variable = u
boundary = left
value = 0
[]
[right_v]
type = FVDirichletBC
variable = v
boundary = right
value = 1
[]
[]
[Executioner]
type = SteadySolve2
solve_type = 'NEWTON'
petsc_options = '-snes_monitor'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
first_nl_sys_to_solve = 'u'
second_nl_sys_to_solve = 'v'
number_of_iterations = 200
nl_abs_tol = 1e-10
[]
[Outputs]
print_nonlinear_residuals = false
print_linear_residuals = false
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_direct.i)
rho = 'rho'
l = 10
inlet_area = 1
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 10
ny = 5
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[scalar]
type = MooseVariableFVReal
initial_condition = 0.1
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = WCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = u
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = v
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T
rho = rho
drho_dt = drho_dt
h = h
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T
v = power_density
[]
# Scalar concentration equation
[scalar_time]
type = FVFunctorTimeKernel
variable = scalar
[]
[scalar_advection]
type = INSFVScalarFieldAdvection
variable = scalar
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_diffusion]
type = FVDiffusion
variable = scalar
coeff = 1.1
[]
[scalar_source]
type = FVBodyForce
variable = scalar
function = 2.1
[]
[]
[FVBCs]
# Inlet
[inlet_mass]
type = WCNSFVMassFluxBC
variable = pressure
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'surface_inlet'
vel_x = u
vel_y = v
rho = 'rho'
[]
[inlet_u]
type = WCNSFVMomentumFluxBC
variable = u
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'surface_inlet'
rho = 'rho'
momentum_component = 'x'
vel_x = u
vel_y = v
[]
[inlet_v]
type = WCNSFVMomentumFluxBC
variable = v
boundary = 'left'
mdot_pp = 0
area_pp = 'surface_inlet'
rho = 'rho'
momentum_component = 'y'
vel_x = u
vel_y = v
[]
[inlet_T]
type = WCNSFVEnergyFluxBC
variable = T
T_fluid = T
boundary = 'left'
energy_pp = 'inlet_Edot'
area_pp = 'surface_inlet'
vel_x = u
vel_y = v
rho = 'rho'
cp = cp
[]
[inlet_scalar]
type = WCNSFVScalarFluxBC
variable = scalar
boundary = 'left'
scalar_flux_pp = 'inlet_scalar_flux'
area_pp = 'surface_inlet'
vel_x = u
vel_y = v
rho = 'rho'
passive_scalar = scalar
[]
[outlet_p]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
[]
# Walls
[no_slip_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = v
boundary = 'top bottom'
function = 0
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_mdot]
type = Receiver
default = ${fparse 1980 * inlet_velocity * inlet_area}
[]
[surface_inlet]
type = AreaPostprocessor
boundary = 'left'
execute_on = 'INITIAL'
[]
[inlet_Edot]
type = Receiver
default = ${fparse 1980 * inlet_velocity * 2530 * inlet_temp * inlet_area}
[]
[inlet_scalar_flux]
type = Receiver
default = ${fparse inlet_velocity * 0.2 * inlet_area}
[]
[]
[FluidProperties]
[fp]
type = SimpleFluidProperties
density0 = 1980
cp = 2530
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-2
optimal_iterations = 6
[]
end_time = 1
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/channel-drift-flux.i)
mu = 1.0
rho = 10.0
mu_d = 0.1
rho_d = 1.0
l = 2
U = 1
dp = 0.01
inlet_phase_2 = 0.1
advected_interp_method = 'average'
velocity_interp_method = 'rc'
[GlobalParams]
rhie_chow_user_object = 'rc'
density_interp_method = 'average'
mu_interp_method = 'average'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = '${fparse l * 5}'
ymin = '${fparse -l / 2}'
ymax = '${fparse l / 2}'
nx = 10
ny = 4
[]
uniform_refine = 0
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 0
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 0
[]
[pressure]
type = INSFVPressureVariable
[]
[phase_2]
type = INSFVScalarFieldVariable
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = 'rho_mixture'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = 'rho_mixture'
momentum_component = 'x'
[]
[u_drift]
type = WCNSFV2PMomentumDriftFlux
variable = vel_x
rho_d = ${rho_d}
fd = 'rho_mixture_var'
u_slip = 'vel_slip_x'
v_slip = 'vel_slip_y'
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_mixture'
limit_interpolation = true
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = 'rho_mixture'
momentum_component = 'y'
[]
[v_drift]
type = WCNSFV2PMomentumDriftFlux
variable = vel_y
rho_d = ${rho_d}
fd = 'rho_mixture_var'
u_slip = 'vel_slip_x'
v_slip = 'vel_slip_y'
momentum_component = 'x'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_mixture'
limit_interpolation = true
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[phase_2_advection]
type = INSFVScalarFieldAdvection
variable = phase_2
u_slip = 'vel_slip_x'
v_slip = 'vel_slip_y'
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = 'upwind'
[]
[phase_2_src]
type = NSFVMixturePhaseInterface
variable = phase_2
phase_coupled = phase_1
alpha = 0.1
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_x
functor = '${U}'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_y
functor = '0'
[]
[walls-u]
type = INSFVNoSlipWallBC
boundary = 'top bottom'
variable = vel_x
function = 0
[]
[walls-v]
type = INSFVNoSlipWallBC
boundary = 'top bottom'
variable = vel_y
function = 0
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = '0'
[]
[inlet_phase_2]
type = FVDirichletBC
boundary = 'left'
variable = phase_2
value = ${inlet_phase_2}
[]
[]
[AuxVariables]
[drag_coefficient]
type = MooseVariableFVReal
[]
[rho_mixture_var]
type = MooseVariableFVReal
[]
[mu_mixture_var]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[populate_cd]
type = FunctorAux
variable = drag_coefficient
functor = 'Darcy_coefficient'
[]
[populate_rho_mixture_var]
type = FunctorAux
variable = rho_mixture_var
functor = 'rho_mixture'
[]
[populate_mu_mixture_var]
type = FunctorAux
variable = mu_mixture_var
functor = 'mu_mixture'
[]
[]
[FunctorMaterials]
[populate_u_slip]
type = WCNSFV2PSlipVelocityFunctorMaterial
slip_velocity_name = 'vel_slip_x'
momentum_component = 'x'
u = 'vel_x'
v = 'vel_y'
rho = ${rho}
mu = 'mu_mixture'
rho_d = ${rho_d}
particle_diameter = ${dp}
linear_coef_name = 'Darcy_coefficient'
outputs = 'out'
output_properties = 'vel_slip_x'
[]
[populate_v_slip]
type = WCNSFV2PSlipVelocityFunctorMaterial
slip_velocity_name = 'vel_slip_y'
momentum_component = 'y'
u = 'vel_x'
v = 'vel_y'
rho = ${rho}
mu = 'mu_mixture'
rho_d = ${rho_d}
particle_diameter = ${dp}
linear_coef_name = 'Darcy_coefficient'
outputs = 'out'
output_properties = 'vel_slip_y'
[]
[compute_phase_1]
type = ADParsedFunctorMaterial
property_name = phase_1
functor_names = 'phase_2'
expression = '1 - phase_2'
outputs = 'out'
output_properties = 'phase_1'
[]
[CD]
type = NSFVDispersePhaseDragFunctorMaterial
rho = 'rho_mixture'
mu = mu_mixture
u = 'vel_x'
v = 'vel_y'
particle_diameter = ${dp}
[]
[mixing_material]
type = NSFVMixtureFunctorMaterial
phase_2_names = '${rho} ${mu}'
phase_1_names = '${rho_d} ${mu_d}'
prop_names = 'rho_mixture mu_mixture'
phase_1_fraction = 'phase_2'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
nl_rel_tol = 1e-10
[]
[Preconditioning]
[SMP]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[]
[]
[Outputs]
print_linear_residuals = true
print_nonlinear_residuals = true
[out]
type = Exodus
hide = 'Re lin cum_lin'
[]
[perf]
type = PerfGraphOutput
[]
[]
[Postprocessors]
[Re]
type = ParsedPostprocessor
expression = '${rho} * ${l} * ${U}'
[]
[lin]
type = NumLinearIterations
[]
[cum_lin]
type = CumulativeValuePostprocessor
postprocessor = lin
[]
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/2d-rc-epsjump.i)
mu=1.1
rho=1.1
advected_interp_method='upwind'
velocity_interp_method='rc'
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '1 1'
dy = '0.5'
ix = '30 30'
iy = '20'
subdomain_id = '1 2'
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
porosity = porosity
[]
[UserObjects]
[rc]
type = PINSFVRhieChowInterpolator
u = u
v = v
porosity = porosity
pressure = pressure
[]
[]
[Variables]
[u]
type = PINSFVSuperficialVelocityVariable
initial_condition = 1
[]
[v]
type = PINSFVSuperficialVelocityVariable
initial_condition = 1e-6
[]
[pressure]
type = INSFVPressureVariable
[]
[]
[AuxVariables]
[porosity]
type = MooseVariableFVReal
[]
[]
[ICs]
inactive = 'porosity_continuous'
[porosity_1]
type = ConstantIC
variable = porosity
block = 1
value = 1
[]
[porosity_2]
type = ConstantIC
variable = porosity
block = 2
value = 0.5
[]
[porosity_continuous]
type = FunctionIC
variable = porosity
block = '1 2'
function = smooth_jump
[]
[]
[Functions]
[smooth_jump]
type = ParsedFunction
expression = '1 - 0.5 * 1 / (1 + exp(-30*(x-1)))'
[]
[]
[FVKernels]
[mass]
type = PINSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_advection]
type = PINSFVMomentumAdvection
variable = u
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = PINSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = PINSFVMomentumPressure
variable = u
pressure = pressure
momentum_component = 'x'
[]
[v_advection]
type = PINSFVMomentumAdvection
variable = v
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = PINSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = PINSFVMomentumPressure
variable = v
pressure = pressure
momentum_component = 'y'
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = u
function = '1'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = v
function = 0
[]
[walls-u]
type = INSFVNaturalFreeSlipBC
boundary = 'top bottom'
variable = u
momentum_component = 'x'
[]
[walls-v]
type = INSFVNaturalFreeSlipBC
boundary = 'top bottom'
variable = v
momentum_component = 'y'
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = 0.4
[]
[]
[FunctorMaterials]
inactive = 'smooth'
[jump]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = 'porosity'
subdomain_to_prop_value = '1 1
2 0.5'
[]
[smooth]
type = ADGenericFunctionFunctorMaterial
prop_names = 'porosity'
prop_values = 'smooth_jump'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-10
[]
[Postprocessors]
[inlet_p]
type = SideAverageValue
variable = 'pressure'
boundary = 'left'
[]
[outlet-u]
type = SideIntegralVariablePostprocessor
variable = u
boundary = 'right'
[]
[]
[Outputs]
exodus = true
csv = false
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/heated/2d-rc-heated-action.i)
mu = 1
rho = 1
k = 1e-3
cp = 1
u_inlet = 1
T_inlet = 200
h_cv = 1.0
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '5 5'
dy = '1.0'
ix = '50 50'
iy = '20'
subdomain_id = '1 2'
[]
[]
[Variables]
[T_solid]
type = MooseVariableFVReal
[]
[]
[AuxVariables]
[porosity]
type = MooseVariableFVReal
initial_condition = 0.5
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'incompressible'
porous_medium_treatment = true
add_energy_equation = true
density = ${rho}
dynamic_viscosity = ${mu}
thermal_conductivity = ${k}
specific_heat = ${cp}
porosity = 'porosity'
initial_velocity = '${u_inlet} 1e-6 0'
initial_pressure = 0.0
initial_temperature = 0.0
inlet_boundaries = 'left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_function = '${u_inlet} 0'
energy_inlet_types = 'heatflux'
energy_inlet_function = '${fparse u_inlet * rho * cp * T_inlet}'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip symmetry'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '0 0'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '0.1'
ambient_convection_alpha = ${h_cv}
ambient_temperature = 'T_solid'
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
energy_advection_interpolation = 'average'
[]
[]
[FVKernels]
[solid_energy_diffusion]
type = FVDiffusion
coeff = ${k}
variable = T_solid
[]
[solid_energy_convection]
type = PINSFVEnergyAmbientConvection
variable = 'T_solid'
is_solid = true
T_fluid = 'T_fluid'
T_solid = 'T_solid'
h_solid_fluid = ${h_cv}
[]
[]
[FVBCs]
[heated-side]
type = FVDirichletBC
boundary = 'top'
variable = 'T_solid'
value = 150
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-14
[]
# Some basic Postprocessors to examine the solution
[Postprocessors]
[inlet-p]
type = SideAverageValue
variable = pressure
boundary = 'left'
[]
[outlet-u]
type = SideAverageValue
variable = superficial_vel_x
boundary = 'right'
[]
[outlet-temp]
type = SideAverageValue
variable = T_fluid
boundary = 'right'
[]
[solid-temp]
type = ElementAverageValue
variable = T_solid
[]
[]
[Outputs]
exodus = true
csv = false
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_mdot-action.i)
l = 10
inlet_area = 1
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 10
ny = 5
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'weakly-compressible'
add_energy_equation = true
add_scalar_equation = true
passive_scalar_names = 'scalar'
density = 'rho'
dynamic_viscosity = 'mu'
thermal_conductivity = 'k'
specific_heat = 'cp'
passive_scalar_diffusivity = 1.1
initial_velocity = '${inlet_velocity} 1e-15 0'
initial_temperature = '${inlet_temp}'
initial_pressure = '${outlet_pressure}'
initial_scalar_variables = 0.1
inlet_boundaries = 'left'
momentum_inlet_types = 'flux-mass'
flux_inlet_pps = 'inlet_mdot'
energy_inlet_types = 'flux-mass'
energy_inlet_function = 'inlet_T'
passive_scalar_inlet_types = 'flux-mass'
passive_scalar_inlet_function = 'inlet_scalar_value'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip noslip'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '0 0'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${outlet_pressure}'
external_heat_source = 'power_density'
passive_scalar_source = 2.1
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
energy_advection_interpolation = 'average'
[]
[]
[Postprocessors]
[inlet_mdot]
type = Receiver
default = ${fparse 1980 * inlet_velocity * inlet_area}
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[inlet_scalar_value]
type = Receiver
default = 0.2
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k mu'
prop_values = '${cp} ${k} ${mu}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T_fluid
pressure = pressure
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-2
optimal_iterations = 6
[]
end_time = 1
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/fvbcs/FVFunctorHeatFluxBC/wall_heat_transfer.i)
flux=10
[GlobalParams]
porosity = 'porosity'
splitting = 'porosity'
locality = 'global'
average_porosity = 'average_eps'
average_k_fluid='average_k_fluid'
average_k_solid='average_k_solid'
average_kappa='average_k_fluid' # because of vector matprop, should be kappa
average_kappa_solid='average_kappa_solid'
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 20
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
[]
[Variables]
[Tf]
type = MooseVariableFVReal
[]
[Ts]
type = MooseVariableFVReal
[]
[]
[AuxVariables]
[k]
type = MooseVariableFVReal
[]
[kappa]
type = MooseVariableFVReal
[]
[k_s]
type = MooseVariableFVReal
[]
[kappa_s]
type = MooseVariableFVReal
[]
[porosity]
type = MooseVariableFVReal
initial_condition = 0.2
[]
[]
[Functions]
[k_function]
type = ParsedFunction
expression = 0.1*(100*y+1)
[]
[kappa_function]
type = ParsedFunction
expression = 0.2*(200*y+1)
[]
[kappa_s_function]
type = ParsedFunction
expression = 0.4*(200*y+1)
[]
[k_s_function]
type = ParsedFunction
expression = 0.2*(200*y+1)+2*x
[]
[]
[FVKernels]
[Tf_diffusion]
type = FVDiffusion
variable = Tf
coeff = 1
[]
[Ts_diffusion]
type = FVDiffusion
variable = Ts
coeff = 1
[]
[]
[FVBCs]
[left_Ts]
type = NSFVFunctorHeatFluxBC
variable = Ts
boundary = 'left'
phase = 'solid'
value = ${flux}
k = 'k_mat'
k_s = 'k_s_mat'
kappa = 'kappa_mat'
kappa_s = 'kappa_s_mat'
[]
[right_Ts]
type = FVDirichletBC
variable = Ts
boundary = 'right'
value = 1000.0
[]
[left_Tf]
type = NSFVFunctorHeatFluxBC
variable = Tf
boundary = 'left'
phase = 'fluid'
value = ${flux}
k = 'k_mat'
k_s = 'k_s_mat'
kappa = 'kappa_mat'
kappa_s = 'kappa_s_mat'
[]
[right_Tf]
type = FVDirichletBC
variable = Tf
boundary = 'right'
value = 1000.0
[]
[]
[AuxKernels]
[k]
type = FunctorAux
variable = k
functor = 'k_mat'
[]
[k_s]
type = FunctorAux
variable = k_s
functor = 'k_s_mat'
[]
[kappa_s]
type = FunctorAux
variable = kappa_s
functor = 'kappa_s_mat'
[]
[]
[FunctorMaterials]
[thermal_conductivities_k]
type = ADGenericFunctorMaterial
prop_names = 'k_mat'
prop_values = 'k_function'
[]
[thermal_conductivities_k_s]
type = ADGenericFunctorMaterial
prop_names = 'k_s_mat'
prop_values = 'k_s_function'
[]
[thermal_conductivities_kappa]
type = ADGenericVectorFunctorMaterial
prop_names = 'kappa_mat'
prop_values = '0.1 0.2 .03'
[]
[thermal_conductivities_kappa_s]
type = ADGenericFunctorMaterial
prop_names = 'kappa_s_mat'
prop_values = 'kappa_s_function'
[]
[]
[Postprocessors]
[average_eps]
type = ElementAverageValue
variable = porosity
# because porosity is constant in time, we evaluate this only once
execute_on = 'initial'
[]
[average_k_fluid]
type = ElementAverageValue
variable = k
[]
[average_k_solid]
type = ElementAverageValue
variable = k_s
[]
[average_kappa_solid]
type = ElementAverageValue
variable = kappa_s
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
hide = 'porosity average_eps'
[]
(test/tests/physics/diffusion_fv.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '1 2'
dy = '2 1'
ix = '2 3'
iy = '3 2'
subdomain_id = '0 1
1 0'
[]
[split_boundaries]
type = BreakBoundaryOnSubdomainGenerator
input = cmg
[]
allow_renumbering = false
[]
[Physics]
[Diffusion]
[FiniteVolume]
[diff]
source_functor = 2
# Test all the ways of setting the boundary conditions
neumann_boundaries = 'left_to_0 right_to_0 top_to_0 bottom_to_0'
boundary_fluxes = '1 flux_pp flux_function flux_variable'
dirichlet_boundaries = 'left_to_1 right_to_1 top_to_1 bottom_to_1'
boundary_values = '2 value_pp value_function value_variable'
[]
[]
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
num_steps = 10
# Output the setup
verbose = true
[]
# To test setting up a boundary condition with a postprocessor
[Postprocessors]
[flux_pp]
type = Receiver
default = 1
outputs = 'none'
[]
[value_pp]
type = Receiver
default = 2
outputs = 'none'
[]
[]
# To test setting up a boundary condition with a function
[Functions]
[flux_function]
type = ConstantFunction
value = 1
[]
[value_function]
type = ConstantFunction
value = 2
[]
[]
# To test setting up a boundary condition with a variable
[AuxVariables]
[flux_variable]
type = MooseVariableFVReal
initial_condition = 1
[]
[value_variable]
type = MooseVariableFVReal
initial_condition = 2
[]
[]
# Form output for testing
[VectorPostprocessors]
[sample]
type = ElementValueSampler
variable = 'u'
sort_by = 'id'
[]
[]
[Outputs]
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/varying-eps-hllc.i)
[GlobalParams]
fp = fp
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = .1
xmax = .6
nx = 2
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
[]
[sup_mom_x]
type = MooseVariableFVReal
[]
[T_fluid]
type = MooseVariableFVReal
[]
[]
[ICs]
[pressure]
type = FunctionIC
variable = pressure
function = 'exact_p'
[]
[sup_mom_x]
type = FunctionIC
variable = sup_mom_x
function = 'exact_rho_ud'
[]
[T_fluid]
type = FunctionIC
variable = T_fluid
function = 'exact_T'
[]
[]
[FVKernels]
[mass_advection]
type = PCNSFVMassHLLC
variable = pressure
[]
[mass_fn]
type = FVBodyForce
variable = pressure
function = 'forcing_rho'
[]
[momentum_x_advection]
type = PCNSFVMomentumHLLC
variable = sup_mom_x
momentum_component = x
[]
[eps_grad]
type = PNSFVPGradEpsilon
variable = sup_mom_x
momentum_component = 'x'
epsilon_function = 'eps'
[]
[momentum_fn]
type = FVBodyForce
variable = sup_mom_x
function = 'forcing_rho_ud'
[]
[fluid_energy_advection]
type = PCNSFVFluidEnergyHLLC
variable = T_fluid
[]
[energy_fn]
type = FVBodyForce
variable = T_fluid
function = 'forcing_rho_et'
[]
[]
[FVBCs]
[mass_left]
variable = pressure
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'mass'
[]
[momentum_left]
variable = sup_mom_x
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'momentum'
momentum_component = 'x'
[]
[energy_left]
variable = T_fluid
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'energy'
[]
[mass_right]
variable = pressure
type = PCNSFVStrongBC
boundary = right
eqn = 'mass'
pressure = 'exact_p'
[]
[momentum_right]
variable = sup_mom_x
type = PCNSFVStrongBC
boundary = right
eqn = 'momentum'
momentum_component = 'x'
pressure = 'exact_p'
[]
[energy_right]
variable = T_fluid
type = PCNSFVStrongBC
boundary = right
eqn = 'energy'
pressure = 'exact_p'
[]
[]
[Materials]
[var_mat]
type = PorousMixedVarMaterial
pressure = pressure
superficial_rhou = sup_mom_x
T_fluid = T_fluid
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[]
[Functions]
[exact_rho]
type = ParsedFunction
expression = '3.48788261470924*cos(x)'
[]
[forcing_rho]
type = ParsedFunction
expression = '-3.83667087618017*sin(1.1*x)*cos(1.3*x) - 4.53424739912202*sin(1.3*x)*cos(1.1*x)'
[]
[exact_rho_ud]
type = ParsedFunction
expression = '3.48788261470924*cos(1.1*x)*cos(1.3*x)'
[]
[forcing_rho_ud]
type = ParsedFunction
expression = '(-(10.6975765229419*cos(1.5*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + (10.6975765229419*sin(x)*cos(1.5*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 16.0463647844128*sin(1.5*x)/cos(x))*cos(x))*cos(1.3*x) + 3.48788261470924*sin(x)*cos(1.1*x)^2*cos(1.3*x)/cos(x)^2 - 7.67334175236034*sin(1.1*x)*cos(1.1*x)*cos(1.3*x)/cos(x) - 4.53424739912202*sin(1.3*x)*cos(1.1*x)^2/cos(x)'
[]
[exact_rho_et]
type = ParsedFunction
expression = '26.7439413073546*cos(1.5*x)'
[]
[forcing_rho_et]
type = ParsedFunction
expression = '1.0*(3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.5*x))*sin(x)*cos(1.1*x)*cos(1.3*x)/cos(x)^2 - 1.1*(3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.5*x))*sin(1.1*x)*cos(1.3*x)/cos(x) - 1.3*(3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.5*x))*sin(1.3*x)*cos(1.1*x)/cos(x) + 1.0*(-(10.6975765229419*cos(1.5*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + (10.6975765229419*sin(x)*cos(1.5*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 16.0463647844128*sin(1.5*x)/cos(x))*cos(x) - 40.1159119610319*sin(1.5*x))*cos(1.1*x)*cos(1.3*x)/cos(x)'
[]
[exact_T]
type = ParsedFunction
expression = '0.0106975765229418*cos(1.5*x)/cos(x) - 0.000697576522941848*cos(1.1*x)^2/cos(x)^2'
[]
[exact_eps_p]
type = ParsedFunction
expression = '3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)*cos(1.3*x)'
[]
[exact_p]
type = ParsedFunction
expression = '3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)'
[]
[exact_sup_vel_x]
type = ParsedFunction
expression = '1.0*cos(1.1*x)*cos(1.3*x)/cos(x)'
[]
[eps]
type = ParsedFunction
expression = 'cos(1.3*x)'
[]
[exact_superficial_velocity]
type = ParsedVectorFunction
expression_x = '1.0*cos(1.1*x)*cos(1.3*x)/cos(x)'
[]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_max_its = 50
line_search = bt
nl_rel_tol = 1e-12
nl_abs_tol = 1e-12
[]
[Outputs]
exodus = true
csv = true
[]
[Debug]
show_var_residual_norms = true
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2pressure]
type = ElementL2Error
variable = pressure
function = exact_p
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2sup_mom_x]
variable = sup_mom_x
function = exact_rho_ud
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2T_fluid]
variable = T_fluid
function = exact_T
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/channel-drift-flux-transient.i)
mu = 1.0
rho = 10.0
mu_d = 0.1
rho_d = 1.0
l = 2
U = 1
dp = 0.01
inlet_phase_2 = 0.1
advected_interp_method = 'average'
velocity_interp_method = 'rc'
[GlobalParams]
rhie_chow_user_object = 'rc'
density_interp_method = 'average'
mu_interp_method = 'average'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = '${fparse l * 5}'
ymin = '${fparse -l / 2}'
ymax = '${fparse l / 2}'
nx = 10
ny = 4
[]
uniform_refine = 0
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 0
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 0
[]
[pressure]
type = INSFVPressureVariable
[]
[phase_2]
type = INSFVScalarFieldVariable
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = 'rho_mixture'
[]
[u_time]
type = INSFVMomentumTimeDerivative
variable = vel_x
rho = 'rho_mixture'
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = 'rho_mixture'
momentum_component = 'x'
[]
[u_drift]
type = WCNSFV2PMomentumDriftFlux
variable = vel_x
rho_d = ${rho_d}
fd = 'rho_mixture_var'
u_slip = 'vel_slip_x'
v_slip = 'vel_slip_y'
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_mixture'
limit_interpolation = true
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = INSFVMomentumTimeDerivative
variable = vel_y
rho = 'rho_mixture'
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = 'rho_mixture'
momentum_component = 'y'
[]
[v_drift]
type = WCNSFV2PMomentumDriftFlux
variable = vel_y
rho_d = ${rho_d}
fd = 'rho_mixture_var'
u_slip = 'vel_slip_x'
v_slip = 'vel_slip_y'
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_mixture'
limit_interpolation = true
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[phase_2_time]
type = FVFunctorTimeKernel
variable = phase_2
functor = phase_2
[]
[phase_2_advection]
type = INSFVScalarFieldAdvection
variable = phase_2
u_slip = 'vel_x'
v_slip = 'vel_y'
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = 'upwind'
[]
[phase_2_src]
type = NSFVMixturePhaseInterface
variable = phase_2
phase_coupled = phase_1
alpha = 0.1
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_x
functor = '${U}'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_y
functor = '0'
[]
[walls-u]
type = INSFVNoSlipWallBC
boundary = 'top bottom'
variable = vel_x
function = 0
[]
[walls-v]
type = INSFVNoSlipWallBC
boundary = 'top bottom'
variable = vel_y
function = 0
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = '0'
[]
[inlet_phase_2]
type = FVDirichletBC
boundary = 'left'
variable = phase_2
value = ${inlet_phase_2}
[]
[]
[AuxVariables]
[drag_coefficient]
type = MooseVariableFVReal
[]
[rho_mixture_var]
type = MooseVariableFVReal
[]
[mu_mixture_var]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[populate_cd]
type = FunctorAux
variable = drag_coefficient
functor = 'Darcy_coefficient'
[]
[populate_rho_mixture_var]
type = FunctorAux
variable = rho_mixture_var
functor = 'rho_mixture'
[]
[populate_mu_mixture_var]
type = FunctorAux
variable = mu_mixture_var
functor = 'mu_mixture'
[]
[]
[FunctorMaterials]
[populate_u_slip]
type = WCNSFV2PSlipVelocityFunctorMaterial
slip_velocity_name = 'vel_slip_x'
momentum_component = 'x'
u = 'vel_x'
v = 'vel_y'
rho = ${rho}
mu = 'mu_mixture'
rho_d = ${rho_d}
particle_diameter = ${dp}
linear_coef_name = 'Darcy_coefficient'
[]
[populate_v_slip]
type = WCNSFV2PSlipVelocityFunctorMaterial
slip_velocity_name = 'vel_slip_y'
momentum_component = 'y'
u = 'vel_x'
v = 'vel_y'
rho = ${rho}
mu = 'mu_mixture'
rho_d = ${rho_d}
particle_diameter = ${dp}
linear_coef_name = 'Darcy_coefficient'
[]
[compute_phase_1]
type = ADParsedFunctorMaterial
property_name = phase_1
functor_names = 'phase_2'
expression = '1 - phase_2'
[]
[CD]
type = NSFVDispersePhaseDragFunctorMaterial
rho = 'rho_mixture'
mu = mu_mixture
u = 'vel_x'
v = 'vel_y'
particle_diameter = ${dp}
[]
[mixing_material]
type = NSFVMixtureFunctorMaterial
phase_2_names = '${rho} ${mu}'
phase_1_names = '${rho_d} ${mu_d}'
prop_names = 'rho_mixture mu_mixture'
phase_1_fraction = 'phase_2'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
nl_rel_tol = 1e-10
dt = 0.1
end_time = 1.0
[]
[Preconditioning]
[SMP]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[]
[]
[Outputs]
exodus = false
[CSV]
type = CSV
execute_on = 'TIMESTEP_END'
[]
[]
[Postprocessors]
[Re]
type = ParsedPostprocessor
expression = '${rho} * ${l} * ${U}'
[]
[rho_outlet]
type = SideAverageValue
boundary = 'right'
variable = 'rho_mixture_var'
[]
[]
(test/tests/materials/functor_properties/1d_dirichlet.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
xmax = 2
[]
[Variables]
[v]
type = MooseVariableFVReal
[]
[]
[AuxVariables]
[sink]
type = MooseVariableFVReal
[]
[]
[ICs]
[sink]
type = FunctionIC
variable = sink
function = 'x^3'
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = v
coeff = 1
[]
[sink]
type = FVFunctorElementalKernel
variable = v
functor_name = 'sink_mat'
[]
[]
[FVBCs]
[bounds]
type = FVDirichletBC
variable = v
boundary = 'left right'
value = 0
[]
[]
[Materials]
active = 'functor'
[functor]
type = ADGenericFunctorMaterial
prop_names = sink_mat
prop_values = sink
[]
[overlapping_functor]
type = ADGenericFunctorMaterial
prop_names = 'sink_mat'
prop_values = v
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/auxkernels/peclet-number-functor-aux/fv-thermal.i)
mu = 1
rho = 1
k = 1
cp = 1
[GlobalParams]
velocity_interp_method = 'rc'
# Maximum cell Peclet number is ~.1 so energy transport is stable without upwinding
advected_interp_method = 'average'
rhie_chow_user_object = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
[]
[v]
type = INSFVVelocityVariable
[]
[pressure]
type = INSFVPressureVariable
[]
[T]
type = INSFVEnergyVariable
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[AuxVariables]
[Pe]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[Pe]
type = PecletNumberFunctorAux
variable = Pe
speed = speed
thermal_diffusivity = 'thermal_diffusivity'
[]
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[mean_zero_pressure]
type = FVIntegralValueConstraint
variable = pressure
lambda = lambda
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = 'mu'
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = 'mu'
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[temp_conduction]
type = FVDiffusion
coeff = ${k}
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'top'
function = 1
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = v
boundary = 'left right top bottom'
function = 0
[]
[T_hot]
type = FVDirichletBC
variable = T
boundary = 'bottom'
value = 1
[]
[T_cold]
type = FVDirichletBC
variable = T
boundary = 'top'
value = 0
[]
[]
[Materials]
[mu]
type = ADGenericFunctorMaterial
prop_names = 'mu'
prop_values = '${mu}'
[]
[speed]
type = ADVectorMagnitudeFunctorMaterial
x_functor = u
y_functor = v
vector_magnitude_name = speed
[]
[thermal_diffusivity]
type = ThermalDiffusivityFunctorMaterial
k = ${k}
rho = ${rho}
cp = ${cp}
[]
[enthalpy]
type = INSFVEnthalpyFunctorMaterial
rho = ${rho}
temperature = T
cp = ${cp}
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm 100 lu NONZERO'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/pwcnsfv.i)
rho='rho'
advected_interp_method='upwind'
velocity_interp_method='rc'
gamma=1.4
R=8.3145
molar_mass=29.0e-3
R_specific=${fparse R/molar_mass}
cp=${fparse gamma*R_specific/(gamma-1)}
[GlobalParams]
two_term_boundary_expansion = true
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = PINSFVRhieChowInterpolator
u = sup_vel_x
pressure = pressure
porosity = porosity
[]
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = .1
xmax = .6
nx = 2
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = INSFVPressureVariable
[]
[sup_vel_x]
type = PINSFVSuperficialVelocityVariable
[]
[]
[AuxVariables]
[porosity]
type = MooseVariableFVReal
[]
[T_fluid]
type = INSFVEnergyVariable
[]
[]
[ICs]
[pressure]
type = FunctionIC
variable = pressure
function = 'exact_p'
[]
[sup_vel_x]
type = FunctionIC
variable = sup_vel_x
function = 'exact_sup_vel_x'
[]
[T_fluid]
type = FunctionIC
variable = T_fluid
function = 'exact_T'
[]
[eps]
type = FunctionIC
variable = porosity
function = 'eps'
[]
[]
[FVKernels]
[mass_advection]
type = PINSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[mass_fn]
type = FVBodyForce
variable = pressure
function = 'forcing_rho'
[]
[u_advection]
type = PINSFVMomentumAdvection
variable = sup_vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
porosity = porosity
momentum_component = 'x'
[]
[u_pressure]
type = PINSFVMomentumPressureFlux
variable = sup_vel_x
pressure = pressure
porosity = porosity
momentum_component = 'x'
force_boundary_execution = false
[]
[momentum_fn]
type = INSFVBodyForce
variable = sup_vel_x
functor = 'forcing_rho_ud'
momentum_component = 'x'
[]
[]
[FVBCs]
[mass]
variable = pressure
type = PINSFVFunctorBC
boundary = 'left right'
superficial_vel_x = sup_vel_x
pressure = pressure
eqn = 'mass'
porosity = porosity
[]
[momentum]
variable = sup_vel_x
type = PINSFVFunctorBC
boundary = 'left right'
superficial_vel_x = sup_vel_x
pressure = pressure
eqn = 'momentum'
momentum_component = 'x'
porosity = porosity
[]
# help gradient reconstruction *and* create Dirichlet values for use in PINSFVFunctorBC
[pressure_right]
type = FVFunctionDirichletBC
variable = pressure
function = exact_p
boundary = 'right'
[]
[sup_vel_x_left]
type = FVFunctionDirichletBC
variable = sup_vel_x
function = exact_sup_vel_x
boundary = 'left'
[]
[T_fluid_left]
type = FVFunctionDirichletBC
variable = T_fluid
function = exact_T
boundary = 'left'
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp'
prop_values = '${cp}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T_fluid
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = T_fluid
rho = ${rho}
[]
[]
[Functions]
[forcing_rho]
type = ParsedFunction
expression = '-3.45300378856215*sin(1.1*x)'
[]
[forcing_rho_ud]
type = ParsedFunction
expression = '-0.9*(10.6975765229419*cos(1.2*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + 0.9*(10.6975765229419*sin(x)*cos(1.2*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 12.8370918275302*sin(1.2*x)/cos(x))*cos(x) + 3.13909435323832*sin(x)*cos(1.1*x)^2/cos(x)^2 - 6.9060075771243*sin(1.1*x)*cos(1.1*x)/cos(x)'
[]
[exact_T]
type = ParsedFunction
expression = '0.0106975765229418*cos(1.2*x)/cos(x) - 0.000697576522941848*cos(1.1*x)^2/cos(x)^2'
[]
[exact_p]
type = ParsedFunction
expression = '3.48788261470924*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)'
[]
[exact_sup_vel_x]
type = ParsedFunction
expression = '0.9*cos(1.1*x)/cos(x)'
[]
[eps]
type = ParsedFunction
expression = '0.9'
[]
[]
[Executioner]
solve_type = NEWTON
type = Transient
num_steps = 1
dtmin = 1
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_max_its = 50
line_search = bt
nl_rel_tol = 1e-12
nl_abs_tol = 1e-12
[]
[Outputs]
exodus = true
csv = true
[]
[Debug]
show_var_residual_norms = true
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2pressure]
type = ElementL2FunctorError
approximate = pressure
exact = exact_p
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2sup_vel_x]
approximate = sup_vel_x
exact = exact_sup_vel_x
type = ElementL2FunctorError
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/ics/test_function.i)
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
ymin = 1
ymax = 2
nx = 3
ny = 3
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
kernel_coverage_check = false
solve = false
skip_nl_system_check = true
[]
[AuxVariables]
[pressure]
type = MooseVariableFVReal
[]
[vel_x]
type = MooseVariableFVReal
[]
[vel_y]
type = MooseVariableFVReal
[]
[vel_z]
type = MooseVariableFVReal
[]
[temperature]
type = MooseVariableFVReal
[]
[ht]
type = MooseVariableFVReal
[]
[e]
type = MooseVariableFVReal
[]
[Mach]
type = MooseVariableFVReal
[]
[rho]
type = MooseVariableFVReal
[]
[rhou]
type = MooseVariableFVReal
[]
[rhov]
type = MooseVariableFVReal
[]
[rhow]
type = MooseVariableFVReal
[]
[rho_et]
type = MooseVariableFVReal
[]
[specific_volume]
type = MooseVariableFVReal
[]
[pressure_2]
[]
[vel_x_2]
[]
[vel_y_2]
[]
[vel_z_2]
[]
[temperature_2]
[]
[ht_2]
[]
[e_2]
[]
[Mach_2]
[]
[rho_2]
[]
[rhou_2]
[]
[rhov_2]
[]
[rhow_2]
[]
[rho_et_2]
[]
[specific_volume_2]
[]
[]
[GlobalParams]
fluid_properties = 'fp'
initial_pressure = p_func
initial_temperature = T_func
initial_velocity = 'vx vy vz'
[]
[Functions]
[p_func]
type = ParsedFunction
expression = '3+3+1e5 - x'
[]
[T_func]
type = ParsedFunction
expression = '273.15 + x*y*2'
[]
[vx]
type = ParsedFunction
expression = '14'
[]
[vy]
type = ParsedFunction
expression = '10 + x'
[]
[vz]
type = ParsedFunction
expression = '12 -7*y'
[]
[]
[ICs]
[p]
type = NSFunctionInitialCondition
variable = 'pressure'
[]
[vel_x]
type = NSFunctionInitialCondition
variable = 'vel_x'
[]
[vel_y]
type = NSFunctionInitialCondition
variable = 'vel_y'
[]
[vel_z]
type = NSFunctionInitialCondition
variable = 'vel_z'
[]
[temperature]
type = NSFunctionInitialCondition
variable = 'temperature'
[]
[ht]
type = NSFunctionInitialCondition
variable = 'ht'
[]
[e]
type = NSFunctionInitialCondition
variable = 'e'
[]
[Mach]
type = NSFunctionInitialCondition
variable = 'Mach'
[]
[rho]
type = NSFunctionInitialCondition
fluid_properties = 'fp'
initial_pressure = p_func
initial_temperature = T_func
initial_velocity = 'vx vy vz'
variable = 'rho'
[]
[rhou]
type = NSFunctionInitialCondition
variable = 'rhou'
[]
[rhov]
type = NSFunctionInitialCondition
variable = 'rhov'
[]
[rhow]
type = NSFunctionInitialCondition
variable = 'rhow'
[]
[rho_et]
type = NSFunctionInitialCondition
variable = 'rho_et'
[]
[specific_volume]
type = NSFunctionInitialCondition
variable = 'specific_volume'
[]
[p_2]
type = NSFunctionInitialCondition
variable = 'pressure_2'
variable_type = 'pressure'
[]
[vel_x_2]
type = NSFunctionInitialCondition
variable = 'vel_x_2'
variable_type = 'vel_x'
[]
[vel_y_2]
type = NSFunctionInitialCondition
variable = 'vel_y_2'
variable_type = 'vel_y'
[]
[vel_z_2]
type = NSFunctionInitialCondition
variable = 'vel_z_2'
variable_type = 'vel_z'
[]
[temperature_2]
type = NSFunctionInitialCondition
variable = 'temperature_2'
variable_type = 'temperature'
[]
[ht_2]
type = NSFunctionInitialCondition
variable = 'ht_2'
variable_type = 'ht'
[]
[e_2]
type = NSFunctionInitialCondition
variable = 'e_2'
variable_type = 'e'
[]
[Mach_2]
type = NSFunctionInitialCondition
variable = 'Mach_2'
variable_type = 'Mach'
[]
[rho_2]
type = NSFunctionInitialCondition
variable = 'rho_2'
variable_type = 'rho'
[]
[rhou_2]
type = NSFunctionInitialCondition
variable = 'rhou_2'
variable_type = 'rhou'
[]
[rhov_2]
type = NSFunctionInitialCondition
variable = 'rhov_2'
variable_type = 'rhov'
[]
[rhow_2]
type = NSFunctionInitialCondition
variable = 'rhow_2'
variable_type = 'rhow'
[]
[rho_et_2]
type = NSFunctionInitialCondition
variable = 'rho_et_2'
variable_type = 'rho_et'
[]
[specific_volume_2]
type = NSFunctionInitialCondition
variable = 'specific_volume_2'
variable_type = 'specific_volume'
[]
[]
[Executioner]
type = Steady
[]
[Debug]
show_actions = true
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/pins/materials/2d-rc-action.i)
mu = 0.01
rho = 2000
u_inlet = 1
advected_interp_method = 'upwind'
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = 0
ymax = 1
nx = 10
ny = 6
[]
[]
[AuxVariables]
[porosity]
family = MONOMIAL
order = CONSTANT
fv = true
initial_condition = 0.5
[]
[speed_output]
type = MooseVariableFVReal
[]
[vel_x_output]
type = MooseVariableFVReal
[]
[vel_y_output]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[speed]
type = FunctorAux
variable = 'speed_output'
functor = 'speed'
[]
[vel_x]
type = ADFunctorVectorElementalAux
variable = 'vel_x_output'
functor = 'velocity'
component = 0
[]
[vel_y]
type = ADFunctorVectorElementalAux
variable = 'vel_y_output'
functor = 'velocity'
component = 1
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'incompressible'
porous_medium_treatment = true
density = ${rho}
dynamic_viscosity = ${mu}
porosity = 'porosity'
initial_velocity = '${u_inlet} 1e-6 0'
initial_pressure = 0.0
inlet_boundaries = 'left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_function = '${u_inlet} 0'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip symmetry'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '0.1'
momentum_advection_interpolation = ${advected_interp_method}
mass_advection_interpolation = ${advected_interp_method}
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
nl_abs_tol = 1e-11
[]
# Some basic Postprocessors to examine the solution
[Postprocessors]
[inlet-p]
type = SideAverageValue
variable = pressure
boundary = 'left'
[]
[outlet-u]
type = SideAverageValue
variable = superficial_vel_x
boundary = 'right'
[]
[]
[Outputs]
exodus = true
csv = false
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/bernoulli-1d.i)
rho = 1.1
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 1
dx = '1 1'
ix = '3 3'
subdomain_id = '1 2'
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = PINSFVRhieChowInterpolator
u = u
pressure = pressure
porosity = porosity
[]
[]
[Variables]
[u]
type = PINSFVSuperficialVelocityVariable
initial_condition = 1
[]
[pressure]
type = BernoulliPressureVariable
u = u
porosity = porosity
rho = ${rho}
[]
[]
[AuxVariables]
[porosity]
type = PiecewiseConstantVariable
[]
[has_porosity_jump_face]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[has_porosity_jump_face]
type = HasPorosityJumpFace
porosity = porosity
execute_on = 'initial timestep_end'
variable = has_porosity_jump_face
[]
[]
[ICs]
[porosity_1]
type = ConstantIC
variable = porosity
block = 1
value = 1
[]
[porosity_2]
type = ConstantIC
variable = porosity
block = 2
value = 0.5
[]
[]
[FVKernels]
[mass]
type = PINSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_advection]
type = PINSFVMomentumAdvection
variable = u
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
porosity = porosity
momentum_component = 'x'
[]
[u_pressure]
type = PINSFVMomentumPressure
variable = u
pressure = pressure
porosity = porosity
momentum_component = 'x'
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = u
function = '1'
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = 'none'
[]
[Postprocessors]
[inlet_p]
type = SideAverageValue
variable = 'pressure'
boundary = 'left'
[]
[outlet-u]
type = SideIntegralVariablePostprocessor
variable = u
boundary = 'right'
[]
[]
[Outputs]
exodus = true
csv = true
[]
(test/tests/fvics/constant_ic/subdomain_constant_ic.i)
[Mesh]
file = sq-2blk.e
uniform_refine = 1
[]
[Variables]
[u]
type = MooseVariableFVReal
[]
[]
[FVICs]
[ic_u_1]
type = FVConstantIC
variable = u
value = 6.25
block = '1'
[]
[ic_u_2]
type = FVConstantIC
variable = u
value = 9.99
block = '2'
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
exodus = true
[]
(test/tests/fvkernels/mms/skewness-correction/adv-diff-react/skewed.i)
a=1.1
diff=1.1
[Mesh]
[gen_mesh]
type = FileMeshGenerator
file = skewed.msh
[]
[]
[Variables]
[v]
initial_condition = 1
type = MooseVariableFVReal
face_interp_method = 'skewness-corrected'
[]
[]
[FVKernels]
[diff_v]
type = FVDiffusion
variable = v
coeff = ${diff}
[]
[advection]
type = FVAdvection
variable = v
velocity = '${a} ${fparse 2*a} 0'
advected_interp_method = 'average'
[]
[reaction]
type = FVReaction
variable = v
[]
[body_v]
type = FVBodyForce
variable = v
function = 'forcing'
[]
[]
[FVBCs]
[exact]
type = FVFunctionDirichletBC
boundary = 'left right top bottom'
function = 'exact'
variable = v
[]
[]
[Functions]
[exact]
type = ParsedFunction
expression = 'sin(x)*cos(y)'
[]
[forcing]
type = ParsedFunction
expression = '-2*a*sin(x)*sin(y) + a*cos(x)*cos(y) + 2*diff*sin(x)*cos(y) + sin(x)*cos(y)'
symbol_names = 'a diff'
symbol_values = '${a} ${diff}'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
csv = true
[]
[Postprocessors]
[./error]
type = ElementL2Error
variable = v
function = exact
outputs = 'console csv'
[../]
[h]
type = AverageElementSize
outputs = 'console csv'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/lid-driven-turb-non-eq-wall.i)
##########################################################
# Lid-driven cavity test
# Reynolds: 5,000
# Author: Dr. Mauricio Tano
# Last Update: Novomber, 2023
# Turbulent model using:
# Standard wall functions with non-equilibrium wall formaultion
# No wall functions
# SIMPLE Solve
##########################################################
### Thermophsyical Properties ###
mu = 2e-5
rho = 1.0
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epslilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Modeling parameters ###
non_equilibrium_treatment = false
bulk_wall_treatment = false
walls = 'left top right bottom'
max_mixing_length = 1e10
linearized_yplus_mu_t = false
wall_treatment = 'neq' # Options: eq_newton, eq_incremental, eq_linearized, neq
pressure_tag = "pressure_grad"
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolatorSegregated
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 0.0
solver_sys = u_system
two_term_boundary_expansion = false
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 0.0
solver_sys = v_system
two_term_boundary_expansion = false
[]
[pressure]
type = INSFVPressureVariable
solver_sys = pressure_system
initial_condition = 0.2
two_term_boundary_expansion = false
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
[]
[]
[FVKernels]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = true
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = true
u = vel_x
v = vel_y
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[p_diffusion]
type = FVAnisotropicDiffusion
variable = pressure
coeff = "Ainv"
coeff_interp_method = 'average'
[]
[p_source]
type = FVDivergence
variable = pressure
vector_field = "HbyA"
force_boundary_execution = true
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
non_equilibrium_treatment = ${non_equilibrium_treatment}
max_mixing_length = ${max_mixing_length}
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
k = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
non_equilibrium_treatment = ${non_equilibrium_treatment}
max_mixing_length = ${max_mixing_length}
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${lid_velocity}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = 'left right top bottom'
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
k = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
linearized_yplus = ${linearized_yplus_mu_t}
non_equilibrium_treatment = ${non_equilibrium_treatment}
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKED_system TKE_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.5
turbulence_equation_relaxation = '0.8 0.8'
num_iterations = 500
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
[]
[Outputs]
exodus = true
csv = false
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
(modules/porous_flow/test/tests/pressure_pulse/pressure_pulse_1d_2phasePS_fv.i)
# Pressure pulse in 1D with 2 phases, 2components - transient using FV
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 10
xmin = 0
xmax = 100
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[Variables]
[ppwater]
type = MooseVariableFVReal
initial_condition = 2e6
[]
[sgas]
type = MooseVariableFVReal
initial_condition = 0.3
[]
[]
[AuxVariables]
[massfrac_ph0_sp0]
type = MooseVariableFVReal
initial_condition = 1
[]
[massfrac_ph1_sp0]
type = MooseVariableFVReal
initial_condition = 0
[]
[ppgas]
family = MONOMIAL
order = CONSTANT
[]
[]
[FVKernels]
[mass0]
type = FVPorousFlowMassTimeDerivative
fluid_component = 0
variable = ppwater
[]
[flux0]
type = FVPorousFlowAdvectiveFlux
variable = ppwater
fluid_component = 0
[]
[mass1]
type = FVPorousFlowMassTimeDerivative
fluid_component = 1
variable = sgas
[]
[flux1]
type = FVPorousFlowAdvectiveFlux
variable = sgas
fluid_component = 1
[]
[]
[AuxKernels]
[ppgas]
type = ADPorousFlowPropertyAux
property = pressure
phase = 1
variable = ppgas
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'ppwater sgas'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureConst
pc = 1e5
[]
[]
[FluidProperties]
[simple_fluid0]
type = SimpleFluidProperties
bulk_modulus = 2e9
density0 = 1000
thermal_expansion = 0
viscosity = 1e-3
[]
[simple_fluid1]
type = SimpleFluidProperties
bulk_modulus = 2e7
density0 = 1
thermal_expansion = 0
viscosity = 1e-5
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
[]
[ppss]
type = ADPorousFlow2PhasePS
phase0_porepressure = ppwater
phase1_saturation = sgas
capillary_pressure = pc
[]
[massfrac]
type = ADPorousFlowMassFraction
mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
[]
[simple_fluid0]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid0
phase = 0
[]
[simple_fluid1]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid1
phase = 1
[]
[porosity]
type = ADPorousFlowPorosityConst
porosity = 0.1
[]
[permeability]
type = ADPorousFlowPermeabilityConst
permeability = '1e-15 0 0 0 1e-15 0 0 0 1e-15'
[]
[relperm_water]
type = ADPorousFlowRelativePermeabilityCorey
n = 1
phase = 0
[]
[relperm_gas]
type = ADPorousFlowRelativePermeabilityCorey
n = 1
phase = 1
[]
[]
[FVBCs]
[leftwater]
type = FVDirichletBC
boundary = left
value = 3e6
variable = ppwater
[]
[rightwater]
type = FVDirichletBC
boundary = right
value = 2e6
variable = ppwater
[]
[sgas]
type = FVDirichletBC
boundary = 'left right'
value = 0.3
variable = sgas
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 1e3
end_time = 1e4
[]
[VectorPostprocessors]
[pp]
type = ElementValueSampler
sort_by = x
variable = 'ppwater ppgas'
[]
[]
[Outputs]
file_base = pressure_pulse_1d_2phasePS_fv
print_linear_residuals = false
[csv]
type = CSV
execute_on = final
[]
exodus = true
[]
(modules/porous_flow/test/tests/pressure_pulse/pressure_pulse_1d_2phase_fv.i)
# Pressure pulse in 1D with 2 phases (with one having zero saturation), 2components - transient using FV
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 10
xmin = 0
xmax = 100
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[ppwater]
type = MooseVariableFVReal
initial_condition = 2E6
[]
[ppgas]
type = MooseVariableFVReal
initial_condition = 2E6
[]
[]
[AuxVariables]
[massfrac_ph0_sp0]
type = MooseVariableFVReal
initial_condition = 1
[]
[massfrac_ph1_sp0]
type = MooseVariableFVReal
initial_condition = 0
[]
[]
[FVKernels]
[mass0]
type = FVPorousFlowMassTimeDerivative
fluid_component = 0
variable = ppwater
[]
[flux0]
type = FVPorousFlowAdvectiveFlux
variable = ppwater
gravity = '0 0 0'
fluid_component = 0
[]
[mass1]
type = FVPorousFlowMassTimeDerivative
fluid_component = 1
variable = ppgas
[]
[flux1]
type = FVPorousFlowAdvectiveFlux
variable = ppgas
gravity = '0 0 0'
fluid_component = 1
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'ppwater ppgas'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureVG
m = 0.5
alpha = 1
[]
[]
[FluidProperties]
[simple_fluid0]
type = SimpleFluidProperties
bulk_modulus = 2e9
density0 = 1000
thermal_expansion = 0
viscosity = 1e-3
[]
[simple_fluid1]
type = SimpleFluidProperties
bulk_modulus = 2e6
density0 = 1
thermal_expansion = 0
viscosity = 1e-5
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
[]
[ppss]
type = ADPorousFlow2PhasePP
phase0_porepressure = ppwater
phase1_porepressure = ppgas
capillary_pressure = pc
[]
[massfrac]
type = ADPorousFlowMassFraction
mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
[]
[simple_fluid0]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid0
phase = 0
[]
[simple_fluid1]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid1
phase = 1
[]
[porosity]
type = ADPorousFlowPorosityConst
porosity = 0.1
[]
[permeability]
type = ADPorousFlowPermeabilityConst
permeability = '1E-15 0 0 0 1E-15 0 0 0 1E-15'
[]
[relperm_water]
type = ADPorousFlowRelativePermeabilityCorey
n = 1
phase = 0
[]
[relperm_gas]
type = ADPorousFlowRelativePermeabilityCorey
n = 1
phase = 1
[]
[]
[FVBCs]
[leftwater]
type = FVDirichletBC
boundary = left
value = 3E6
variable = ppwater
[]
[leftgas]
type = FVDirichletBC
boundary = left
value = 3E6
variable = ppgas
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap -snes_atol'
petsc_options_value = 'gmres asm lu NONZERO 2 1E-12'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 1E3
end_time = 1E4
[]
[Postprocessors]
[p005]
type = PointValue
variable = ppwater
point = '5 0 0'
execute_on = 'initial timestep_end'
[]
[p015]
type = PointValue
variable = ppwater
point = '15 0 0'
execute_on = 'initial timestep_end'
[]
[p025]
type = PointValue
variable = ppwater
point = '25 0 0'
execute_on = 'initial timestep_end'
[]
[p035]
type = PointValue
variable = ppwater
point = '35 0 0'
execute_on = 'initial timestep_end'
[]
[p045]
type = PointValue
variable = ppwater
point = '45 0 0'
execute_on = 'initial timestep_end'
[]
[p055]
type = PointValue
variable = ppwater
point = '55 0 0'
execute_on = 'initial timestep_end'
[]
[p065]
type = PointValue
variable = ppwater
point = '65 0 0'
execute_on = 'initial timestep_end'
[]
[p075]
type = PointValue
variable = ppwater
point = '75 0 0'
execute_on = 'initial timestep_end'
[]
[p085]
type = PointValue
variable = ppwater
point = '85 0 0'
execute_on = 'initial timestep_end'
[]
[p095]
type = PointValue
variable = ppwater
point = '95 0 0'
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
file_base = pressure_pulse_1d_2phase_fv
print_linear_residuals = false
csv = true
[]
(test/tests/fvkernels/mms/advective-outflow/advection.i)
a=1.1
[GlobalParams]
advected_interp_method = 'average'
[]
[Mesh]
[./gen_mesh]
type = GeneratedMeshGenerator
dim = 1
xmin = 0.1
xmax = 1.1
nx = 2
[../]
[]
[Variables]
[./u]
family = MONOMIAL
order = CONSTANT
fv = true
two_term_boundary_expansion = false
type = MooseVariableFVReal
[../]
[./v]
family = MONOMIAL
order = CONSTANT
fv = true
two_term_boundary_expansion = true
type = MooseVariableFVReal
[../]
[]
[FVKernels]
[./advection_u]
type = FVAdvection
variable = u
velocity = '${a} 0 0'
force_boundary_execution = true
[../]
[body_u]
type = FVBodyForce
variable = u
function = 'forcing'
[]
[./advection_v]
type = FVAdvection
variable = v
velocity = '${a} 0 0'
force_boundary_execution = true
[../]
[body_v]
type = FVBodyForce
variable = v
function = 'forcing'
[]
[]
[FVBCs]
[left_u]
type = FVFunctionDirichletBC
boundary = 'left'
function = 'exact'
variable = u
[]
[left_v]
type = FVFunctionDirichletBC
boundary = 'left'
function = 'exact'
variable = v
[]
[]
[Functions]
[exact]
type = ParsedFunction
expression = 'cos(x)'
[]
[forcing]
type = ParsedFunction
expression = '-${a} * sin(x)'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
exodus = true
csv = true
[]
[Postprocessors]
[./L2u]
type = ElementL2Error
variable = u
function = exact
outputs = 'console csv'
execute_on = 'timestep_end'
[../]
[./L2v]
type = ElementL2Error
variable = v
function = exact
outputs = 'console csv'
execute_on = 'timestep_end'
[../]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(test/tests/fvkernels/mms/harmonic_interpolation/diffusion.i)
d1 = 1
d2 = 10
[Mesh]
[gen_mesh]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
elem_type = TRI3
[]
[subdomain]
type = ParsedSubdomainMeshGenerator
input = gen_mesh
combinatorial_geometry = 'y > 0.5'
block_id = 1
[]
[]
[Variables]
[v]
type = MooseVariableFVReal
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = v
coeff = 'diff_coeff'
coeff_interp_method = average
[]
[body_v]
type = FVBodyForce
variable = v
function = 'forcing'
[]
[]
[FVBCs]
[exact]
type = FVFunctionDirichletBC
boundary = 'left right top bottom'
function = 'exact'
variable = v
[]
[]
[Functions]
[exact]
type = ParsedFunction
expression = 'if (y < 0.5, 1 + x + 3*y*y*y, (11*d2-3*d1)/ (8*d2) + x + 3*d1/d2*y*y*y)'
symbol_names = 'd1 d2'
symbol_values = '${d1} ${d2}'
[]
[forcing]
type = ParsedFunction
expression = '-d1*18*y'
symbol_names = 'd1'
symbol_values = '${d1}'
[]
[]
[Materials]
[diff_coeff]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = 'diff_coeff'
subdomain_to_prop_value = '0 ${d1}
1 ${d2}'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
csv = true
exodus = true
[]
[Postprocessors]
[error]
type = ElementL2Error
variable = v
function = exact
outputs = 'console csv'
[]
[h]
type = AverageElementSize
outputs = 'console csv'
[]
[]
(modules/navier_stokes/test/tests/auxkernels/liquid-fraction-aux/liquid-fraction-fv-aux.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 5
[]
[]
[AuxVariables]
[fl]
type = MooseVariableFVReal
[]
[T]
type = MooseVariableFVReal
[]
[]
[ICs]
[FunctionIC]
type = FunctionIC
variable = T
function = '10 + x'
[]
[]
[AuxKernels]
[liquid_fraction]
type = NSLiquidFractionAux
variable = fl
temperature = T
T_liquidus = 20
T_solidus = 10
[]
[]
[VectorPostprocessors]
[T]
type = LineValueSampler
start_point = '0.1 0 0'
end_point = '0.9 0 0'
num_points = 5
variable = T
sort_by = x
[]
[fl]
type = LineValueSampler
start_point = '0.1 0 0'
end_point = '0.9 0 0'
num_points = 5
variable = fl
sort_by = x
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/multiapp-scalar-transport/fluid-flow.i)
mu=1
rho=1
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method='average'
velocity_interp_method='rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = -1
ymax = 1
nx = 100
ny = 20
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = 1
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1
[]
[pressure]
type = INSFVPressureVariable
[]
[]
[AuxVariables]
[ax_out]
type = MooseVariableFVReal
[]
[ay_out]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[ax_out]
type = FunctorAux
functor = ax
variable = ax_out
execute_on = timestep_end
[]
[ay_out]
type = FunctorAux
functor = ay
variable = ay_out
execute_on = timestep_end
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = u
function = '1'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = v
function = 0
[]
[walls-u]
type = INSFVNoSlipWallBC
boundary = 'top bottom'
variable = u
function = 0
[]
[walls-v]
type = INSFVNoSlipWallBC
boundary = 'top bottom'
variable = v
function = 0
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = 0
[]
[]
[MultiApps]
[scalar]
type = FullSolveMultiApp
execute_on = 'timestep_end'
input_files = 'scalar-transport.i'
[]
[]
[Transfers]
[ax]
type = MultiAppCopyTransfer
source_variable = ax_out
variable = ax
execute_on = 'timestep_end'
to_multi_app = 'scalar'
[]
[ay]
type = MultiAppCopyTransfer
source_variable = ay_out
variable = ay
execute_on = 'timestep_end'
to_multi_app = 'scalar'
[]
[u]
type = MultiAppCopyTransfer
source_variable = u
variable = u
execute_on = 'timestep_end'
to_multi_app = 'scalar'
[]
[v]
type = MultiAppCopyTransfer
source_variable = v
variable = v
execute_on = 'timestep_end'
to_multi_app = 'scalar'
[]
[pressure]
type = MultiAppCopyTransfer
source_variable = pressure
variable = pressure
execute_on = 'timestep_end'
to_multi_app = 'scalar'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/solidification/solidification_no_advection.i)
rho_solid = 1.0
rho_liquid = 1.0
k_solid = 0.03
k_liquid = 0.1
cp_solid = 1.0
cp_liquid = 1.0
T_liquidus = 260
T_solidus = 240
L = 1.0
T_hot = 300.0
T_cold = 200.0
N = 10
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = ${N}
ny = ${N}
[]
[]
[AuxVariables]
[fl]
type = MooseVariableFVReal
initial_condition = 1.0
[]
[density]
type = MooseVariableFVReal
[]
[th_cond]
type = MooseVariableFVReal
[]
[cp_var]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[compute_fl]
type = NSLiquidFractionAux
variable = fl
temperature = T
T_liquidus = '${T_liquidus}'
T_solidus = '${T_solidus}'
execute_on = 'TIMESTEP_END'
[]
[rho_out]
type = FunctorAux
functor = 'rho_mixture'
variable = 'density'
[]
[th_cond_out]
type = FunctorAux
functor = 'k_mixture'
variable = 'th_cond'
[]
[cp_out]
type = FunctorAux
functor = 'cp_mixture'
variable = 'cp_var'
[]
[]
[Variables]
[T]
type = INSFVEnergyVariable
initial_condition = '${T_hot}'
[]
[]
[FVKernels]
[T_time]
type = INSFVEnergyTimeDerivative
variable = T
rho = ${rho_liquid}
[]
[energy_diffusion]
type = FVDiffusion
coeff = 'k_mixture'
variable = T
[]
[energy_source]
type = NSFVPhaseChangeSource
variable = T
L = ${L}
liquid_fraction = fl
T_liquidus = ${T_liquidus}
T_solidus = ${T_solidus}
rho = 'rho_mixture'
[]
[]
[FVBCs]
[heated_wall]
type = FVDirichletBC
variable = T
value = '${T_hot}'
boundary = 'top'
[]
[cooled_wall]
type = FVDirichletBC
variable = T
value = '${T_cold}'
boundary = 'bottom'
[]
[]
[FunctorMaterials]
[eff_cp]
type = NSFVMixtureFunctorMaterial
phase_2_names = '${cp_solid} ${k_solid} ${rho_solid}'
phase_1_names = '${cp_liquid} ${k_liquid} ${rho_liquid}'
prop_names = 'cp_mixture k_mixture rho_mixture'
phase_1_fraction = fl
[]
[h]
type = INSFVEnthalpyFunctorMaterial
cp = ${cp_liquid}
temperature = T
rho = ${rho_liquid}
[]
[]
[Executioner]
type = Transient
dt = 0.5
end_time = 50.0
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_abs_tol = 1e-12
nl_max_its = 50
steady_state_detection = true
[]
[Outputs]
exodus = true
[]
(test/tests/tag/mass-matrix.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
nx = 2
ny = 2
dim = 2
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
[]
[]
[AuxVariables]
[mass]
type = MooseVariableFVReal
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = u
coeff = 1
[]
[mass]
type = FVMassMatrix
variable = u
matrix_tags = 'mass'
[]
[]
[AuxKernels]
[TagMatrixAux1]
type = TagMatrixAux
variable = mass
v = u
matrix_tag = mass
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = FVDirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Problem]
type = FEProblem
extra_tag_matrices = 'mass'
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/implicit-euler-basic-kt-primitive.i)
p_initial=1.01e5
T=273.15
# u refers to the superficial velocity
u_in=1
user_limiter='upwind'
[GlobalParams]
fp = fp
two_term_boundary_expansion = true
limiter = ${user_limiter}
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = 0
xmax = 18
nx = 180
[]
[to_pt5]
input = cartesian
type = SubdomainBoundingBoxGenerator
bottom_left = '2 0 0'
top_right = '4 1 0'
block_id = 1
[]
[pt5]
input = to_pt5
type = SubdomainBoundingBoxGenerator
bottom_left = '4 0 0'
top_right = '6 1 0'
block_id = 2
[]
[to_pt25]
input = pt5
type = SubdomainBoundingBoxGenerator
bottom_left = '6 0 0'
top_right = '8 1 0'
block_id = 3
[]
[pt25]
input = to_pt25
type = SubdomainBoundingBoxGenerator
bottom_left = '8 0 0'
top_right = '10 1 0'
block_id = 4
[]
[to_pt5_again]
input = pt25
type = SubdomainBoundingBoxGenerator
bottom_left = '10 0 0'
top_right = '12 1 0'
block_id = 5
[]
[pt5_again]
input = to_pt5_again
type = SubdomainBoundingBoxGenerator
bottom_left = '12 0 0'
top_right = '14 1 0'
block_id = 6
[]
[to_one]
input = pt5_again
type = SubdomainBoundingBoxGenerator
bottom_left = '14 0 0'
top_right = '16 1 0'
block_id = 7
[]
[one]
input = to_one
type = SubdomainBoundingBoxGenerator
bottom_left = '16 0 0'
top_right = '18 1 0'
block_id = 8
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
initial_condition = ${p_initial}
[]
[sup_vel_x]
type = MooseVariableFVReal
initial_condition = 1e-15
scaling = 1e-2
[]
[T_fluid]
type = MooseVariableFVReal
initial_condition = ${T}
scaling = 1e-5
[]
[]
[AuxVariables]
[vel_x]
type = MooseVariableFVReal
[]
[sup_mom_x]
type = MooseVariableFVReal
[]
[rho]
type = MooseVariableFVReal
[]
[worst_courant]
type = MooseVariableFVReal
[]
[porosity]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[vel_x]
type = ADMaterialRealAux
variable = vel_x
property = vel_x
execute_on = 'timestep_end'
[]
[sup_mom_x]
type = ADMaterialRealAux
variable = sup_mom_x
property = superficial_rhou
execute_on = 'timestep_end'
[]
[rho]
type = ADMaterialRealAux
variable = rho
property = rho
execute_on = 'timestep_end'
[]
[worst_courant]
type = Courant
variable = worst_courant
u = sup_vel_x
execute_on = 'timestep_end'
[]
[porosity]
type = MaterialRealAux
variable = porosity
property = porosity
execute_on = 'timestep_end'
[]
[]
[FVKernels]
[mass_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_dt'
variable = pressure
[]
[mass_advection]
type = PCNSFVKT
variable = pressure
eqn = "mass"
[]
[momentum_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhou_dt'
variable = sup_vel_x
[]
[momentum_advection]
type = PCNSFVKT
variable = sup_vel_x
eqn = "momentum"
momentum_component = 'x'
[]
[eps_grad]
type = PNSFVPGradEpsilon
variable = sup_vel_x
momentum_component = 'x'
epsilon_function = 'eps'
[]
[energy_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_et_dt'
variable = T_fluid
[]
[energy_advection]
type = PCNSFVKT
variable = T_fluid
eqn = "energy"
[]
[]
[FVBCs]
[rho_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = pressure
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'mass'
[]
[rhou_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = sup_vel_x
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'x'
[]
[rho_et_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = T_fluid
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'energy'
[]
[rho_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = pressure
pressure = ${p_initial}
eqn = 'mass'
[]
[rhou_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = sup_vel_x
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'x'
[]
[rho_et_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = T_fluid
pressure = ${p_initial}
eqn = 'energy'
[]
# Use these to help create more accurate cell centered gradients for cells adjacent to boundaries
[T_left]
type = FVDirichletBC
variable = T_fluid
value = ${T}
boundary = 'left'
[]
[sup_vel_left]
type = FVDirichletBC
variable = sup_vel_x
value = ${u_in}
boundary = 'left'
[]
[p_right]
type = FVDirichletBC
variable = pressure
value = ${p_initial}
boundary = 'right'
[]
[]
[Functions]
[ud_in]
type = ParsedVectorFunction
expression_x = '${u_in}'
[]
[eps]
type = ParsedFunction
expression = 'if(x < 2, 1,
if(x < 4, 1 - .5 / 2 * (x - 2),
if(x < 6, .5,
if(x < 8, .5 - .25 / 2 * (x - 6),
if(x < 10, .25,
if(x < 12, .25 + .25 / 2 * (x - 10),
if(x < 14, .5,
if(x < 16, .5 + .5 / 2 * (x - 14),
1))))))))'
[]
[]
[Materials]
[var_mat]
type = PorousPrimitiveVarMaterial
pressure = pressure
T_fluid = T_fluid
superficial_vel_x = sup_vel_x
fp = fp
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[]
[Executioner]
solve_type = NEWTON
line_search = 'bt'
type = Transient
nl_max_its = 20
[TimeStepper]
type = IterationAdaptiveDT
dt = 5e-5
optimal_iterations = 6
growth_factor = 1.2
[]
num_steps = 10000
end_time = 500
nl_abs_tol = 1e-8
[]
[Outputs]
[out]
type = Exodus
execute_on = 'final'
[]
checkpoint = true
[]
[Debug]
show_var_residual_norms = true
[]
(test/tests/fvkernels/constraints/integral.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 4
[]
[Variables]
[v]
type = MooseVariableFVReal
[]
[lambda]
type = MooseVariableScalar
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = v
coeff = coeff
[]
[average]
type = FVIntegralValueConstraint
variable = v
phi0 = 13
lambda = lambda
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = v
boundary = left
value = 7
[]
[]
[Materials]
[diff]
type = ADGenericFunctorMaterial
prop_names = 'coeff'
prop_values = '1'
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[]
[Outputs]
exodus = true
[]
(test/tests/mortar/convergence-studies/fv-gap-conductance/gap-conductance.i)
[Problem]
error_on_jacobian_nonzero_reallocation = true
[]
[Mesh]
[left_block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 2
ny = 2
elem_type = QUAD4
[]
[left_block_sidesets]
type = RenameBoundaryGenerator
input = left_block
old_boundary = '0 1 2 3'
new_boundary = 'lb_bottom lb_right lb_top lb_left'
[]
[left_block_id]
type = SubdomainIDGenerator
input = left_block_sidesets
subdomain_id = 1
[]
[right_block]
type = GeneratedMeshGenerator
dim = 2
xmin = 2
xmax = 3
ymin = 0
ymax = 1
nx = 2
ny = 2
elem_type = QUAD4
[]
[right_block_id]
type = SubdomainIDGenerator
input = right_block
subdomain_id = 2
[]
[right_block_change_boundary_id]
type = RenameBoundaryGenerator
input = right_block_id
old_boundary = '0 1 2 3'
new_boundary = '100 101 102 103'
[]
[combined]
type = MeshCollectionGenerator
inputs = 'left_block_id right_block_change_boundary_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'left_block right_block'
[]
[right_right_sideset]
type = SideSetsAroundSubdomainGenerator
input = block_rename
new_boundary = rb_right
included_subdomains = right_block
normal = '1 0 0'
[]
[right_left_sideset]
type = SideSetsAroundSubdomainGenerator
input = right_right_sideset
new_boundary = rb_left
included_subdomains = right_block
normal = '-1 0 0'
[]
[right_top_sideset]
type = SideSetsAroundSubdomainGenerator
input = right_left_sideset
new_boundary = rb_top
included_subdomains = right_block
normal = '0 1 0'
[]
[right_bottom_sideset]
type = SideSetsAroundSubdomainGenerator
input = right_top_sideset
new_boundary = rb_bottom
included_subdomains = right_block
normal = '0 -1 0'
[]
[secondary]
input = right_bottom_sideset
type = LowerDBlockFromSidesetGenerator
sidesets = 'lb_right'
new_block_id = '10001'
new_block_name = 'secondary_lower'
[]
[primary]
input = secondary
type = LowerDBlockFromSidesetGenerator
sidesets = 'rb_left'
new_block_id = '10000'
new_block_name = 'primary_lower'
[]
[]
[Variables]
[T]
block = 'left_block right_block'
type = MooseVariableFVReal
[]
[lambda]
block = 'secondary_lower'
family = MONOMIAL
order = CONSTANT
[]
[]
[FVBCs]
[neumann]
type = FVFunctionDirichletBC
function = exact_soln_primal
variable = T
boundary = 'lb_bottom lb_top lb_left rb_bottom rb_right rb_top'
[]
[]
[FVKernels]
[conduction]
type = FVDiffusion
variable = T
block = 'left_block right_block'
coeff = 1
[]
[sink]
type = FVReaction
variable = T
block = 'left_block right_block'
[]
[forcing_function]
type = FVBodyForce
variable = T
function = forcing_function
block = 'left_block right_block'
[]
[]
[Functions]
[forcing_function]
type = ParsedFunction
expression = ''
[]
[exact_soln_primal]
type = ParsedFunction
expression = ''
[]
[exact_soln_lambda]
type = ParsedFunction
expression = ''
[]
[mms_secondary]
type = ParsedFunction
expression = ''
[]
[mms_primary]
type = ParsedFunction
expression = ''
[]
[]
[Constraints]
[mortar]
type = GapHeatConductanceTest
primary_boundary = rb_left
secondary_boundary = lb_right
primary_subdomain = primary_lower
secondary_subdomain = secondary_lower
secondary_variable = T
variable = lambda
secondary_gap_conductance = 1
primary_gap_conductance = 1
secondary_mms_function = mms_secondary
primary_mms_function = mms_primary
[]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
csv = true
[]
[Postprocessors]
[L2lambda]
type = ElementL2Error
variable = lambda
function = exact_soln_lambda
execute_on = 'timestep_end'
block = 'secondary_lower'
[]
[L2u]
type = ElementL2Error
variable = T
function = exact_soln_primal
execute_on = 'timestep_end'
block = 'left_block right_block'
[]
[h]
type = AverageElementSize
block = 'left_block right_block'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/bernoulli-1d-functor-material.i)
rho = 1.1
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 1
dx = '1 1'
ix = '3 3'
subdomain_id = '1 2'
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = PINSFVRhieChowInterpolator
u = u
pressure = pressure
porosity = porosity
[]
[]
[Variables]
[u]
type = PINSFVSuperficialVelocityVariable
initial_condition = 1
[]
[pressure]
type = BernoulliPressureVariable
u = u
porosity = porosity
rho = ${rho}
[]
[]
[AuxVariables]
[has_porosity_jump_face]
type = MooseVariableFVReal
[]
[porosity_out]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[has_porosity_jump_face]
type = HasPorosityJumpFace
porosity = porosity
execute_on = 'initial timestep_end'
variable = has_porosity_jump_face
[]
[porosity_out]
type = FunctorAux
variable = porosity_out
functor = porosity
execute_on = 'initial timestep_end'
[]
[]
[FVKernels]
[mass]
type = PINSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_advection]
type = PINSFVMomentumAdvection
variable = u
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
porosity = porosity
momentum_component = 'x'
[]
[u_pressure]
type = PINSFVMomentumPressure
variable = u
pressure = pressure
porosity = porosity
momentum_component = 'x'
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = u
function = '1'
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = 1
[]
[]
[FunctorMaterials]
[porosity]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = 'porosity'
subdomain_to_prop_value = '1 1 2 0.5'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = 'none'
[]
[Postprocessors]
[inlet_p]
type = SideAverageValue
variable = 'pressure'
boundary = 'left'
[]
[outlet-u]
type = SideIntegralVariablePostprocessor
variable = u
boundary = 'right'
[]
[]
[Outputs]
exodus = true
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/channel-advection-slip.i)
mu = 1.0
rho = 10.0
mu_d = 0.1
rho_d = 1.0
l = 2
U = 1
dp = 0.01
inlet_phase_2 = 0.1
advected_interp_method = 'average'
velocity_interp_method = 'rc'
[GlobalParams]
rhie_chow_user_object = 'rc'
mu_interp_method = 'average'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = '${fparse l * 5}'
ymin = '${fparse -l / 2}'
ymax = '${fparse l / 2}'
nx = 10
ny = 6
[]
uniform_refine = 0
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 0
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 0
[]
[pressure]
type = INSFVPressureVariable
[]
[phase_2]
type = INSFVScalarFieldVariable
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = 'rho_mixture'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = 'rho_mixture'
momentum_component = 'x'
[]
[u_advection_slip]
type = WCNSFV2PMomentumAdvectionSlip
variable = vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = 'rho_mixture'
rho_d = ${rho_d}
fd = 0.5
u_slip = 'vel_slip_x'
v_slip = 'vel_slip_y'
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_mixture'
limit_interpolation = true
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = 'rho_mixture'
momentum_component = 'y'
[]
[v_advection_slip]
type = WCNSFV2PMomentumAdvectionSlip
variable = vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
rho_d = ${rho_d}
fd = 0.5
u_slip = 'vel_slip_x'
v_slip = 'vel_slip_y'
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_mixture'
limit_interpolation = true
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[phase_2_advection]
type = INSFVScalarFieldAdvection
variable = phase_2
u_slip = 'vel_slip_x'
v_slip = 'vel_slip_y'
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = 'upwind'
[]
[phase_2_src]
type = NSFVMixturePhaseInterface
variable = phase_2
phase_coupled = phase_1
alpha = 0.1
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_x
functor = '${U}'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_y
functor = '0'
[]
[walls-u]
type = INSFVNoSlipWallBC
boundary = 'top bottom'
variable = vel_x
function = 0
[]
[walls-v]
type = INSFVNoSlipWallBC
boundary = 'top bottom'
variable = vel_y
function = 0
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = '0'
[]
[inlet_phase_2]
type = FVDirichletBC
boundary = 'left'
variable = phase_2
value = ${inlet_phase_2}
[]
[]
[AuxVariables]
[drag_coefficient]
type = MooseVariableFVReal
[]
[rho_mixture_var]
type = MooseVariableFVReal
[]
[mu_mixture_var]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[populate_cd]
type = FunctorAux
variable = drag_coefficient
functor = 'Darcy_coefficient'
[]
[populate_rho_mixture_var]
type = FunctorAux
variable = rho_mixture_var
functor = 'rho_mixture'
[]
[populate_mu_mixture_var]
type = FunctorAux
variable = mu_mixture_var
functor = 'mu_mixture'
[]
[]
[FunctorMaterials]
[phase_1]
property_name = 'phase_1'
type = ADParsedFunctorMaterial
functor_names = 'phase_2'
expression = '1 - phase_2'
outputs = 'out'
output_properties = 'phase_1'
[]
[populate_u_slip]
type = WCNSFV2PSlipVelocityFunctorMaterial
slip_velocity_name = 'vel_slip_x'
momentum_component = 'x'
u = 'vel_x'
v = 'vel_y'
rho = ${rho}
mu = 'mu_mixture'
rho_d = ${rho_d}
particle_diameter = ${dp}
linear_coef_name = 'Darcy_coefficient'
outputs = 'out'
output_properties = 'vel_slip_x'
[]
[populate_v_slip]
type = WCNSFV2PSlipVelocityFunctorMaterial
slip_velocity_name = 'vel_slip_y'
momentum_component = 'y'
u = 'vel_x'
v = 'vel_y'
rho = ${rho}
mu = 'mu_mixture'
rho_d = ${rho_d}
particle_diameter = ${dp}
linear_coef_name = 'Darcy_coefficient'
outputs = 'out'
output_properties = 'vel_slip_y'
[]
[CD]
type = NSFVDispersePhaseDragFunctorMaterial
rho = 'rho_mixture'
mu = mu_mixture
u = 'vel_x'
v = 'vel_y'
particle_diameter = ${dp}
[]
[mixing_material]
type = NSFVMixtureFunctorMaterial
phase_2_names = '${rho} ${mu}'
phase_1_names = '${rho_d} ${mu_d}'
prop_names = 'rho_mixture mu_mixture'
phase_1_fraction = 'phase_2'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
nl_rel_tol = 1e-10
[]
[Preconditioning]
[SMP]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[]
[]
[Outputs]
[out]
type = Exodus
hide = 'Re lin cum_lin'
[]
[]
[Postprocessors]
[Re]
type = ParsedPostprocessor
expression = '${rho} * ${l} * ${U}'
[]
[lin]
type = NumLinearIterations
[]
[cum_lin]
type = CumulativeValuePostprocessor
postprocessor = lin
[]
[]
(test/tests/restart/scalar-var/part1.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 21
[]
[Variables]
[v]
type = MooseVariableFVReal
two_term_boundary_expansion = false
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[FVKernels]
[advection]
type = FVElementalAdvection
variable = v
velocity = '1 0 0'
[]
[lambda]
type = FVIntegralValueConstraint
variable = v
lambda = lambda
phi0 = 1
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
solve_type = NEWTON
[]
[Outputs]
[out]
type = Exodus
execute_on = 'final'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/pins/block-restriction/segregated/empty-block-segregated.i)
mu = 1.2
rho_fluid = 0.2
k_fluid = 1.1
cp_fluid = 2.3
T_cold = 310
alpha = 1e-3
Q = 200
pressure_tag = "pressure_grad"
[Problem]
kernel_coverage_check = false
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
velocity_interp_method = 'rc'
advected_interp_method = 'average'
[]
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '0.3683 0.0127'
dy = '0.0127 0.2292 2.5146 0.2292 0.0127'
ix = '2 1'
iy = '1 2 3 2 1'
subdomain_id = '0 0
1 0
2 0
1 0
0 0
'
[]
[rename_block_name]
type = RenameBlockGenerator
input = cmg
old_block = '0 1 2'
new_block = 'wall_block spacer_block porous_block'
[]
[solid_fluid_interface_1]
type = SideSetsBetweenSubdomainsGenerator
input = rename_block_name
primary_block = porous_block
paired_block = wall_block
new_boundary = 'solid_fluid_interface'
[]
[solid_fluid_interface_2]
type = SideSetsBetweenSubdomainsGenerator
input = solid_fluid_interface_1
primary_block = spacer_block
paired_block = wall_block
new_boundary = 'solid_fluid_interface'
[]
[wall_left_boundary_1]
type = SideSetsFromBoundingBoxGenerator
input = solid_fluid_interface_2
bottom_left = '0 0 0'
top_right = '0.1 0.0127 0'
included_boundaries = left
boundary_new = wall_left
[]
[wall_left_boundary_2]
type = SideSetsFromBoundingBoxGenerator
input = wall_left_boundary_1
bottom_left = '0 2.9857 0'
top_right = '0.1 2.9984 0'
included_boundaries = left
boundary_new = wall_left
[]
[fluid_left_boundary]
type = SideSetsFromBoundingBoxGenerator
input = wall_left_boundary_2
bottom_left = '0 0.0127 0'
top_right = '0.1 2.9857 0'
included_boundaries = left
boundary_new = fluid_left
[]
coord_type = RZ
rz_coord_axis = Y
[]
[UserObjects]
[rc]
type = PINSFVRhieChowInterpolatorSegregated
u = superficial_vel_x
v = superficial_vel_y
pressure = pressure
porosity = porosity
block = 'spacer_block porous_block'
[]
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system t_system'
previous_nl_solution_required = true
error_on_jacobian_nonzero_reallocation = true
[]
[Variables]
[superficial_vel_x]
type = PINSFVSuperficialVelocityVariable
block = 'spacer_block porous_block'
solver_sys = u_system
[]
[superficial_vel_y]
type = PINSFVSuperficialVelocityVariable
block = 'spacer_block porous_block'
solver_sys = v_system
[]
[pressure]
type = INSFVPressureVariable
block = 'spacer_block porous_block'
solver_sys = pressure_system
[]
[T_fluid]
type = INSFVEnergyVariable
block = 'spacer_block porous_block'
solver_sys = t_system
[]
[]
[AuxVariables]
[porosity]
type = MooseVariableFVReal
block = 'spacer_block porous_block'
[]
[]
[FVKernels]
[u_advection]
type = PINSFVMomentumAdvection
variable = superficial_vel_x
rho = ${rho_fluid}
momentum_component = 'x'
block = 'spacer_block porous_block'
porosity = porosity
[]
[u_viscosity]
type = PINSFVMomentumDiffusion
variable = superficial_vel_x
mu = ${mu}
momentum_component = 'x'
block = 'spacer_block porous_block'
porosity = porosity
[]
[u_pressure]
type = PINSFVMomentumPressure
variable = superficial_vel_x
momentum_component = 'x'
pressure = pressure
block = 'spacer_block porous_block'
porosity = porosity
extra_vector_tags = ${pressure_tag}
[]
[u_buoyancy]
type = PINSFVMomentumBoussinesq
variable = superficial_vel_x
T_fluid = T_fluid
gravity = '0 -1 0'
rho = ${rho_fluid}
ref_temperature = ${T_cold}
momentum_component = 'x'
block = 'spacer_block porous_block'
porosity = porosity
[]
[u_gravity]
type = PINSFVMomentumGravity
variable = superficial_vel_x
gravity = '0 -1 0'
rho = ${rho_fluid}
momentum_component = 'x'
block = 'spacer_block porous_block'
porosity = porosity
[]
[v_advection]
type = PINSFVMomentumAdvection
variable = superficial_vel_y
rho = ${rho_fluid}
momentum_component = 'y'
block = 'spacer_block porous_block'
porosity = porosity
[]
[v_viscosity]
type = PINSFVMomentumDiffusion
variable = superficial_vel_y
mu = ${mu}
momentum_component = 'y'
block = 'spacer_block porous_block'
porosity = porosity
[]
[v_pressure]
type = PINSFVMomentumPressure
variable = superficial_vel_y
momentum_component = 'y'
pressure = pressure
block = 'spacer_block porous_block'
porosity = porosity
extra_vector_tags = ${pressure_tag}
[]
[v_buoyancy]
type = PINSFVMomentumBoussinesq
variable = superficial_vel_y
T_fluid = T_fluid
gravity = '0 -1 0'
rho = ${rho_fluid}
ref_temperature = ${T_cold}
momentum_component = 'y'
block = 'spacer_block porous_block'
porosity = porosity
[]
[v_gravity]
type = PINSFVMomentumGravity
variable = superficial_vel_y
gravity = '0 -1 0'
rho = ${rho_fluid}
momentum_component = 'y'
block = 'spacer_block porous_block'
porosity = porosity
[]
[temp_conduction]
type = PINSFVEnergyDiffusion
k = 'k_fluid'
variable = T_fluid
block = 'spacer_block porous_block'
porosity = porosity
[]
[temp_advection]
type = PINSFVEnergyAdvection
variable = T_fluid
block = 'spacer_block porous_block'
boundaries_to_force = fluid_left
[]
[heat_source]
type = FVBodyForce
variable = T_fluid
function = ${Q}
block = 'porous_block'
[]
[p_diffusion]
type = FVAnisotropicDiffusion
variable = pressure
coeff = "Ainv"
coeff_interp_method = 'average'
block = 'spacer_block porous_block'
[]
[p_source]
type = FVDivergence
variable = pressure
vector_field = "HbyA"
force_boundary_execution = true
block = 'spacer_block porous_block'
[]
[]
[FVBCs]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = superficial_vel_x
boundary = 'solid_fluid_interface'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = superficial_vel_y
boundary = 'solid_fluid_interface'
function = 0
[]
[reflective_x]
type = INSFVSymmetryVelocityBC
variable = superficial_vel_x
boundary = fluid_left
momentum_component = 'x'
mu = ${mu}
u = superficial_vel_x
v = superficial_vel_y
[]
[reflective_y]
type = INSFVSymmetryVelocityBC
variable = superficial_vel_y
boundary = fluid_left
momentum_component = 'y'
mu = ${mu}
u = superficial_vel_x
v = superficial_vel_y
[]
[reflective_p]
type = INSFVSymmetryPressureBC
boundary = fluid_left
variable = pressure
[]
[T_reflective]
type = FVNeumannBC
variable = T_fluid
boundary = fluid_left
value = 0
[]
[T_cold_boundary]
type = FVDirichletBC
variable = T_fluid
boundary = solid_fluid_interface
value = ${T_cold}
[]
[]
[ICs]
[porosity_spacer]
type = ConstantIC
variable = porosity
block = spacer_block
value = 1.0
[]
[porosity_fuel]
type = ConstantIC
variable = porosity
block = porous_block
value = 0.1
[]
[temp_ic_fluid]
type = ConstantIC
variable = T_fluid
value = ${T_cold}
block = 'spacer_block porous_block'
[]
[superficial_vel_x]
type = ConstantIC
variable = superficial_vel_x
value = 1E-5
block = 'spacer_block porous_block'
[]
[superficial_vel_y]
type = ConstantIC
variable = superficial_vel_y
value = 1E-5
block = 'spacer_block porous_block'
[]
[]
[FunctorMaterials]
[functor_constants_fluid]
type = ADGenericFunctorMaterial
prop_names = 'alpha_b cp k_fluid'
prop_values = '${alpha} ${cp_fluid} ${k_fluid}'
block = 'spacer_block porous_block'
[]
[density_fluid]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T_fluid'
rho = ${rho_fluid}
block = 'spacer_block porous_block'
[]
[functor_constants_steel]
# We need this to avoid errors for materials not existing on every block
type = ADGenericFunctorMaterial
prop_names = 'dummy'
prop_values = 0.0
block = wall_block
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
energy_l_abs_tol = 1e-14
momentum_l_tol = 0
pressure_l_tol = 0
energy_l_tol = 0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
energy_system = 't_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.85
energy_equation_relaxation = 0.95
pressure_variable_relaxation = 0.45
num_iterations = 150
pressure_absolute_tolerance = 1e-13
momentum_absolute_tolerance = 1e-13
pin_pressure = true
pressure_pin_point = '0.2 1.5 0.0'
pressure_pin_value = 0
print_fields = false
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/heated/2d-rc-heated-boussinesq-action.i)
mu = 1
rho = 1
k = 1e-3
cp = 1
v_inlet = 1
T_inlet = 200
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 2
ymin = 0
ymax = 10
nx = 20
ny = 100
[]
[]
[AuxVariables]
[T_solid]
type = MooseVariableFVReal
initial_condition = 100
[]
[porosity]
type = MooseVariableFVReal
initial_condition = 0.4
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'incompressible'
porous_medium_treatment = true
add_energy_equation = true
boussinesq_approximation = true
density = ${rho}
dynamic_viscosity = ${mu}
thermal_conductivity = ${k}
specific_heat = ${cp}
porosity = 'porosity'
thermal_expansion = 8e-4
gravity = '0 -9.81 0'
ref_temperature = 150
initial_velocity = '1e-6 ${v_inlet} 0'
initial_pressure = 0.0
initial_temperature = 0.0
inlet_boundaries = 'bottom'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_function = '0 ${v_inlet}'
energy_inlet_types = 'heatflux'
energy_inlet_function = '${fparse v_inlet * rho * cp * T_inlet}'
wall_boundaries = 'right left'
momentum_wall_types = 'noslip symmetry'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '0 0'
outlet_boundaries = 'top'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '0'
ambient_convection_alpha = 1e-3
ambient_temperature = 'T_solid'
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
energy_advection_interpolation = 'average'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
[]
# Some basic Postprocessors to examine the solution
[Postprocessors]
[inlet-p]
type = SideAverageValue
variable = pressure
boundary = 'top'
[]
[outlet-v]
type = SideAverageValue
variable = superficial_vel_y
boundary = 'top'
[]
[outlet-temp]
type = SideAverageValue
variable = T_fluid
boundary = 'top'
[]
[]
[Outputs]
exodus = true
csv = false
[]
(modules/heat_transfer/test/tests/fvbcs/fv_thermal_resistance/test.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmax = 2
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
initial_condition = 0.5
[]
[]
[FVKernels]
[diff_left]
type = FVDiffusion
variable = u
coeff = 4
[]
[gradient_creating]
type = FVBodyForce
variable = u
[]
[]
[FVBCs]
[left]
type = FVThermalResistanceBC
geometry = 'cartesian'
variable = u
T_ambient = 10
htc = 'htc'
emissivity = 0.2
thermal_conductivities = '0.1 0.2 0.3'
conduction_thicknesses = '1 0.7 0.2'
boundary = 'left'
# Test setting iteration parameters
step_size = 0.02
max_iterations = 120
tolerance = 1e-4
[]
[top]
type = FVThermalResistanceBC
geometry = 'cartesian'
variable = u
# Test setting the temperature separately from the variable
temperature = 'u'
T_ambient = 14
htc = 'htc'
emissivity = 0
thermal_conductivities = '0.1 0.2 0.3'
conduction_thicknesses = '1 0.7 0.4'
boundary = 'top'
[]
[other]
type = FVDirichletBC
variable = u
boundary = 'right bottom'
value = 0
[]
[]
[Materials]
[cht]
type = ADGenericConstantMaterial
prop_names = 'htc'
prop_values = '1'
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/examples/laser-welding/2d-fv.i)
period=.2e-4 # s
endtime=${fparse 3 * period} # s
timestep=${fparse period / 100} # s
surfacetemp=2700 # K
bottomtemp=2700 # K
sb=5.67e-8 # W/(m^2 K^4)
advected_interp_method='upwind'
velocity_interp_method='rc'
rho='rho'
mu='mu'
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -.7e-3 # m
xmax = 0.7e-3 # m
ymin = -.35e-3 # m
ymax = 0
nx = 75
ny = 20
displacements = 'disp_x disp_y'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
use_displaced_mesh = true
disp_x = disp_x
disp_y = disp_y
[]
[]
[Problem]
extra_tag_vectors = 'e_time e_advection e_conduction e_laser e_radiation e_mesh_advection'
[]
[AuxVariables]
[mu_out]
type = MooseVariableFVReal
[]
[e_time]
type = MooseVariableFVReal
[]
[e_advection]
type = MooseVariableFVReal
[]
[e_mesh_advection]
type = MooseVariableFVReal
[]
[e_conduction]
type = MooseVariableFVReal
[]
[e_laser]
type = MooseVariableFVReal
[]
[e_radiation]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[mu_out]
type = FunctorAux
functor = mu
variable = mu_out
execute_on = timestep_end
[]
[e_time]
variable = e_time
vector_tag = e_time
v = T
execute_on = 'timestep_end'
type = TagVectorAux
[]
[e_advection]
variable = e_advection
vector_tag = e_advection
v = T
execute_on = 'timestep_end'
type = TagVectorAux
[]
[e_mesh_advection]
variable = e_mesh_advection
vector_tag = e_mesh_advection
v = T
execute_on = 'timestep_end'
type = TagVectorAux
[]
[e_conduction]
variable = e_conduction
vector_tag = e_conduction
v = T
execute_on = 'timestep_end'
type = TagVectorAux
[]
[e_laser]
variable = e_laser
vector_tag = e_laser
v = T
execute_on = 'timestep_end'
type = TagVectorAux
[]
[e_radiation]
variable = e_radiation
vector_tag = e_radiation
v = T
execute_on = 'timestep_end'
type = TagVectorAux
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
[]
[vel_y]
type = INSFVVelocityVariable
[]
[T]
type = INSFVEnergyVariable
[]
[pressure]
type = INSFVPressureVariable
[]
[disp_x]
[]
[disp_y]
[]
[]
[ICs]
[T]
type = FunctionIC
variable = T
function = '${surfacetemp} + ((${surfacetemp} - ${bottomtemp}) / .35e-3) * y'
[]
[]
[Kernels]
[disp_x]
type = MatDiffusion
variable = disp_x
diffusivity = 1e6
[]
[disp_y]
type = MatDiffusion
variable = disp_y
diffusivity = 1e6
[]
[]
[FVKernels]
# pressure equation
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
use_displaced_mesh = true
boundaries_to_force = top
[]
# momentum equations
# u equation
[u_time]
type = INSFVMomentumTimeDerivative
variable = vel_x
rho = ${rho}
momentum_component = 'x'
use_displaced_mesh = true
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'x'
use_displaced_mesh = true
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
use_displaced_mesh = true
[]
[u_pressure]
type = INSFVMomentumPressureFlux
variable = vel_x
momentum_component = 'x'
pressure = pressure
use_displaced_mesh = true
[]
[u_mesh_advection_volumetric]
type = INSFVMomentumMeshAdvection
variable = vel_x
momentum_component = 'x'
rho = ${rho}
disp_x = disp_x
disp_y = disp_y
add_to_a = false
use_displaced_mesh = true
[]
# v equation
[v_time]
type = INSFVMomentumTimeDerivative
variable = vel_y
rho = ${rho}
momentum_component = 'y'
use_displaced_mesh = true
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'y'
use_displaced_mesh = true
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
use_displaced_mesh = true
[]
[v_pressure]
type = INSFVMomentumPressureFlux
variable = vel_y
momentum_component = 'y'
pressure = pressure
use_displaced_mesh = true
[]
[v_mesh_advection_volumetric]
type = INSFVMomentumMeshAdvection
variable = vel_y
momentum_component = 'y'
rho = ${rho}
disp_x = disp_x
disp_y = disp_y
add_to_a = false
use_displaced_mesh = true
[]
# energy equation
[temperature_time]
type = INSFVEnergyTimeDerivative
variable = T
rho = ${rho}
dh_dt = dh_dt
use_displaced_mesh = true
extra_vector_tags = 'e_time'
[]
[temperature_advection]
type = INSFVEnergyAdvection
variable = T
use_displaced_mesh = true
extra_vector_tags = 'e_advection'
[]
[temperature_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
use_displaced_mesh = true
extra_vector_tags = 'e_conduction'
[]
[temperature_mesh_advection_volumetric]
type = INSFVMeshAdvection
variable = T
rho = ${rho}
disp_x = disp_x
disp_y = disp_y
advected_quantity = 'h'
use_displaced_mesh = true
extra_vector_tags = 'e_mesh_advection'
[]
[]
[FVBCs]
# momentum boundary conditions
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'bottom right left'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'bottom right left'
function = 0
[]
[vapor_recoil_x]
type = INSFVVaporRecoilPressureMomentumFluxBC
variable = vel_x
boundary = 'top'
momentum_component = 'x'
rc_pressure = rc_pressure
use_displaced_mesh = true
[]
[vapor_recoil_y]
type = INSFVVaporRecoilPressureMomentumFluxBC
variable = vel_y
boundary = 'top'
momentum_component = 'y'
rc_pressure = rc_pressure
use_displaced_mesh = true
[]
# energy boundary conditions
[T_cold]
type = FVDirichletBC
variable = T
boundary = 'bottom'
value = '${bottomtemp}'
[]
[radiation_flux]
type = FVFunctorRadiativeBC
variable = T
boundary = 'top'
emissivity = '1'
Tinfinity = 300
stefan_boltzmann_constant = ${sb}
use_displaced_mesh = true
extra_vector_tags = 'e_radiation'
[]
[weld_flux]
type = FVGaussianEnergyFluxBC
variable = T
boundary = 'top'
P0 = 159.96989792079225
R = 1.25e-4
x_beam_coord = '2e-4 * sin(t * 2 * pi / ${period})'
y_beam_coord = 0
z_beam_coord = 0
use_displaced_mesh = true
extra_vector_tags = 'e_laser'
[]
[]
[BCs]
# displacement boundary conditions
[x_no_disp]
type = DirichletBC
variable = disp_x
boundary = 'bottom'
value = 0
[]
[y_no_disp]
type = DirichletBC
variable = disp_y
boundary = 'bottom'
value = 0
[]
[displace_x_top]
type = INSADDisplaceBoundaryBC
boundary = 'top'
variable = 'disp_x'
velocity = 'vel'
component = 0
associated_subdomain = 0
[]
[displace_y_top]
type = INSADDisplaceBoundaryBC
boundary = 'top'
variable = 'disp_y'
velocity = 'vel'
component = 1
associated_subdomain = 0
[]
[displace_x_top_dummy]
type = INSADDummyDisplaceBoundaryIntegratedBC
boundary = 'top'
variable = 'disp_x'
velocity = 'vel'
component = 0
[]
[displace_y_top_dummy]
type = INSADDummyDisplaceBoundaryIntegratedBC
boundary = 'top'
variable = 'disp_y'
velocity = 'vel'
component = 1
[]
[]
[FunctorMaterials]
[steel]
type = AriaLaserWeld304LStainlessSteelFunctorMaterial
temperature = T
beta = 1e7
[]
[disp_vec_value_and_dot]
type = ADGenericVectorFunctorMaterial
prop_names = 'disp_vec'
prop_values = 'disp_x disp_y 0'
[]
[vel]
type = ADGenericVectorFunctorMaterial
prop_names = 'vel'
prop_values = 'vel_x vel_y 0'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_mat_solver_type -mat_mffd_err'
petsc_options_value = 'lu NONZERO strumpack 1e-6'
[]
[]
[Executioner]
type = Transient
end_time = ${endtime}
dtmin = 1e-8
dtmax = ${timestep}
petsc_options = '-snes_converged_reason -ksp_converged_reason -options_left'
solve_type = 'PJFNK'
line_search = 'none'
nl_max_its = 12
l_max_its = 100
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 7
dt = ${timestep}
linear_iteration_ratio = 1e6
growth_factor = 1.1
[]
[]
[Outputs]
exodus = true
csv = true
[]
[Debug]
show_var_residual_norms = true
[]
[Postprocessors]
[laser_flux]
type = TagVectorSum
vector = 'e_laser'
[]
[volume_rho_cp_dT]
type = TagVectorSum
vector = 'e_time'
[]
[conduction]
type = TagVectorSum
vector = 'e_conduction'
[]
[advection]
type = TagVectorSum
vector = 'e_advection'
[]
[mesh_advection]
type = TagVectorSum
vector = 'e_mesh_advection'
[]
[radiation]
type = TagVectorSum
vector = 'e_radiation'
[]
[total_sum]
type = ParsedPostprocessor
expression = 'laser_flux + volume_rho_cp_dT + advection + mesh_advection + conduction + radiation'
pp_names = 'laser_flux volume_rho_cp_dT advection mesh_advection conduction radiation'
[]
[]
(test/tests/mesh/preparedness/test.i)
[GlobalParams]
prevent_boundary_ids_overlap = false
[]
[Mesh]
[region_2_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.065 0.13 0.305 0.17 0.196'
ix = ' 2 2 2 2 2'
dy = '0.85438 '
iy = '6'
subdomain_id = '68 68 68 68 68'
[]
[region_2_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '1.2 1.551 0'
input = region_2_gen
[]
[region_3_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.24 0.24 0.24 0.24 0.24'
ix = ' 2 2 2 2 2'
dy = '0.744166666666666 0.744166666666667 0.744166666666667'
iy = ' 2 2 2'
subdomain_id = '56 57 58 59 60
51 52 53 54 55
46 47 48 49 50'
[]
[region_3_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '0 2.40538 0'
input = region_3_gen
[]
[region_1_gen]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 6
xmin = 0
xmax = 0.26
ymin = 1.551
ymax = 1.851
subdomain_ids = '62 62 62 62 62 62 62 62 62 62
62 62 62 62 62 62 62 62 62 62
62 62 62 62 62 62 62 62 62 62
62 62 62 62 62 62 62 62 62 62
62 62 62 62 62 62 62 62 62 62
62 62 62 62 62 62 62 62 62 62'
[]
[region_1_extend_1]
type = FillBetweenSidesetsGenerator
input_mesh_1 = 'region_3_move'
input_mesh_2 = 'region_1_gen'
boundary_1 = '0'
boundary_2 = '2'
num_layers = 6
block_id= 61
use_quad_elements = true
keep_inputs = true
begin_side_boundary_id = '3'
end_side_boundary_id = '1'
[]
[region_1_extend_2]
type = FillBetweenSidesetsGenerator
input_mesh_1 = 'region_2_move'
input_mesh_2 = 'region_1_gen'
boundary_1 = 3
boundary_2 = 1
num_layers = 6
block_id= 69
use_quad_elements = true
keep_inputs = false
begin_side_boundary_id = '0'
end_side_boundary_id = '3'
input_boundary_1_id = '1'
input_boundary_2_id = '3'
[]
[region_2_2_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.065 0.13 0.305 0.17 0.196'
ix = ' 2 2 2 2 2'
dy = '0.85438 '
iy = '6'
subdomain_id = '68 68 68 68 68'
[]
[region_2_2_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '1.2 1.551 0'
input = region_2_2_gen
[]
[region_6_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.26 0.94 0.065 0.13 0.305 0.17 0.196'
ix = '10 6 2 2 2 2 2'
dy = '0.584 0.967'
iy = ' 4 6'
subdomain_id = '62 72 72 72 72 72 72
62 70 71 71 71 71 71'
[]
[stitch_1_2_6]
type = StitchedMeshGenerator
inputs = 'region_1_extend_1 region_1_extend_2 region_2_2_move region_6_gen'
stitch_boundaries_pairs = '1 3;
1 3;
0 2'
[]
[rename_boundary_stitch_1_2_6]
type = RenameBoundaryGenerator
input = stitch_1_2_6
old_boundary = '1'
new_boundary = '2'
[]
[region_4_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.065 0.13'
ix = ' 2 2 '
dy = '0.744166666666666 0.744166666666667 0.744166666666667'
iy = ' 2 2 2'
subdomain_id = '78 92
78 91
78 90'
[]
[region_4_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '1.2 2.40538 0'
input = region_4_gen
[]
[region_5_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.17 0.196'
ix = '2 2'
dy = '0.39 1.8425'
iy = '2 4'
subdomain_id = '100 104
100 104'
[]
[region_5_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '1.7 2.40538 0'
input = region_5_gen
[]
[region_5_extend]
type = FillBetweenSidesetsGenerator
input_mesh_1 = 'region_4_move'
input_mesh_2 = 'region_5_move'
boundary_1 = 1
boundary_2 = 3
num_layers = 2
block_id= 96
use_quad_elements = true
keep_inputs = true
begin_side_boundary_id = '0'
end_side_boundary_id = '2'
[]
[rename_boundary_region_5]
type = RenameBoundaryGenerator
input = region_5_extend
old_boundary = '0'
new_boundary = '3'
[]
[stitch_1_2_6_5]
type = StitchedMeshGenerator
inputs = 'rename_boundary_stitch_1_2_6 rename_boundary_region_5'
stitch_boundaries_pairs = '2 3;'
[]
[region_7_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.24 0.24 0.24 0.24 0.24 0.065 0.13 0.305 0.17 0.196'
ix = ' 2 2 2 2 2 2 2 2 2 2'
dy = '0.744166666666667 0.744166666666667 0.744166666666667 0.744166666666667
0.744166666666667 0.744166666666667 0.744166666666666 0.744166666666666
0.744166666666666 0.458 0.86002'
iy = '2 2 2 2 2 2 2 2 2 2 4'
subdomain_id = '41 42 43 44 45 77 89 95 99 103
36 37 38 39 40 77 88 95 99 103
31 32 33 34 35 77 87 95 99 103
26 27 28 29 30 76 86 94 98 102
21 22 23 24 25 76 85 94 98 102
16 17 18 19 20 76 84 94 98 102
11 12 13 14 15 75 83 93 97 101
6 7 8 9 10 75 82 93 97 101
1 2 3 4 5 75 81 93 97 101
67 67 67 67 67 74 80 65 65 66
63 63 63 63 63 73 79 64 64 64'
[]
[region_7_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '0.0 4.63788 0'
input = region_7_gen
[]
[stitch]
type = StitchedMeshGenerator
inputs = 'stitch_1_2_6_5 region_7_move'
stitch_boundaries_pairs = '2 0'
[]
[rename_boundary_1]
type = BoundaryDeletionGenerator
input = stitch
boundary_names = '0 1 2 3'
[]
[rename_boundary_2]
type = SideSetsFromPointsGenerator
input = rename_boundary_1
new_boundary = '2 4 1 3'
points = '1.2 0. 0.
2.066 1.551 0.
1.2 12.6534 0.
0. 1.551 0.'
[]
[rename_boundary_3]
type = RenameBoundaryGenerator
input = rename_boundary_2
new_boundary = 'rbottom ssright rtop ssleft'
old_boundary = '2 4 1 3'
[]
[rename_blocks]
type = RenameBlockGenerator
input = rename_boundary_3
old_block = '1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
101 102 103 104'
new_block = 'pbedfuel001 pbedfuel002 pbedfuel003 pbedfuel004 pbedfuel005
pbedfuel006 pbedfuel007 pbedfuel008 pbedfuel009 pbedfuel010
pbedfuel011 pbedfuel012 pbedfuel013 pbedfuel014 pbedfuel015
pbedfuel016 pbedfuel017 pbedfuel018 pbedfuel019 pbedfuel020
pbedfuel021 pbedfuel022 pbedfuel023 pbedfuel024 pbedfuel025
pbedfuel026 pbedfuel027 pbedfuel028 pbedfuel029 pbedfuel030
pbedfuel031 pbedfuel032 pbedfuel033 pbedfuel034 pbedfuel035
pbedfuel036 pbedfuel037 pbedfuel038 pbedfuel039 pbedfuel040
pbedfuel041 pbedfuel042 pbedfuel043 pbedfuel044 pbedfuel045
pbedfuel046 pbedfuel047 pbedfuel048 pbedfuel049 pbedfuel050
pbedfuel051 pbedfuel052 pbedfuel053 pbedfuel054 pbedfuel055
pbedfuel056 pbedfuel057 pbedfuel058 pbedfuel059 pbedfuel060
consfuel061 dischfuel062 upref063 upref064 upref065 upref066
upcvt067 lwref068 outch069 lwrpln070 htleg071 lwref072 buffr073
buffr074 buffr075 buffr076 buffr077 buffr078 crds079 crds080
crds081 crds082 crds083 crds084 crds085 crds086 crds087 crds088
crds089 crds090 crds091 crds092 radrf093 radrf094 radrf095 radrf096
risr097 risr098 risr099 risr100 radrf101 radrf102 radrf103 radrf104'
[]
[]
[Variables]
[T_solid]
type = MooseVariableFVReal
initial_condition = 100
[]
[]
[FVKernels]
[energy_storage]
type = FVTimeKernel
variable = T_solid
[]
[solid_energy_diffusion_core]
type = FVAnisotropicDiffusion
variable = T_solid
coeff = 'effective_thermal_conductivity'
[]
[]
[FVBCs]
[side_set_bc1]
type = FVDirichletBC
variable = T_solid
value = '300'
boundary = 'rtop'
[]
[side_set_bc2]
type = FVDirichletBC
variable = T_solid
value = '600'
boundary = 'rbottom'
[]
[]
[Materials]
[all_channels_porosity]
type = ADGenericFunctorMaterial
prop_names = 'porosity'
prop_values = 0.5
[]
[solid_blocks_full_density_graphite]
type = ADGenericFunctorMaterial
prop_names = 'rho_s cp_s k_s '
prop_values = '1.0 2.0 3.0'
[]
[effective_solid_thermal_conductivity_solid_only]
type = ADGenericVectorFunctorMaterial
prop_names = 'effective_thermal_conductivity'
prop_values = 'k_s k_s k_s'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_factor_shift_type'
petsc_options_value = 'lu 100 NONZERO'
# Tolerances.
nl_abs_tol = 1e-8
nl_rel_tol = 1e-9
line_search = none
nl_max_its = 15
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.05
cutback_factor = 0.5
growth_factor = 2.00
optimal_iterations = 6
[]
# Steady state detection.
steady_state_detection = true
steady_state_tolerance = 1e-13
abort_on_solve_fail = true
num_steps = 1
[]
[Outputs]
exodus = true
print_linear_residuals = false
print_linear_converged_reason = false
print_nonlinear_converged_reason = false
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/lid-driven-turb-capped.i)
##########################################################
# Lid-driven cavity test
# Reynolds: 5,000
# Author: Dr. Mauricio Tano
# Last Update: Novomber, 2023
# Turbulent model using:
# k-epsilon model with capped mixing length
# Standard wall functions
# SIMPLE Solve
##########################################################
### Thermophsyical Properties ###
mu = 2e-5
rho = 1.0
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epslilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Modeling parameters ###
non_equilibrium_treatment = false
bulk_wall_treatment = false
walls = 'left top right bottom'
max_mixing_length = 0.1
linearized_yplus_mu_t = false
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
pressure_tag = "pressure_grad"
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolatorSegregated
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 0.0
solver_sys = u_system
two_term_boundary_expansion = false
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 0.0
solver_sys = v_system
two_term_boundary_expansion = false
[]
[pressure]
type = INSFVPressureVariable
solver_sys = pressure_system
initial_condition = 0.2
two_term_boundary_expansion = false
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
[]
[]
[FVKernels]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = true
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = true
u = vel_x
v = vel_y
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[p_diffusion]
type = FVAnisotropicDiffusion
variable = pressure
coeff = "Ainv"
coeff_interp_method = 'average'
[]
[p_source]
type = FVDivergence
variable = pressure
vector_field = "HbyA"
force_boundary_execution = true
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
non_equilibrium_treatment = ${non_equilibrium_treatment}
max_mixing_length = ${max_mixing_length}
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
k = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
non_equilibrium_treatment = ${non_equilibrium_treatment}
max_mixing_length = ${max_mixing_length}
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${lid_velocity}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = 'left right top bottom'
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
k = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
linearized_yplus = ${linearized_yplus_mu_t}
non_equilibrium_treatment = ${non_equilibrium_treatment}
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKED_system TKE_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.5
turbulence_equation_relaxation = '0.8 0.8'
num_iterations = 500
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
[]
[Outputs]
exodus = true
csv = false
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
(modules/porous_flow/test/tests/poroperm/PermFromPoro01_fv.i)
# Testing permeability from porosity
# Trivial test, checking calculated permeability is correct
# k = k_anisotropic * f * d^2 * phi^n / (1-phi)^m
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 3
xmin = 0
xmax = 3
[]
[]
[GlobalParams]
block = 0
PorousFlowDictator = dictator
[]
[Variables]
[pp]
type = MooseVariableFVReal
[FVInitialCondition]
type = FVConstantIC
value = 0
[]
[]
[]
[FVKernels]
[flux]
type = FVPorousFlowAdvectiveFlux
gravity = '0 0 0'
variable = pp
[]
[]
[FVBCs]
[ptop]
type = FVDirichletBC
variable = pp
boundary = right
value = 0
[]
[pbase]
type = FVDirichletBC
variable = pp
boundary = left
value = 1
[]
[]
[AuxVariables]
[poro]
type = MooseVariableFVReal
[]
[perm_x]
type = MooseVariableFVReal
[]
[perm_y]
type = MooseVariableFVReal
[]
[perm_z]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[poro]
type = ADPorousFlowPropertyAux
property = porosity
variable = poro
[]
[perm_x]
type = ADPorousFlowPropertyAux
property = permeability
variable = perm_x
row = 0
column = 0
[]
[perm_y]
type = ADPorousFlowPropertyAux
property = permeability
variable = perm_y
row = 1
column = 1
[]
[perm_z]
type = ADPorousFlowPropertyAux
property = permeability
variable = perm_z
row = 2
column = 2
[]
[]
[Postprocessors]
[perm_x_bottom]
type = PointValue
variable = perm_x
point = '0 0 0'
[]
[perm_y_bottom]
type = PointValue
variable = perm_y
point = '0 0 0'
[]
[perm_z_bottom]
type = PointValue
variable = perm_z
point = '0 0 0'
[]
[perm_x_top]
type = PointValue
variable = perm_x
point = '3 0 0'
[]
[perm_y_top]
type = PointValue
variable = perm_y
point = '3 0 0'
[]
[perm_z_top]
type = PointValue
variable = perm_z
point = '3 0 0'
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp'
number_fluid_phases = 1
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
# unimportant in this fully-saturated test
m = 0.8
alpha = 1e-4
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 2.2e9
viscosity = 1e-3
density0 = 1000
thermal_expansion = 0
[]
[]
[Materials]
[permeability]
type = ADPorousFlowPermeabilityKozenyCarman
k_anisotropy = '1 0 0 0 2 0 0 0 0.1'
poroperm_function = kozeny_carman_fd2
f = 0.1
d = 5
m = 2
n = 7
[]
[temperature]
type = ADPorousFlowTemperature
[]
[massfrac]
type = ADPorousFlowMassFraction
[]
[eff_fluid_pressure]
type = ADPorousFlowEffectiveFluidPressure
[]
[ppss]
type = ADPorousFlow1PhaseP
porepressure = pp
capillary_pressure = pc
[]
[simple_fluid]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[porosity]
type = ADPorousFlowPorosityConst
porosity = 0.1
[]
[relperm]
type = ADPorousFlowRelativePermeabilityCorey
n = 0 # unimportant in this fully-saturated situation
phase = 0
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = Newton
type = Steady
l_tol = 1E-5
nl_abs_tol = 1E-3
nl_rel_tol = 1E-8
l_max_its = 200
nl_max_its = 400
[]
[Outputs]
file_base = 'PermFromPoro01_out'
csv = true
execute_on = 'timestep_end'
[]
(modules/navier_stokes/test/tests/finite_volume/pins/mms/porosity_change/pressure-interpolation-corrected.i)
mu = 1.1
rho = 1.1
advected_interp_method = 'average'
velocity_interp_method = 'rc'
darcy = 1.1
forch = 1.1
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 2
ymin = -1
ymax = 1
nx = 2
ny = 2
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
Darcy_name = 'Darcy_coefficient'
Forchheimer_name = 'Forchheimer_coefficient'
porosity = porosity
[]
[UserObjects]
[rc]
type = PINSFVRhieChowInterpolator
u = u
v = v
porosity = porosity
pressure = pressure
smoothing_layers = 2
[]
[]
[Variables]
[u]
type = PINSFVSuperficialVelocityVariable
initial_condition = 1
[]
[v]
type = PINSFVSuperficialVelocityVariable
initial_condition = 1
[]
[pressure]
type = INSFVPressureVariable
[]
[]
[AuxVariables]
[eps_out]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[eps_out]
type = FunctorAux
variable = eps_out
functor = porosity
execute_on = 'timestep_end'
[]
[]
[FVKernels]
[mass]
type = PINSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[mass_forcing]
type = FVBodyForce
variable = pressure
function = forcing_p
[]
[u_advection]
type = PINSFVMomentumAdvection
variable = u
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = PINSFVMomentumDiffusion
variable = u
mu = ${mu}
porosity = porosity
momentum_component = 'x'
[]
[u_pressure]
type = PINSFVMomentumPressure
variable = u
pressure = pressure
porosity = porosity
momentum_component = 'x'
[]
[u_drag]
type = PINSFVMomentumFriction
variable = u
momentum_component = 'x'
rho = ${rho}
speed = speed
mu = ${mu}
[]
[u_correction]
type = PINSFVMomentumFrictionCorrection
variable = u
momentum_component = 'x'
rho = ${rho}
speed = speed
mu = ${mu}
[]
[u_forcing]
type = INSFVBodyForce
variable = u
functor = forcing_u
momentum_component = 'x'
[]
[v_advection]
type = PINSFVMomentumAdvection
variable = v
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = PINSFVMomentumDiffusion
variable = v
mu = ${mu}
porosity = porosity
momentum_component = 'y'
[]
[v_pressure]
type = PINSFVMomentumPressure
variable = v
pressure = pressure
porosity = porosity
momentum_component = 'y'
[]
[v_drag]
type = PINSFVMomentumFriction
variable = v
momentum_component = 'y'
rho = ${rho}
speed = speed
mu = ${mu}
[]
[v_correction]
type = PINSFVMomentumFrictionCorrection
variable = v
momentum_component = 'y'
rho = ${rho}
speed = speed
mu = ${mu}
[]
[v_forcing]
type = INSFVBodyForce
variable = v
functor = forcing_v
momentum_component = 'y'
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = u
functor = 'exact_u'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = v
functor = 'exact_v'
[]
[walls-u]
type = INSFVNoSlipWallBC
boundary = 'top bottom'
variable = u
function = 'exact_u'
[]
[walls-v]
type = INSFVNoSlipWallBC
boundary = 'top bottom'
variable = v
function = 'exact_v'
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = 'exact_p'
[]
[]
[FunctorMaterials]
[darcy]
type = ADGenericVectorFunctorMaterial
prop_names = 'Darcy_coefficient Forchheimer_coefficient'
prop_values = '${darcy} ${darcy} ${darcy} ${forch} ${forch} ${forch}'
[]
[speed]
type = PINSFVSpeedFunctorMaterial
superficial_vel_x = u
superficial_vel_y = v
porosity = porosity
[]
[]
[Functions]
[porosity]
type = ParsedFunction
expression = '.5 + .1 * sin(pi * x / 4) * cos(pi * y / 4)'
[]
[exact_u]
type = ParsedFunction
expression = 'sin((1/2)*y*pi)*cos((1/2)*x*pi)'
[]
[forcing_u]
type = ParsedFunction
expression = 'darcy*mu*sin((1/2)*y*pi)*cos((1/2)*x*pi) + (1/2)*forch*rho*sqrt(sin((1/4)*x*pi)^2*cos((1/2)*y*pi)^2 + sin((1/2)*y*pi)^2*cos((1/2)*x*pi)^2)*sin((1/2)*y*pi)*cos((1/2)*x*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5) - mu*(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5)*(0.1*pi^2*sin((1/4)*x*pi)*sin((1/4)*y*pi)*cos((1/2)*x*pi)*cos((1/2)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 + 0.025*pi^2*sin((1/4)*x*pi)*sin((1/2)*y*pi)*cos((1/2)*x*pi)*cos((1/4)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 + 0.01*pi^2*sin((1/4)*x*pi)^2*sin((1/4)*y*pi)^2*sin((1/2)*y*pi)*cos((1/2)*x*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^3 - 1/4*pi^2*sin((1/2)*y*pi)*cos((1/2)*x*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5)) - mu*(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5)*(0.025*pi^2*sin((1/4)*x*pi)*sin((1/2)*y*pi)*cos((1/2)*x*pi)*cos((1/4)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 + 0.1*pi^2*sin((1/2)*x*pi)*sin((1/2)*y*pi)*cos((1/4)*x*pi)*cos((1/4)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 + 0.01*pi^2*sin((1/2)*y*pi)*cos((1/4)*x*pi)^2*cos((1/2)*x*pi)*cos((1/4)*y*pi)^2/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^3 - 1/4*pi^2*sin((1/2)*y*pi)*cos((1/2)*x*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5)) + 0.025*pi*mu*(0.1*pi*sin((1/4)*x*pi)*sin((1/4)*y*pi)*sin((1/2)*y*pi)*cos((1/2)*x*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 + (1/2)*pi*cos((1/2)*x*pi)*cos((1/2)*y*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5))*sin((1/4)*x*pi)*sin((1/4)*y*pi) - 0.025*pi*mu*(-0.1*pi*sin((1/2)*y*pi)*cos((1/4)*x*pi)*cos((1/2)*x*pi)*cos((1/4)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 - 1/2*pi*sin((1/2)*x*pi)*sin((1/2)*y*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5))*cos((1/4)*x*pi)*cos((1/4)*y*pi) + 0.1*pi*rho*sin((1/4)*x*pi)^2*sin((1/4)*y*pi)*sin((1/2)*y*pi)*cos((1/2)*x*pi)*cos((1/2)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 - 0.1*pi*rho*sin((1/2)*y*pi)^2*cos((1/4)*x*pi)*cos((1/2)*x*pi)^2*cos((1/4)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 - 1/2*pi*rho*sin((1/4)*x*pi)*sin((1/2)*y*pi)^2*cos((1/2)*x*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5) + (1/2)*pi*rho*sin((1/4)*x*pi)*cos((1/2)*x*pi)*cos((1/2)*y*pi)^2/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5) - pi*rho*sin((1/2)*x*pi)*sin((1/2)*y*pi)^2*cos((1/2)*x*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5) - 1/4*pi*(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5)*sin((1/4)*x*pi)*sin((3/2)*y*pi)'
symbol_names = 'mu rho darcy forch'
symbol_values = '${mu} ${rho} ${darcy} ${forch}'
[]
[exact_v]
type = ParsedFunction
expression = 'sin((1/4)*x*pi)*cos((1/2)*y*pi)'
[]
[forcing_v]
type = ParsedFunction
expression = 'darcy*mu*sin((1/4)*x*pi)*cos((1/2)*y*pi) + (1/2)*forch*rho*sqrt(sin((1/4)*x*pi)^2*cos((1/2)*y*pi)^2 + sin((1/2)*y*pi)^2*cos((1/2)*x*pi)^2)*sin((1/4)*x*pi)*cos((1/2)*y*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5) - mu*(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5)*(-0.1*pi^2*sin((1/4)*x*pi)^2*sin((1/4)*y*pi)*sin((1/2)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 + 0.025*pi^2*sin((1/4)*x*pi)^2*cos((1/4)*y*pi)*cos((1/2)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 + 0.01*pi^2*sin((1/4)*x*pi)^3*sin((1/4)*y*pi)^2*cos((1/2)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^3 - 1/4*pi^2*sin((1/4)*x*pi)*cos((1/2)*y*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5)) - mu*(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5)*(0.025*pi^2*sin((1/4)*x*pi)^2*cos((1/4)*y*pi)*cos((1/2)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 - 0.05*pi^2*cos((1/4)*x*pi)^2*cos((1/4)*y*pi)*cos((1/2)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 + 0.01*pi^2*sin((1/4)*x*pi)*cos((1/4)*x*pi)^2*cos((1/4)*y*pi)^2*cos((1/2)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^3 - 1/16*pi^2*sin((1/4)*x*pi)*cos((1/2)*y*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5)) + 0.025*pi*mu*(0.1*pi*sin((1/4)*x*pi)^2*sin((1/4)*y*pi)*cos((1/2)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 - 1/2*pi*sin((1/4)*x*pi)*sin((1/2)*y*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5))*sin((1/4)*x*pi)*sin((1/4)*y*pi) - 0.025*pi*mu*(-0.1*pi*sin((1/4)*x*pi)*cos((1/4)*x*pi)*cos((1/4)*y*pi)*cos((1/2)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 + (1/4)*pi*cos((1/4)*x*pi)*cos((1/2)*y*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5))*cos((1/4)*x*pi)*cos((1/4)*y*pi) + 0.1*pi*rho*sin((1/4)*x*pi)^3*sin((1/4)*y*pi)*cos((1/2)*y*pi)^2/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 - 0.1*pi*rho*sin((1/4)*x*pi)*sin((1/2)*y*pi)*cos((1/4)*x*pi)*cos((1/2)*x*pi)*cos((1/4)*y*pi)*cos((1/2)*y*pi)/(0.2*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 1)^2 - pi*rho*sin((1/4)*x*pi)^2*sin((1/2)*y*pi)*cos((1/2)*y*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5) - 1/2*pi*rho*sin((1/4)*x*pi)*sin((1/2)*x*pi)*sin((1/2)*y*pi)*cos((1/2)*y*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5) + (1/4)*pi*rho*sin((1/2)*y*pi)*cos((1/4)*x*pi)*cos((1/2)*x*pi)*cos((1/2)*y*pi)/(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5) + (3/2)*pi*(0.1*sin((1/4)*x*pi)*cos((1/4)*y*pi) + 0.5)*cos((1/4)*x*pi)*cos((3/2)*y*pi)'
symbol_names = 'mu rho darcy forch'
symbol_values = '${mu} ${rho} ${darcy} ${forch}'
[]
[exact_p]
type = ParsedFunction
expression = 'sin((3/2)*y*pi)*cos((1/4)*x*pi)'
[]
[forcing_p]
type = ParsedFunction
expression = '-1/2*pi*rho*sin((1/4)*x*pi)*sin((1/2)*y*pi) - 1/2*pi*rho*sin((1/2)*x*pi)*sin((1/2)*y*pi)'
symbol_names = 'rho'
symbol_values = '${rho}'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm 100 lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = false
csv = true
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2u]
type = ElementL2FunctorError
approximate = u
exact = exact_u
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2v]
type = ElementL2FunctorError
approximate = v
exact = exact_v
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2p]
type = ElementL2FunctorError
approximate = pressure
exact = exact_p
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(test/tests/materials/functor_properties/gradients/functor-gradients.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 4
xmax = 2
[]
[Variables]
[u]
type = MooseVariableFVReal
[]
[]
[AuxVariables]
[sink]
type = MooseVariableFVReal
[]
[diffusive_flux_x]
type = MooseVariableFVReal
[]
[diffusive_flux_y]
type = MooseVariableFVReal
[]
[diffusive_flux_magnitude]
type = MooseVariableFVReal
[]
[]
[ICs]
[sink]
type = FunctionIC
variable = sink
function = 'x^3'
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = u
coeff = 1.1
[]
[sink]
type = FVFunctorElementalKernel
variable = u
functor_name = 'sink_mat'
[]
[]
[FVBCs]
[bounds]
type = FVDirichletBC
variable = u
boundary = 'left right top bottom'
value = 0
[]
[]
[Materials]
[functor_properties]
type = ADGenericFunctorMaterial
prop_names = 'sink_mat diffusive_coef'
prop_values = 'sink 4.5'
[]
[gradient_of_u]
type = ADGenericFunctorGradientMaterial
prop_names = 'grad_u'
prop_values = 'u'
[]
[]
# Compute the diffusive flux magnitude
[AuxKernels]
[diffusive_flux_x]
type = ADFunctorVectorElementalAux
variable = 'diffusive_flux_x'
functor = 'grad_u'
factor = 'diffusive_coef'
component = 0
[]
[diffusive_flux_y]
type = ADFunctorVectorElementalAux
variable = 'diffusive_flux_y'
functor = 'grad_u'
factor = 'diffusive_coef'
component = 1
[]
[diffusive_flux_magnitude]
type = VectorMagnitudeAux
variable = 'diffusive_flux_magnitude'
x = 'diffusive_flux_x'
y = 'diffusive_flux_y'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
exodus = true
[]
(test/tests/postprocessors/side_integral/side_integral_functor.i)
[Mesh]
inactive = 'refine'
# U-shaped domains to have internal boundaries in
# a variety of directions
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '1 1 1'
dy = '3 1'
ix = '4 5 3'
iy = '12 4'
subdomain_id = '1 2 1
1 1 1'
[]
[internal_boundary_dir1]
type = SideSetsBetweenSubdomainsGenerator
input = cmg
primary_block = 1
paired_block = 2
new_boundary = 'inside_1'
[]
[internal_boundary_dir2]
type = SideSetsBetweenSubdomainsGenerator
input = internal_boundary_dir1
primary_block = 2
paired_block = 1
new_boundary = 'inside_2'
[]
[refine]
type = RefineBlockGenerator
input = internal_boundary_dir2
block = '1 2'
refinement = '2 1'
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
block = 1
[]
[]
[AuxVariables]
[v1]
type = MooseVariableFVReal
block = 1
[FVInitialCondition]
type = FVFunctionIC
function = 'x + y'
[]
[]
[v2]
type = MooseVariableFVReal
block = 2
[FVInitialCondition]
type = FVFunctionIC
function = '2*x*x - y'
[]
[]
[]
[Functions]
[f1]
type = ParsedFunction
expression = 'exp(x - y)'
[]
[]
[Materials]
[m1]
type = ADGenericFunctorMaterial
prop_names = 'm1'
prop_values = 'f1'
[]
[m2]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = 'm2'
subdomain_to_prop_value = '1 12
2 4'
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = u
coeff = '1'
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = u
boundary = 3
value = 0
[]
[right]
type = FVDirichletBC
variable = u
boundary = 1
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Postprocessors]
# Mesh external boundaries integration
[ext_u]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left top right'
functor = u
restrict_to_functors_domain = true
[]
[ext_v1]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left right'
functor = v1
[]
[ext_v2]
type = ADSideIntegralFunctorPostprocessor
boundary = 'top'
functor = v2
restrict_to_functors_domain = true
[]
[ext_f1]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left top right'
functor = f1
prefactor = f1
[]
[ext_m1]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left top right'
functor = m1
restrict_to_functors_domain = true
[]
[ext_m2]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left top right'
functor = m2
restrict_to_functors_domain = true
[]
# Internal to the mesh, but a side to the variables
# With orientation of normal 1->2
[int_s1_u]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_1
functor = u
[]
[int_s1_v1]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_1
functor = v1
[]
[int_s1_f1]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_1
functor = f1
[]
[int_s1_m1]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_1
functor = m1
[]
[int_s1_m2]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_1
functor = m2
[]
# With orientation of normal 2->1
[int_s2_v2]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_2
functor = v2
[]
[int_s2_f1]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_2
functor = f1
[]
[int_s2_m1]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_2
functor = m1
[]
[int_s2_m2]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_2
functor = m2
[]
[]
[Outputs]
csv = true
exodus = true
[]
[Problem]
kernel_coverage_check = false
[]
(modules/navier_stokes/test/tests/ics/test.i)
p_initial=1.01e5
T=273.15
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
ymin = 1
ymax = 2
nx = 4
ny = 4
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
kernel_coverage_check = false
solve = false
skip_nl_system_check = true
[]
[AuxVariables]
[pressure]
type = MooseVariableFVReal
[]
[vel_x]
type = MooseVariableFVReal
[]
[vel_y]
type = MooseVariableFVReal
[]
[vel_z]
type = MooseVariableFVReal
[]
[temperature]
type = MooseVariableFVReal
[]
[ht]
type = MooseVariableFVReal
[]
[e]
type = MooseVariableFVReal
[]
[Mach]
type = MooseVariableFVReal
[]
[rho]
type = MooseVariableFVReal
[]
[rhou]
type = MooseVariableFVReal
[]
[rhov]
type = MooseVariableFVReal
[]
[rhow]
type = MooseVariableFVReal
[]
[rho_et]
type = MooseVariableFVReal
[]
[specific_volume]
type = MooseVariableFVReal
[]
[pressure_2]
[]
[vel_x_2]
[]
[vel_y_2]
[]
[vel_z_2]
[]
[temperature_2]
[]
[ht_2]
[]
[e_2]
[]
[Mach_2]
[]
[rho_2]
[]
[rhou_2]
[]
[rhov_2]
[]
[rhow_2]
[]
[rho_et_2]
[]
[specific_volume_2]
[]
[]
[GlobalParams]
fluid_properties = 'fp'
initial_pressure = ${p_initial}
initial_temperature = ${T}
initial_velocity = '1 0.2 18'
[]
[ICs]
[p]
type = NSInitialCondition
variable = 'pressure'
[]
[vel_x]
type = NSInitialCondition
variable = 'vel_x'
[]
[vel_y]
type = NSInitialCondition
variable = 'vel_y'
[]
[vel_z]
type = NSInitialCondition
variable = 'vel_z'
[]
[temperature]
type = NSInitialCondition
variable = 'temperature'
[]
[ht]
type = NSInitialCondition
variable = 'ht'
[]
[e]
type = NSInitialCondition
variable = 'e'
[]
[Mach]
type = NSInitialCondition
variable = 'Mach'
[]
[rho]
type = NSInitialCondition
fluid_properties = 'fp'
initial_pressure = ${p_initial}
initial_temperature = ${T}
initial_velocity = '1 0.2 18'
variable = 'rho'
[]
[rhou]
type = NSInitialCondition
variable = 'rhou'
[]
[rhov]
type = NSInitialCondition
variable = 'rhov'
[]
[rhow]
type = NSInitialCondition
variable = 'rhow'
[]
[rho_et]
type = NSInitialCondition
variable = 'rho_et'
[]
[specific_volume]
type = NSInitialCondition
variable = 'specific_volume'
[]
[p_2]
type = NSInitialCondition
variable = 'pressure_2'
variable_type = 'pressure'
[]
[vel_x_2]
type = NSInitialCondition
variable = 'vel_x_2'
variable_type = 'vel_x'
[]
[vel_y_2]
type = NSInitialCondition
variable = 'vel_y_2'
variable_type = 'vel_y'
[]
[vel_z_2]
type = NSInitialCondition
variable = 'vel_z_2'
variable_type = 'vel_z'
[]
[temperature_2]
type = NSInitialCondition
variable = 'temperature_2'
variable_type = 'temperature'
[]
[ht_2]
type = NSInitialCondition
variable = 'ht_2'
variable_type = 'ht'
[]
[e_2]
type = NSInitialCondition
variable = 'e_2'
variable_type = 'e'
[]
[Mach_2]
type = NSInitialCondition
variable = 'Mach_2'
variable_type = 'Mach'
[]
[rho_2]
type = NSInitialCondition
variable = 'rho_2'
variable_type = 'rho'
[]
[rhou_2]
type = NSInitialCondition
variable = 'rhou_2'
variable_type = 'rhou'
[]
[rhov_2]
type = NSInitialCondition
variable = 'rhov_2'
variable_type = 'rhov'
[]
[rhow_2]
type = NSInitialCondition
variable = 'rhow_2'
variable_type = 'rhow'
[]
[rho_et_2]
type = NSInitialCondition
variable = 'rho_et_2'
variable_type = 'rho_et'
[]
[specific_volume_2]
type = NSInitialCondition
variable = 'specific_volume_2'
variable_type = 'specific_volume'
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
[]
(test/tests/materials/piecewise_by_block_material/discontinuous_functor.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 10
xmax = 2
[]
[subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '1.0 0 0'
block_id = 1
top_right = '2.0 1.0 0'
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = u
coeff = 'coeff'
coeff_interp_method = average
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = u
boundary = 'left'
value = 1
[]
[right]
type = FVDirichletBC
variable = u
boundary = 'right'
value = 0
[]
[]
[Materials]
[coeff_mat]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = 'coeff'
subdomain_to_prop_value = '0 4
1 2'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/hllc.i)
p_initial=1.01e5
T=273.15
# u refers to the superficial velocity
u_in=1
[GlobalParams]
fp = fp
two_term_boundary_expansion = true
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = 0
xmax = 18
nx = 180
[]
[to_pt5]
input = cartesian
type = SubdomainBoundingBoxGenerator
bottom_left = '2 0 0'
top_right = '4 1 0'
block_id = 1
[]
[pt5]
input = to_pt5
type = SubdomainBoundingBoxGenerator
bottom_left = '4 0 0'
top_right = '6 1 0'
block_id = 2
[]
[to_pt25]
input = pt5
type = SubdomainBoundingBoxGenerator
bottom_left = '6 0 0'
top_right = '8 1 0'
block_id = 3
[]
[pt25]
input = to_pt25
type = SubdomainBoundingBoxGenerator
bottom_left = '8 0 0'
top_right = '10 1 0'
block_id = 4
[]
[to_pt5_again]
input = pt25
type = SubdomainBoundingBoxGenerator
bottom_left = '10 0 0'
top_right = '12 1 0'
block_id = 5
[]
[pt5_again]
input = to_pt5_again
type = SubdomainBoundingBoxGenerator
bottom_left = '12 0 0'
top_right = '14 1 0'
block_id = 6
[]
[to_one]
input = pt5_again
type = SubdomainBoundingBoxGenerator
bottom_left = '14 0 0'
top_right = '16 1 0'
block_id = 7
[]
[one]
input = to_one
type = SubdomainBoundingBoxGenerator
bottom_left = '16 0 0'
top_right = '18 1 0'
block_id = 8
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
initial_condition = ${p_initial}
[]
[sup_vel_x]
type = MooseVariableFVReal
initial_condition = 1
scaling = 1e-2
[]
[T_fluid]
type = MooseVariableFVReal
initial_condition = ${T}
scaling = 1e-5
[]
[]
[AuxVariables]
[vel_x]
type = MooseVariableFVReal
[]
[sup_mom_x]
type = MooseVariableFVReal
[]
[rho]
type = MooseVariableFVReal
[]
[worst_courant]
type = MooseVariableFVReal
[]
[porosity]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[vel_x]
type = ADMaterialRealAux
variable = vel_x
property = vel_x
execute_on = 'timestep_end'
[]
[sup_mom_x]
type = ADMaterialRealAux
variable = sup_mom_x
property = superficial_rhou
execute_on = 'timestep_end'
[]
[rho]
type = ADMaterialRealAux
variable = rho
property = rho
execute_on = 'timestep_end'
[]
[worst_courant]
type = Courant
variable = worst_courant
u = sup_vel_x
execute_on = 'timestep_end'
[]
[porosity]
type = MaterialRealAux
variable = porosity
property = porosity
execute_on = 'timestep_end'
[]
[]
[FVKernels]
[mass_advection]
type = PCNSFVMassHLLC
variable = pressure
[]
[momentum_advection]
type = PCNSFVMomentumHLLC
variable = sup_vel_x
momentum_component = 'x'
[]
[eps_grad]
type = PNSFVPGradEpsilon
variable = sup_vel_x
momentum_component = 'x'
epsilon_function = 'eps'
[]
[energy_advection]
type = PCNSFVFluidEnergyHLLC
variable = T_fluid
[]
[]
[FVBCs]
[rho_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = pressure
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'mass'
[]
[rhou_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = sup_vel_x
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'x'
[]
[rho_et_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = T_fluid
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'energy'
[]
[rho_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = pressure
pressure = ${p_initial}
eqn = 'mass'
[]
[rhou_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = sup_vel_x
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'x'
[]
[rho_et_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = T_fluid
pressure = ${p_initial}
eqn = 'energy'
[]
# Use these to help create more accurate cell centered gradients for cells adjacent to boundaries
[T_left]
type = FVDirichletBC
variable = T_fluid
value = ${T}
boundary = 'left'
[]
[sup_vel_left]
type = FVDirichletBC
variable = sup_vel_x
value = ${u_in}
boundary = 'left'
[]
[p_right]
type = FVDirichletBC
variable = pressure
value = ${p_initial}
boundary = 'right'
[]
[]
[Functions]
[ud_in]
type = ParsedVectorFunction
expression_x = '${u_in}'
[]
[eps]
type = ParsedFunction
expression = 'if(x < 2, 1,
if(x < 4, 1 - .5 / 2 * (x - 2),
if(x < 6, .5,
if(x < 8, .5 - .25 / 2 * (x - 6),
if(x < 10, .25,
if(x < 12, .25 + .25 / 2 * (x - 10),
if(x < 14, .5,
if(x < 16, .5 + .5 / 2 * (x - 14),
1))))))))'
[]
[]
[Materials]
[var_mat]
type = PorousPrimitiveVarMaterial
pressure = pressure
T_fluid = T_fluid
superficial_vel_x = sup_vel_x
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[]
[Executioner]
solve_type = NEWTON
line_search = 'bt'
type = Steady
[]
[Outputs]
[out]
type = Exodus
execute_on = 'final'
[]
checkpoint = true
[]
[Debug]
show_var_residual_norms = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/lid-driven-turb-std-wall.i)
##########################################################
# Lid-driven cavity test
# Reynolds: 5,000
# Author: Dr. Mauricio Tano
# Last Update: November, 2023
# Turbulent model using:
# k-epsilon model
# Standard wall functions
# SIMPLE Solve
##########################################################
### Thermophysical Properties ###
mu = 2e-5
rho = 1.0
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epslilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Modeling parameters ###
non_equilibrium_treatment = false
bulk_wall_treatment = false
walls = 'left top right bottom'
max_mixing_length = 1e10
linearized_yplus_mu_t = false
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
pressure_tag = "pressure_grad"
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolatorSegregated
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 0.0
solver_sys = u_system
two_term_boundary_expansion = false
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 0.0
solver_sys = v_system
two_term_boundary_expansion = false
[]
[pressure]
type = INSFVPressureVariable
solver_sys = pressure_system
initial_condition = 0.2
two_term_boundary_expansion = false
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
[]
[]
[FVKernels]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = true
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = true
u = vel_x
v = vel_y
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[p_diffusion]
type = FVAnisotropicDiffusion
variable = pressure
coeff = "Ainv"
coeff_interp_method = 'average'
[]
[p_source]
type = FVDivergence
variable = pressure
vector_field = "HbyA"
force_boundary_execution = true
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
non_equilibrium_treatment = ${non_equilibrium_treatment}
max_mixing_length = ${max_mixing_length}
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
k = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
non_equilibrium_treatment = ${non_equilibrium_treatment}
max_mixing_length = ${max_mixing_length}
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${lid_velocity}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = 'left right top bottom'
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
k = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
linearized_yplus = ${linearized_yplus_mu_t}
non_equilibrium_treatment = ${non_equilibrium_treatment}
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKED_system TKE_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.5
turbulence_equation_relaxation = '0.8 0.8'
num_iterations = 500
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
[]
[Outputs]
exodus = true
csv = false
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
(test/tests/fvkernels/mms/non-orthogonal/extended-adr.i)
a=1.1
diff=1.1
[Mesh]
[./gen_mesh]
type = GeneratedMeshGenerator
dim = 2
xmin = 2
xmax = 3
ymin = 0
ymax = 1
nx = 2
ny = 2
elem_type = TRI3
[../]
[]
[Variables]
[./v]
family = MONOMIAL
order = CONSTANT
fv = true
initial_condition = 1
type = MooseVariableFVReal
face_interp_method = vertex-based
[../]
[]
[FVKernels]
[./advection]
type = FVAdvection
variable = v
velocity = '${a} ${fparse 2*a} 0'
advected_interp_method = 'average'
[../]
[reaction]
type = FVReaction
variable = v
[]
[diff_v]
type = FVDiffusion
variable = v
coeff = ${diff}
use_point_neighbors = true
[]
[body_v]
type = FVBodyForce
variable = v
function = 'forcing'
[]
[]
[FVBCs]
[exact]
type = FVFunctionDirichletBC
boundary = 'left right top bottom'
function = 'exact'
variable = v
[]
[]
[Functions]
[exact]
type = ParsedFunction
expression = 'sin(x)*cos(y)'
[]
[forcing]
type = ParsedFunction
expression = '-2*a*sin(x)*sin(y) + a*cos(x)*cos(y) + 2*diff*sin(x)*cos(y) + sin(x)*cos(y)'
symbol_names = 'a diff'
symbol_values = '${a} ${diff}'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'hypre'
[]
[Outputs]
csv = true
[]
[Postprocessors]
[./error]
type = ElementL2Error
variable = v
function = exact
outputs = 'console csv'
execute_on = 'timestep_end'
[../]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/controls/switch-pressure-bc/switch_vel_pres_bc.i)
rho = 'rho'
l = 10
inlet_area = 1
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
end_time = 3.0
switch_time = 1.0
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 10
ny = 5
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
[]
[v]
type = INSFVVelocityVariable
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = u
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = v
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T
rho = rho
drho_dt = drho_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T
v = power_density
[]
[]
[FVBCs]
# Inlet
[inlet_u]
type = WCNSFVSwitchableInletVelocityBC
variable = u
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'surface_inlet'
rho = 'rho'
switch_bc = true
face_limiter = 1.0
[]
[outlet_u]
type = WCNSFVSwitchableInletVelocityBC
variable = u
boundary = 'right'
mdot_pp = 'inlet_mdot'
area_pp = 'surface_inlet'
rho = 'rho'
switch_bc = false
scaling_factor = -1.0
face_limiter = 1.0
[]
[inlet_v]
type = WCNSFVInletVelocityBC
variable = v
boundary = 'left'
mdot_pp = 0
area_pp = 'surface_inlet'
rho = 'rho'
[]
[inlet_T]
type = WCNSFVInletTemperatureBC
variable = T
boundary = 'left'
temperature_pp = 'inlet_T'
[]
[outlet_T]
type = NSFVOutflowTemperatureBC
variable = T
boundary = 'right'
u = u
v = v
rho = 'rho'
cp = 'cp'
backflow_T = ${inlet_temp}
[]
[outlet_p]
type = INSFVSwitchableOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
switch_bc = true
face_limiter = 1.0
[]
[inlet_p]
type = INSFVSwitchableOutletPressureBC
variable = pressure
boundary = 'left'
function = ${outlet_pressure}
switch_bc = false
face_limiter = 1.0
[]
# Walls
[no_slip_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = v
boundary = 'top bottom'
function = 0
[]
[]
[Functions]
[func_coef]
type = ParsedFunction
expression = 'if(t<${switch_time} | t>2.0*${switch_time}, 1, 0)'
[]
[func_coef_comp]
type = ParsedFunction
expression = 'if(t<${switch_time} | t>2.0*${switch_time}, 0, 1)'
[]
[mass_flux_and_pressure_test_scaling]
type = ParsedFunction
expression = 'if(t<${switch_time} | t>2.0*${switch_time}, 0.1, 0.2)'
[]
[]
[Controls]
[func_control_u_inlet]
type = BoolFunctionControl
parameter = 'FVBCs/inlet_u/switch_bc'
function = 'func_coef'
execute_on = 'initial timestep_begin'
[]
[func_control_u_outlet]
type = BoolFunctionControl
parameter = 'FVBCs/outlet_u/switch_bc'
function = 'func_coef_comp'
execute_on = 'initial timestep_begin'
[]
[func_control_p_outlet]
type = BoolFunctionControl
parameter = 'FVBCs/outlet_p/switch_bc'
function = 'func_coef'
execute_on = 'initial timestep_begin'
[]
[func_control_p_inlet]
type = BoolFunctionControl
parameter = 'FVBCs/inlet_p/switch_bc'
function = 'func_coef_comp'
execute_on = 'initial timestep_begin'
[]
[func_control_limiter_u_inlet]
type = RealFunctionControl
parameter = 'FVBCs/inlet_u/face_limiter'
function = 'mass_flux_and_pressure_test_scaling'
execute_on = 'initial timestep_begin'
[]
[func_control_limiter_u_outlet]
type = RealFunctionControl
parameter = 'FVBCs/outlet_u/face_limiter'
function = 'mass_flux_and_pressure_test_scaling'
execute_on = 'initial timestep_begin'
[]
[func_control_limiter_p_outlet]
type = RealFunctionControl
parameter = 'FVBCs/outlet_p/face_limiter'
function = 'mass_flux_and_pressure_test_scaling'
execute_on = 'initial timestep_begin'
[]
[func_control_limiter_p_inlet]
type = RealFunctionControl
parameter = 'FVBCs/inlet_p/face_limiter'
function = 'mass_flux_and_pressure_test_scaling'
execute_on = 'initial timestep_begin'
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_mdot]
type = Receiver
default = '${fparse 1980 * inlet_velocity * inlet_area}'
[]
[surface_inlet]
type = AreaPostprocessor
boundary = 'left'
execute_on = 'INITIAL'
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[outlet_mfr]
type = VolumetricFlowRate
boundary = 'right'
advected_quantity = 1.0
vel_x = u
vel_y = v
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
dt = 0.1
end_time = ${end_time}
nl_abs_tol = 1e-12
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
csv = true
execute_on = 'TIMESTEP_END'
[]
(test/tests/mesh/elem_info/elem_info.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
nx = 2
ymin = -2
ymax = 3
ny = 3
[]
allow_renumbering = false
[]
[Problem]
kernel_coverage_check = false
solve = false
[]
[Variables]
[u]
type = MooseVariableFVReal
[]
[v]
type = MooseVariableFVReal
[]
[w]
[]
[]
[AuxVariables]
[aux]
type = MooseVariableFVReal
[]
[]
[VectorPostprocessors]
[elem_info]
type = TestElemInfo
vars = 'u v w aux'
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/pins/materials/2d-rc.i)
mu = 0.01
rho = 2000
u_inlet = 1
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = 0
ymax = 1
nx = 10
ny = 6
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = PINSFVRhieChowInterpolator
u = superficial_vel_x
v = superficial_vel_y
pressure = pressure
porosity = porosity
[]
[]
[Variables]
[superficial_vel_x]
type = PINSFVSuperficialVelocityVariable
initial_condition = ${u_inlet}
[]
[superficial_vel_y]
type = PINSFVSuperficialVelocityVariable
initial_condition = 1e-6
[]
[pressure]
type = INSFVPressureVariable
[]
[]
[AuxVariables]
[porosity]
family = MONOMIAL
order = CONSTANT
fv = true
initial_condition = 0.5
[]
[speed_output]
type = MooseVariableFVReal
[]
[vel_x_output]
type = MooseVariableFVReal
[]
[vel_y_output]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[speed]
type = FunctorAux
variable = 'speed_output'
functor = 'speed'
[]
[vel_x]
type = ADFunctorVectorElementalAux
variable = 'vel_x_output'
functor = 'velocity'
component = 0
[]
[vel_y]
type = ADFunctorVectorElementalAux
variable = 'vel_y_output'
functor = 'velocity'
component = 1
[]
[]
[FVKernels]
[mass]
type = PINSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_advection]
type = PINSFVMomentumAdvection
variable = superficial_vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
porosity = porosity
momentum_component = 'x'
[]
[u_viscosity]
type = PINSFVMomentumDiffusion
variable = superficial_vel_x
mu = ${mu}
porosity = porosity
momentum_component = 'x'
[]
[u_pressure]
type = PINSFVMomentumPressure
variable = superficial_vel_x
momentum_component = 'x'
pressure = pressure
porosity = porosity
[]
[v_advection]
type = PINSFVMomentumAdvection
variable = superficial_vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
porosity = porosity
momentum_component = 'y'
[]
[v_viscosity]
type = PINSFVMomentumDiffusion
variable = superficial_vel_y
mu = ${mu}
porosity = porosity
momentum_component = 'y'
[]
[v_pressure]
type = PINSFVMomentumPressure
variable = superficial_vel_y
momentum_component = 'y'
pressure = pressure
porosity = porosity
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = superficial_vel_x
function = ${u_inlet}
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = superficial_vel_y
function = 0
[]
[no-slip-u]
type = INSFVNoSlipWallBC
boundary = 'top'
variable = superficial_vel_x
function = 0
[]
[no-slip-v]
type = INSFVNoSlipWallBC
boundary = 'top'
variable = superficial_vel_y
function = 0
[]
[symmetry-u]
type = PINSFVSymmetryVelocityBC
boundary = 'bottom'
variable = superficial_vel_x
u = superficial_vel_x
v = superficial_vel_y
mu = ${mu}
momentum_component = 'x'
[]
[symmetry-v]
type = PINSFVSymmetryVelocityBC
boundary = 'bottom'
variable = superficial_vel_y
u = superficial_vel_x
v = superficial_vel_y
mu = ${mu}
momentum_component = 'y'
[]
[symmetry-p]
type = INSFVSymmetryPressureBC
boundary = 'bottom'
variable = pressure
[]
[outlet-p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = 0.1
[]
[]
[FunctorMaterials]
# Testing this object
[var_mat]
type = PINSFVSpeedFunctorMaterial
superficial_vel_x = 'superficial_vel_x'
superficial_vel_y = 'superficial_vel_y'
porosity = porosity
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
nl_abs_tol = 1e-11
[]
# Some basic Postprocessors to examine the solution
[Postprocessors]
[inlet-p]
type = SideAverageValue
variable = pressure
boundary = 'left'
[]
[outlet-u]
type = SideAverageValue
variable = superficial_vel_x
boundary = 'right'
[]
[]
[Outputs]
exodus = true
csv = false
[]
(test/tests/fvkernels/fv_adapt/steady-adapt.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 1
elem_type = QUAD4
[]
[]
[Variables]
[u]
order = CONSTANT
family = MONOMIAL
fv = true
type = MooseVariableFVReal
[]
[]
[Functions]
[exact-quadratic]
type = ParsedFunction
expression = '-(x-1)^2+1'
[]
[exact-linear]
type = ParsedFunction
expression = 'x'
[]
[]
[FVKernels]
inactive = 'source'
[diff]
type = FVDiffusion
variable = u
coeff = coeff
use_point_neighbors = true
[]
[source]
type = FVBodyForce
variable = u
function = 2
[]
[]
[FVBCs]
[right]
type = FVDirichletBC
variable = u
boundary = right
value = 1
[]
[left]
type = FVDirichletBC
variable = u
boundary = left
value = 0
[]
[]
[Materials]
[diff]
type = ADGenericFunctorMaterial
prop_names = 'coeff'
prop_values = '1'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'hypre'
[]
[Adaptivity]
marker = box
initial_steps = 1
[Markers]
[box]
bottom_left = '0.5 0 0'
inside = refine
top_right = '1 1 0'
outside = do_nothing
type = BoxMarker
[]
[]
[]
[Outputs]
exodus = true
csv = true
[console]
type = Console
system_info = 'framework mesh aux nonlinear relationship execution'
[]
[]
[Postprocessors]
[error]
type = ElementL2Error
variable = u
function = exact-linear
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(test/tests/functors/previous-nl-it/test.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 20
[]
[Problem]
previous_nl_solution_required = true
[]
[Variables]
[u]
type = MooseVariableFVReal
initial_condition = 1
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = u
coeff = 1
[]
[rxn]
type = FVSecondOrderRxnLagged
variable = u
lag = false
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = FVDirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
line_search = 'none'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/multiapp-scalar-transport/scalar-transport.i)
diff=1e-3
advected_interp_method='average'
velocity_interp_method='rc'
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
active = 'rc'
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
a_u = ax
a_v = ay
[]
[rc_bad]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = -1
ymax = 1
nx = 100
ny = 20
[]
[]
[Variables]
[scalar]
type = INSFVScalarFieldVariable
[]
[]
[AuxVariables]
[ax]
type = MooseVariableFVReal
[]
[ay]
type = MooseVariableFVReal
[]
[u]
type = INSFVVelocityVariable
[]
[v]
type = INSFVVelocityVariable
[]
[pressure]
type = INSFVPressureVariable
[]
[]
[FVKernels]
[scalar_advection]
type = INSFVScalarFieldAdvection
variable = scalar
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_diffusion]
type = FVDiffusion
coeff = ${diff}
variable = scalar
[]
[scalar_src]
type = FVBodyForce
variable = scalar
value = 0.1
[]
[]
[FVBCs]
[inlet_scalar]
type = FVDirichletBC
boundary = 'left'
variable = scalar
value = 1
[]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = u
function = '1'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = v
function = 0
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = 0
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(test/tests/fvics/file_ic/file_restart.i)
[Mesh]
[fmg]
type = FileMeshGenerator
file = restart_from.e
use_for_exodus_restart = true
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
initial_from_file_var = u
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/lid-driven-turb-inc-wall.i)
##########################################################
# Lid-driven cavity test
# Reynolds: 5,000
# Author: Dr. Mauricio Tano
# Last Update: Novomber, 2023
# Turbulent model using:
# k-epsilon model
# Incremental wall function formulation (similar to OpenFOAM)
# SIMPLE Solve
##########################################################
### Thermophsyical Properties ###
mu = 2e-5
rho = 1.0
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epslilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Modeling parameters ###
non_equilibrium_treatment = false
bulk_wall_treatment = false
walls = 'left top right bottom'
max_mixing_length = 1e10
linearized_yplus_mu_t = false
wall_treatment = 'eq_incremental' # Options: eq_newton, eq_incremental, eq_linearized, neq
pressure_tag = "pressure_grad"
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolatorSegregated
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 0.0
solver_sys = u_system
two_term_boundary_expansion = false
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 0.0
solver_sys = v_system
two_term_boundary_expansion = false
[]
[pressure]
type = INSFVPressureVariable
solver_sys = pressure_system
initial_condition = 0.2
two_term_boundary_expansion = false
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
[]
[]
[FVKernels]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = true
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = true
u = vel_x
v = vel_y
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[p_diffusion]
type = FVAnisotropicDiffusion
variable = pressure
coeff = "Ainv"
coeff_interp_method = 'average'
[]
[p_source]
type = FVDivergence
variable = pressure
vector_field = "HbyA"
force_boundary_execution = true
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
non_equilibrium_treatment = ${non_equilibrium_treatment}
max_mixing_length = ${max_mixing_length}
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
k = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
non_equilibrium_treatment = ${non_equilibrium_treatment}
max_mixing_length = ${max_mixing_length}
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${lid_velocity}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = 'left right top bottom'
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
k = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
linearized_yplus = ${linearized_yplus_mu_t}
non_equilibrium_treatment = ${non_equilibrium_treatment}
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKED_system TKE_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.5
turbulence_equation_relaxation = '0.8 0.8'
num_iterations = 500
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
[]
[Outputs]
exodus = true
csv = false
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
(modules/porous_flow/test/tests/mass_conservation/mass14.i)
# checking that the mass postprocessor correctly calculates the mass
# 1phase, 1component, constant porosity
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 3
xmin = -1
xmax = 1
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[pp]
type = MooseVariableFVReal
[]
[]
[ICs]
[pinit]
type = FunctionIC
function = x
variable = pp
[]
[]
[FVKernels]
[mass0]
type = FVPorousFlowMassTimeDerivative
fluid_component = 0
variable = pp
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp'
number_fluid_phases = 1
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
m = 0.5
alpha = 1
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 1
density0 = 1
thermal_expansion = 0
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
[]
[ppss]
type = ADPorousFlow1PhaseP
porepressure = pp
capillary_pressure = pc
[]
[massfrac]
type = ADPorousFlowMassFraction
[]
[simple_fluid]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[porosity]
type = ADPorousFlowPorosityConst
porosity = 0.1
[]
[]
[Postprocessors]
[total_mass]
type = FVPorousFlowFluidMass
base_name = incorrect_base_name
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 1
end_time = 1
[]
[Outputs]
execute_on = 'timestep_end'
[]
(test/tests/fvkernels/mms/skewness-correction/diffusion/skewed.i)
a=1.1
diff=1.1
[Mesh]
[./gen_mesh]
type = FileMeshGenerator
file = skewed.msh
[../]
[]
[Variables]
[./v]
initial_condition = 1
type = MooseVariableFVReal
face_interp_method = 'skewness-corrected'
[../]
[]
[FVKernels]
[diff_v]
type = FVDiffusion
variable = v
coeff = ${diff}
[]
[body_v]
type = FVBodyForce
variable = v
function = 'forcing'
[]
[]
[FVBCs]
[exact]
type = FVFunctionDirichletBC
boundary = 'left right top bottom'
function = 'exact'
variable = v
[]
[]
[Functions]
[exact]
type = ParsedFunction
expression = 'sin(x)*cos(y)'
[]
[forcing]
type = ParsedFunction
expression = '2*diff*sin(x)*cos(y)'
symbol_names = 'a diff'
symbol_values = '${a} ${diff}'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
csv = true
[]
[Postprocessors]
[./error]
type = ElementL2Error
variable = v
function = exact
outputs = 'console csv'
[../]
[h]
type = AverageElementSize
outputs = 'console csv'
[]
[]
(test/tests/fvkernels/mms/grad-reconstruction/mat-cartesian.i)
a=1.1
diff=1.1
[Mesh]
[gen_mesh]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 2
ny = 2
[]
[]
[Variables]
[v]
type = MooseVariableFVReal
initial_condition = 1
[]
[]
[FVKernels]
[advection]
type = FVElementalAdvection
variable = v
velocity = '${a} ${fparse 2 * a} 0'
advected_quantity = 'mat_u'
grad_advected_quantity = 'mat_grad_u'
[]
[reaction]
type = FVReaction
variable = v
[]
[diff_v]
type = FVDiffusion
variable = v
coeff = ${diff}
[]
[body_v]
type = FVBodyForce
variable = v
function = 'forcing'
[]
[]
[FVBCs]
[diri]
type = FVFunctionDirichletBC
boundary = 'left right top bottom'
function = 'exact'
variable = v
[]
[]
[Materials]
[mat]
type = ADCoupledGradientMaterial
mat_prop = 'mat_u'
grad_mat_prop = 'mat_grad_u'
u = v
[]
[]
[Functions]
[exact]
type = ParsedFunction
expression = 'sin(x)*cos(y)'
[]
[forcing]
type = ParsedFunction
expression = '-2*a*sin(x)*sin(y) + a*cos(x)*cos(y) + 2*diff*sin(x)*cos(y) + sin(x)*cos(y)'
symbol_names = 'a diff'
symbol_values = '${a} ${diff}'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -sub_pc_factor_shift_type -sub_pc_type'
petsc_options_value = 'asm NONZERO lu'
[]
[Outputs]
exodus = true
csv = true
[]
[Postprocessors]
[error]
type = ElementL2Error
variable = v
function = exact
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(test/tests/postprocessors/interface_diffusive_flux/interface_diffusive_flux_fv.i)
postprocessor_type = InterfaceDiffusiveFluxAverage
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 6
xmax = 3
ny = 9
ymax = 3
elem_type = QUAD4
[]
[subdomain_id]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '0 0 0'
top_right = '2 1 0'
block_id = 1
[]
[interface]
input = subdomain_id
type = SideSetsBetweenSubdomainsGenerator
primary_block = '1'
paired_block = '0'
new_boundary = 'interface'
[]
[]
[Functions]
[fn_exact]
type = ParsedFunction
expression = 'x*x+y*y'
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
block = 0
[]
[v]
type = MooseVariableFVReal
block = 1
[]
[]
[FVKernels]
[diff_u]
type = FVDiffusion
variable = u
coeff = 1
[]
[body_u]
type = FVBodyForce
variable = u
function = 1
[]
[diff_v]
type = FVDiffusion
variable = v
coeff = 1
[]
[body_v]
type = FVBodyForce
variable = v
function = -1
[]
[]
[FVInterfaceKernels]
[reaction]
type = FVDiffusionInterface
variable1 = u
variable2 = v
coeff1 = 1
coeff2 = 2
boundary = 'interface'
subdomain1 = '0'
subdomain2 = '1'
coeff_interp_method = average
[]
[]
[FVBCs]
[all]
type = FVFunctionDirichletBC
variable = u
boundary = '0 1 2 3'
function = fn_exact
[]
[]
[Postprocessors]
[diffusive_flux]
type = ${postprocessor_type}
variable = v
neighbor_variable = u
diffusivity = 1
execute_on = TIMESTEP_END
boundary = 'interface'
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
file_base = '${raw ${postprocessor_type} _fv}'
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/pins/block-restriction/with-empty-block.i)
mu = 1.2
rho_fluid = 0.2
k_fluid = 1.1
cp_fluid = 2.3
T_cold = 310
alpha = 1e-3
Q = 200
[Problem]
kernel_coverage_check = false
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
velocity_interp_method = 'rc'
advected_interp_method = 'average'
[]
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '0.3683 0.0127'
dy = '0.0127 0.2292 2.5146 0.2292 0.0127'
ix = '2 1'
iy = '1 2 3 2 1'
subdomain_id = '0 0
1 0
2 0
1 0
0 0
'
[]
[rename_block_name]
type = RenameBlockGenerator
input = cmg
old_block = '0 1 2'
new_block = 'wall_block spacer_block porous_block'
[]
[solid_fluid_interface_1]
type = SideSetsBetweenSubdomainsGenerator
input = rename_block_name
primary_block = porous_block
paired_block = wall_block
new_boundary = 'solid_fluid_interface'
[]
[solid_fluid_interface_2]
type = SideSetsBetweenSubdomainsGenerator
input = solid_fluid_interface_1
primary_block = spacer_block
paired_block = wall_block
new_boundary = 'solid_fluid_interface'
[]
[wall_left_boundary_1]
type = SideSetsFromBoundingBoxGenerator
input = solid_fluid_interface_2
bottom_left = '0 0 0'
top_right = '0.1 0.0127 0'
included_boundaries = left
boundary_new = wall_left
[]
[wall_left_boundary_2]
type = SideSetsFromBoundingBoxGenerator
input = wall_left_boundary_1
bottom_left = '0 2.9857 0'
top_right = '0.1 2.9984 0'
included_boundaries = left
boundary_new = wall_left
[]
[fluid_left_boundary]
type = SideSetsFromBoundingBoxGenerator
input = wall_left_boundary_2
bottom_left = '0 0.0127 0'
top_right = '0.1 2.9857 0'
included_boundaries = left
boundary_new = fluid_left
[]
coord_type = RZ
rz_coord_axis = Y
[]
[UserObjects]
[rc]
type = PINSFVRhieChowInterpolator
u = superficial_vel_x
v = superficial_vel_y
pressure = pressure
porosity = porosity
block = 'spacer_block porous_block'
[]
[]
[Variables]
[superficial_vel_x]
type = PINSFVSuperficialVelocityVariable
block = 'spacer_block porous_block'
[]
[superficial_vel_y]
type = PINSFVSuperficialVelocityVariable
block = 'spacer_block porous_block'
[]
[pressure]
type = INSFVPressureVariable
block = 'spacer_block porous_block'
[]
[T_fluid]
type = INSFVEnergyVariable
block = 'spacer_block porous_block'
[]
[lambda]
family = SCALAR
order = FIRST
block = 'spacer_block porous_block'
[]
[]
[AuxVariables]
[porosity]
type = MooseVariableFVReal
block = 'spacer_block porous_block'
[]
[]
[FVKernels]
# No mass time derivative because imcompressible (derivative = 0)
[mass]
type = PINSFVMassAdvection
variable = pressure
rho = ${rho_fluid}
block = 'spacer_block porous_block'
[]
[mean_zero_pressure]
type = FVIntegralValueConstraint
variable = pressure
lambda = lambda
block = 'spacer_block porous_block'
[]
[u_advection]
type = PINSFVMomentumAdvection
variable = superficial_vel_x
rho = ${rho_fluid}
momentum_component = 'x'
block = 'spacer_block porous_block'
porosity = porosity
[]
[u_viscosity]
type = PINSFVMomentumDiffusion
variable = superficial_vel_x
mu = ${mu}
momentum_component = 'x'
block = 'spacer_block porous_block'
porosity = porosity
[]
[u_pressure]
type = PINSFVMomentumPressure
variable = superficial_vel_x
momentum_component = 'x'
pressure = pressure
block = 'spacer_block porous_block'
porosity = porosity
[]
[u_buoyancy]
type = PINSFVMomentumBoussinesq
variable = superficial_vel_x
T_fluid = T_fluid
gravity = '0 -1 0'
rho = ${rho_fluid}
ref_temperature = ${T_cold}
momentum_component = 'x'
block = 'spacer_block porous_block'
porosity = porosity
[]
[u_gravity]
type = PINSFVMomentumGravity
variable = superficial_vel_x
gravity = '0 -1 0'
rho = ${rho_fluid}
momentum_component = 'x'
block = 'spacer_block porous_block'
porosity = porosity
[]
[v_advection]
type = PINSFVMomentumAdvection
variable = superficial_vel_y
rho = ${rho_fluid}
momentum_component = 'y'
block = 'spacer_block porous_block'
porosity = porosity
[]
[v_viscosity]
type = PINSFVMomentumDiffusion
variable = superficial_vel_y
mu = ${mu}
momentum_component = 'y'
block = 'spacer_block porous_block'
porosity = porosity
[]
[v_pressure]
type = PINSFVMomentumPressure
variable = superficial_vel_y
momentum_component = 'y'
pressure = pressure
block = 'spacer_block porous_block'
porosity = porosity
[]
[v_buoyancy]
type = PINSFVMomentumBoussinesq
variable = superficial_vel_y
T_fluid = T_fluid
gravity = '0 -1 0'
rho = ${rho_fluid}
ref_temperature = ${T_cold}
momentum_component = 'y'
block = 'spacer_block porous_block'
porosity = porosity
[]
[v_gravity]
type = PINSFVMomentumGravity
variable = superficial_vel_y
gravity = '0 -1 0'
rho = ${rho_fluid}
momentum_component = 'y'
block = 'spacer_block porous_block'
porosity = porosity
[]
[temp_conduction]
type = PINSFVEnergyDiffusion
k = 'k_fluid'
variable = T_fluid
block = 'spacer_block porous_block'
porosity = porosity
[]
[temp_advection]
type = PINSFVEnergyAdvection
variable = T_fluid
block = 'spacer_block porous_block'
[]
[heat_source]
type = FVBodyForce
variable = T_fluid
function = ${Q}
block = 'porous_block'
[]
[]
[FVBCs]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = superficial_vel_x
boundary = 'solid_fluid_interface'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = superficial_vel_y
boundary = 'solid_fluid_interface'
function = 0
[]
[reflective_x]
type = INSFVSymmetryVelocityBC
variable = superficial_vel_x
boundary = fluid_left
momentum_component = 'x'
mu = ${mu}
u = superficial_vel_x
v = superficial_vel_y
[]
[reflective_y]
type = INSFVSymmetryVelocityBC
variable = superficial_vel_y
boundary = fluid_left
momentum_component = 'y'
mu = ${mu}
u = superficial_vel_x
v = superficial_vel_y
[]
[reflective_p]
type = INSFVSymmetryPressureBC
boundary = fluid_left
variable = pressure
[]
[T_reflective]
type = FVNeumannBC
variable = T_fluid
boundary = fluid_left
value = 0
[]
[T_cold_boundary]
type = FVDirichletBC
variable = T_fluid
boundary = solid_fluid_interface
value = ${T_cold}
[]
[]
[ICs]
[porosity_spacer]
type = ConstantIC
variable = porosity
block = spacer_block
value = 1.0
[]
[porosity_fuel]
type = ConstantIC
variable = porosity
block = porous_block
value = 0.1
[]
[temp_ic_fluid]
type = ConstantIC
variable = T_fluid
value = ${T_cold}
block = 'spacer_block porous_block'
[]
[superficial_vel_x]
type = ConstantIC
variable = superficial_vel_x
value = 1E-5
block = 'spacer_block porous_block'
[]
[superficial_vel_y]
type = ConstantIC
variable = superficial_vel_y
value = 1E-5
block = 'spacer_block porous_block'
[]
[]
[FunctorMaterials]
[functor_constants_fluid]
type = ADGenericFunctorMaterial
prop_names = 'alpha_b cp k_fluid'
prop_values = '${alpha} ${cp_fluid} ${k_fluid}'
block = 'spacer_block porous_block'
[]
[density_fluid]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T_fluid'
rho = ${rho_fluid}
block = 'spacer_block porous_block'
[]
[functor_constants_steel]
# We need this to avoid errors for materials not existing on every block
type = ADGenericFunctorMaterial
prop_names = 'dummy'
prop_values = 0.0
block = wall_block
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = none
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
[]
[Outputs]
exodus = true
[]
[Debug]
show_var_residual_norms = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/lid-driven-turb-linear-wall.i)
##########################################################
# Lid-driven cavity test
# Reynolds: 5,000
# Author: Dr. Mauricio Tano
# Last Update: Novomber, 2023
# Turbulent model using:
# k-epsilon model
# Linear wall function formulation (faster runs)
# SIMPLE Solve
##########################################################
### Thermophsyical Properties ###
mu = 2e-5
rho = 1.0
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epslilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Modeling parameters ###
non_equilibrium_treatment = false
bulk_wall_treatment = false
walls = 'left top right bottom'
max_mixing_length = 1e10
linearized_yplus_mu_t = false
wall_treatment = 'eq_linearized' # Options: eq_newton, eq_incremental, eq_linearized, neq
pressure_tag = "pressure_grad"
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolatorSegregated
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 0.0
solver_sys = u_system
two_term_boundary_expansion = false
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 0.0
solver_sys = v_system
two_term_boundary_expansion = false
[]
[pressure]
type = INSFVPressureVariable
solver_sys = pressure_system
initial_condition = 0.2
two_term_boundary_expansion = false
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
[]
[]
[FVKernels]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = true
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = true
u = vel_x
v = vel_y
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[p_diffusion]
type = FVAnisotropicDiffusion
variable = pressure
coeff = "Ainv"
coeff_interp_method = 'average'
[]
[p_source]
type = FVDivergence
variable = pressure
vector_field = "HbyA"
force_boundary_execution = true
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
non_equilibrium_treatment = ${non_equilibrium_treatment}
max_mixing_length = ${max_mixing_length}
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
k = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
non_equilibrium_treatment = ${non_equilibrium_treatment}
max_mixing_length = ${max_mixing_length}
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${lid_velocity}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = 'left right top bottom'
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
k = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
linearized_yplus = ${linearized_yplus_mu_t}
non_equilibrium_treatment = ${non_equilibrium_treatment}
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKED_system TKE_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.5
turbulence_equation_relaxation = '0.8 0.8'
num_iterations = 500
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
[]
[Outputs]
exodus = true
csv = false
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
(modules/porous_flow/test/tests/heat_conduction/no_fluid_fv.i)
# 0 phase (no fluid) heat conduction using FV
# Apply a boundary condition of T=300 to a bar that
# is initially at T=200, and observe the expected
# error-function response
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 10
xmin = 0
xmax = 100
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[temp]
type = MooseVariableFVReal
initial_condition = 200
[]
[]
[FVKernels]
[energy_dot]
type = FVPorousFlowEnergyTimeDerivative
variable = temp
[]
[heat_conduction]
type = FVPorousFlowHeatConduction
variable = temp
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'temp'
number_fluid_phases = 0
number_fluid_components = 0
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
temperature = temp
[]
[thermal_conductivity]
type = ADPorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '2.2 0 0 0 0 0 0 0 0'
[]
[porosity]
type = ADPorousFlowPorosityConst
porosity = 0.1
[]
[rock_heat]
type = ADPorousFlowMatrixInternalEnergy
specific_heat_capacity = 2.2
density = 0.5
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
boundary = left
value = 300
variable = temp
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 1E1
end_time = 1E2
[]
[Postprocessors]
[t005]
type = PointValue
variable = temp
point = '5 0 0'
execute_on = 'initial timestep_end'
[]
[t015]
type = PointValue
variable = temp
point = '15 0 0'
execute_on = 'initial timestep_end'
[]
[t025]
type = PointValue
variable = temp
point = '25 0 0'
execute_on = 'initial timestep_end'
[]
[t035]
type = PointValue
variable = temp
point = '35 0 0'
execute_on = 'initial timestep_end'
[]
[t045]
type = PointValue
variable = temp
point = '45 0 0'
execute_on = 'initial timestep_end'
[]
[t055]
type = PointValue
variable = temp
point = '55 0 0'
execute_on = 'initial timestep_end'
[]
[t065]
type = PointValue
variable = temp
point = '65 0 0'
execute_on = 'initial timestep_end'
[]
[t075]
type = PointValue
variable = temp
point = '75 0 0'
execute_on = 'initial timestep_end'
[]
[t085]
type = PointValue
variable = temp
point = '85 0 0'
execute_on = 'initial timestep_end'
[]
[t095]
type = PointValue
variable = temp
point = '95 0 0'
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
file_base = no_fluid_fv
csv = true
[]
(test/tests/fvkernels/mms/skewness-correction/two_term_extrapol/advection-outflow.i)
diff=1
a=1
[GlobalParams]
advected_interp_method = 'average'
[]
[Mesh]
[./gen_mesh]
type = FileMeshGenerator
file = skewed.msh
[../]
[]
[Variables]
[./v]
type = MooseVariableFVReal
face_interp_method = 'skewness-corrected'
[../]
[]
[FVKernels]
[./advection]
type = FVAdvection
variable = v
velocity = '${a} 0 0'
[../]
[./diffusion]
type = FVDiffusion
variable = v
coeff = coeff
[../]
[./body]
type = FVBodyForce
variable = v
function = 'forcing'
[../]
[]
[FVBCs]
[left]
type = FVFunctionDirichletBC
boundary = 'left'
function = 'exact'
variable = v
[]
[top]
type = FVNeumannBC
boundary = 'top'
value = 0
variable = v
[]
[bottom]
type = FVNeumannBC
boundary = 'bottom'
value = 0
variable = v
[]
[right]
type = FVConstantScalarOutflowBC
variable = v
velocity = '${a} 0 0'
boundary = 'right'
[]
[]
[Materials]
[diff]
type = ADGenericFunctorMaterial
prop_names = 'coeff'
prop_values = '${diff}'
[]
[]
[Functions]
[exact]
type = ParsedFunction
expression = 'cos(x)'
[]
[forcing]
type = ParsedFunction
expression = 'cos(x) - sin(x)'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type -snes_linesearch_minlambda'
petsc_options_value = 'hypre boomeramg 1e-9'
[]
[Outputs]
csv = true
[]
[Postprocessors]
[./error]
type = ElementL2Error
variable = v
function = exact
outputs = 'console csv'
execute_on = 'timestep_end'
[../]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/lid-driven-turb-energy.i)
##########################################################
# Lid-driven cavity test
# Reynolds: 5,000
# Author: Dr. Mauricio Tano
# Last Update: Novomber, 2023
# Turbulent model using:
# k-epsilon model with energy transport
# Standard wall functions without temperature wall functions
# SIMPLE Solve
##########################################################
### Thermophsyical Properties ###
mu = 2e-5
rho = 1.0
k = 0.01
cp = 10.0
Pr_t = 0.9
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epslilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Modeling parameters ###
non_equilibrium_treatment = false
bulk_wall_treatment = false
walls = 'left top right bottom'
max_mixing_length = 1e10
linearized_yplus_mu_t = false
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
pressure_tag = "pressure_grad"
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system energy_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolatorSegregated
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 0.0
solver_sys = u_system
two_term_boundary_expansion = false
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 0.0
solver_sys = v_system
two_term_boundary_expansion = false
[]
[pressure]
type = INSFVPressureVariable
solver_sys = pressure_system
initial_condition = 0.2
two_term_boundary_expansion = false
[]
[T_fluid]
type = INSFVEnergyVariable
solver_sys = energy_system
initial_condition = 1.0
two_term_boundary_expansion = false
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
[]
[]
[FVKernels]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = true
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = true
u = vel_x
v = vel_y
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[p_diffusion]
type = FVAnisotropicDiffusion
variable = pressure
coeff = "Ainv"
coeff_interp_method = 'average'
[]
[p_source]
type = FVDivergence
variable = pressure
vector_field = "HbyA"
force_boundary_execution = true
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T_fluid
[]
[temp_conduction]
type = FVDiffusion
coeff = ${k}
variable = T_fluid
[]
[temp_turb_conduction]
type = FVDiffusion
coeff = 'k_t'
variable = T_fluid
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
non_equilibrium_treatment = ${non_equilibrium_treatment}
max_mixing_length = ${max_mixing_length}
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
k = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
non_equilibrium_treatment = ${non_equilibrium_treatment}
max_mixing_length = ${max_mixing_length}
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${lid_velocity}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[T_hot]
type = FVDirichletBC
variable = T_fluid
boundary = 'top'
value = 1
[]
[T_cold]
type = FVDirichletBC
variable = T_fluid
boundary = 'bottom'
value = 0
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = 'left right top bottom'
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
k = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
linearized_yplus = ${linearized_yplus_mu_t}
non_equilibrium_treatment = ${non_equilibrium_treatment}
execute_on = 'NONLINEAR'
[]
[]
[Materials]
[ins_fv]
type = INSFVEnthalpyMaterial
temperature = 'T_fluid'
rho = ${rho}
cp = ${cp}
[]
[k_t]
type = ADParsedFunctorMaterial
expression = 'mu_t * cp / Pr_t'
functor_names = 'mu_t ${cp} ${Pr_t}'
functor_symbols = 'mu_t cp Pr_t'
property_name = 'k_t'
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
energy_system = 'energy_system'
turbulence_systems = 'TKED_system TKE_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.5
energy_equation_relaxation = 0.9
turbulence_equation_relaxation = '0.8 0.8'
num_iterations = 500
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
energy_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
energy_petsc_options_iname = '-pc_type -pc_hypre_type'
energy_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-14
energy_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
energy_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
[]
[Outputs]
exodus = true
csv = false
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
(modules/porous_flow/test/tests/gravity/grav02b_fv.i)
# Checking that gravity head is established in the steady-state situation when 0<saturation<1 (note the strictly less-than).
# 2phase (PP), 2components, vanGenuchten, constant fluid bulk-moduli for each phase, constant viscosity, constant permeability, Corey relative perm
# For better agreement with the analytical solution (ana_pp), just increase nx
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
xmin = -1
xmax = 0
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[ppwater]
type = MooseVariableFVReal
initial_condition = -1.0
[]
[ppgas]
type = MooseVariableFVReal
initial_condition = 0
[]
[]
[AuxVariables]
[massfrac_ph0_sp0]
type = MooseVariableFVReal
initial_condition = 1
[]
[massfrac_ph1_sp0]
type = MooseVariableFVReal
initial_condition = 0
[]
[]
[FVKernels]
[flux0]
type = FVPorousFlowAdvectiveFlux
fluid_component = 0
variable = ppwater
gravity = '-1 0 0'
[]
[flux1]
type = FVPorousFlowAdvectiveFlux
fluid_component = 1
variable = ppgas
gravity = '-1 0 0'
[]
[]
[FVBCs]
[ppwater]
type = FVDirichletBC
boundary = right
variable = ppwater
value = -1
[]
[ppgas]
type = FVDirichletBC
boundary = right
variable = ppgas
value = 0
[]
[]
[Functions]
[ana_ppwater]
type = ParsedFunction
symbol_names = 'g B p0 rho0'
symbol_values = '1 2 pp_water_top 1'
expression = '-B*log(exp(-p0/B)+g*rho0*x/B)' # expected pp at base
[]
[ana_ppgas]
type = ParsedFunction
symbol_names = 'g B p0 rho0'
symbol_values = '1 1 pp_gas_top 0.1'
expression = '-B*log(exp(-p0/B)+g*rho0*x/B)' # expected pp at base
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'ppwater ppgas'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureVG
m = 0.5
alpha = 1
[]
[]
[FluidProperties]
[simple_fluid0]
type = SimpleFluidProperties
bulk_modulus = 2
density0 = 1
viscosity = 1
thermal_expansion = 0
[]
[simple_fluid1]
type = SimpleFluidProperties
bulk_modulus = 1
density0 = 0.1
viscosity = 0.5
thermal_expansion = 0
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
[]
[ppss]
type = ADPorousFlow2PhasePP
phase0_porepressure = ppwater
phase1_porepressure = ppgas
capillary_pressure = pc
[]
[massfrac]
type = ADPorousFlowMassFraction
mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
[]
[simple_fluid0]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid0
phase = 0
[]
[simple_fluid1]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid1
phase = 1
[]
[permeability]
type = ADPorousFlowPermeabilityConst
permeability = '1 0 0 0 2 0 0 0 3'
[]
[relperm_water]
type = ADPorousFlowRelativePermeabilityCorey
n = 1
phase = 0
[]
[relperm_gas]
type = ADPorousFlowRelativePermeabilityCorey
n = 1
phase = 1
[]
[]
[Postprocessors]
[pp_water_top]
type = PointValue
variable = ppwater
point = '0 0 0'
[]
[pp_water_base]
type = PointValue
variable = ppwater
point = '-1 0 0'
[]
[pp_water_analytical]
type = FunctionValuePostprocessor
function = ana_ppwater
point = '-1 0 0'
[]
[pp_gas_top]
type = PointValue
variable = ppgas
point = '0 0 0'
[]
[pp_gas_base]
type = PointValue
variable = ppgas
point = '-1 0 0'
[]
[pp_gas_analytical]
type = FunctionValuePostprocessor
function = ana_ppgas
point = '-1 0 0'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = Newton
[]
[Outputs]
[csv]
type = CSV
[]
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/channel-flow/2d-transient-action.i)
l = 10
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_v = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 20
ny = 10
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'weakly-compressible'
add_energy_equation = true
density = 'rho'
dynamic_viscosity = 'mu'
thermal_conductivity = 'k'
specific_heat = 'cp'
initial_velocity = '${inlet_v} 1e-15 0'
initial_temperature = '${inlet_temp}'
initial_pressure = '${outlet_pressure}'
inlet_boundaries = 'left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_function = '${inlet_v} 0'
energy_inlet_types = 'fixed-temperature'
energy_inlet_function = '${inlet_temp}'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip noslip'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '0 0'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${outlet_pressure}'
external_heat_source = 'power_density'
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
energy_advection_interpolation = 'average'
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k mu'
prop_values = '${cp} ${k} ${mu}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T_fluid
pressure = pressure
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-3
optimal_iterations = 6
[]
end_time = 15
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
off_diagonals_in_auto_scaling = true
compute_scaling_once = false
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/natural_convection/natural_circulation_pipe.i)
# natural convection through a pipe
# Reference solution in "reference_pipe_natural_convection.py"
# Reference mdot: 0.0792 kg/s
# this input
# iy mdot
# 10 8.302364e-02
# 20 8.111192e-02
# 40 8.007924e-02
# 80 7.954403e-02
# 160 7.927201e-02
# Convergence to the analytical result is observed
height = 10.0
gravity = 9.81
p0 = 1e5
molar_mass = 29.0e-3
T0 = 328
Ru = 8.3145
Ri = '${fparse Ru / molar_mass}'
density = '${fparse p0 / (Ri * T0)}'
head = '${fparse height * density * gravity}'
k = 25.68e-3
gamma = 1.4
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '0.1'
ix = '2'
dy = '${height}'
iy = '5'
[]
[]
[GlobalParams]
rhie_chow_user_object = pins_rhie_chow_interpolator
[]
[FluidProperties]
[air]
type = IdealGasFluidProperties
molar_mass = ${molar_mass}
k = ${k}
gamma = ${gamma}
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'weakly-compressible'
add_energy_equation = true
gravity = '0 -${gravity} 0'
density = rho
dynamic_viscosity = mu
specific_heat = cp
thermal_conductivity = k
initial_velocity = '0 1e-6 0'
initial_pressure = ${p0}
initial_temperature = ${T0}
inlet_boundaries = 'bottom'
momentum_inlet_types = 'fixed-pressure'
momentum_inlet_function = '${fparse p0 + head}'
energy_inlet_types = 'fixed-temperature'
energy_inlet_function = '${T0}'
energy_scaling = 1e-5
wall_boundaries = 'left right'
momentum_wall_types = 'slip slip'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '300 300'
outlet_boundaries = 'top'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${fparse p0}'
momentum_advection_interpolation = 'upwind'
mass_advection_interpolation = 'upwind'
porous_medium_treatment = true
porosity = porosity
energy_advection_interpolation = 'average'
[]
[]
[FVKernels]
[u_friction]
type = INSFVMomentumFriction
variable = superficial_vel_x
linear_coef_name = linear_friction_coeff
momentum_component = 'x'
[]
[v_friction]
type = INSFVMomentumFriction
variable = superficial_vel_y
linear_coef_name = linear_friction_coeff
momentum_component = 'y'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-6
end_time = 1e4
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.1
growth_factor = 2
iteration_window = 2
optimal_iterations = 6
[]
[]
[Functions]
[mu_rampdown_fn]
type = PiecewiseLinear
x = '0 0.5 1 5 10 100 1000 2000'
y = '1000 1000 100 10 1 1 1 0'
[]
[]
[FunctorMaterials]
[fluid_props_to_mat_props]
type = GeneralFunctorFluidProps
fp = air
pressure = pressure
T_fluid = T_fluid
speed = speed
force_define_density = true
mu_rampdown = 'mu_rampdown_fn'
characteristic_length = 1
porosity = porosity
[]
[scalar_props]
type = ADGenericFunctorMaterial
prop_names = 'porosity loss_coeff'
prop_values = '1 1.3'
[]
[linear_friction_coeff]
type = ADParsedFunctorMaterial
property_name = 'linear_friction_coeff'
expression = 'loss_coeff * rho'
functor_names = 'loss_coeff rho'
[]
[]
[AuxVariables]
[rho_var]
type = MooseVariableFVReal
[]
[cp_var]
type = MooseVariableFVReal
[]
[rho_cp_T_fluid_var]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[rho_var_aux]
type = FunctorAux
variable = rho_var
functor = rho
[]
[cp_var_aux]
type = FunctorAux
variable = cp_var
functor = cp
[]
[rho_cp_T_fluid_var_aux]
type = ParsedAux
variable = rho_cp_T_fluid_var
coupled_variables = 'rho_var cp_var T_fluid'
expression = 'rho_var * cp_var * T_fluid'
[]
[]
[Postprocessors]
[inlet_mfr]
type = VolumetricFlowRate
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = rho
boundary = bottom
advected_interp_method = average
[]
[outlet_mfr]
type = VolumetricFlowRate
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = rho
boundary = top
advected_interp_method = average
[]
[inlet_energy]
type = VolumetricFlowRate
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = rho_cp_T_fluid_var
boundary = bottom
advected_interp_method = average
[]
[outlet_energy]
type = VolumetricFlowRate
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = rho_cp_T_fluid_var
boundary = top
advected_interp_method = average
[]
[]
[Debug]
show_var_residual_norms = true
[]
[Outputs]
exodus = true
[]
(test/tests/auxkernels/advection_flux/advection_flux_fv.i)
[Mesh]
type = GeneratedMesh # Can generate simple lines, rectangles and rectangular prisms
dim = 2 # Dimension of the mesh
nx = 10 # Number of elements in the x direction
ny = 10 # Number of elements in the y direction
xmax = 1.0
ymax = 1.0
[]
[Variables]
[u]
type = MooseVariableFVReal
two_term_boundary_expansion = false
[]
[]
[AuxVariables]
[flux_x]
type = MooseVariableFVReal
order = CONSTANT
family = MONOMIAL
[]
[]
[ICs]
[u_ic]
type = FunctionIC
variable = u
function = 'r2 := (x - 0.5)*(x - 0.5) + (y - 0.3)*(y - 0.3); exp(-r2 * 20)'
[]
[]
[FVKernels]
[advection]
type = FVAdvection
variable = u
velocity = '1 0.5 0'
[]
[time]
type = FVTimeKernel
variable = u
[]
[]
[FVBCs]
[fv_outflow]
type = FVConstantScalarOutflowBC
velocity = '1 0.5 0'
variable = u
boundary = 'right top'
[]
[]
[AuxKernels]
[flux_x]
type = AdvectiveFluxAux
variable = flux_x
vel_x = 1
vel_y = 0.5
advected_variable = u
component = normal
boundary = 'left right'
check_boundary_restricted = false
[]
[]
[Postprocessors]
[flux_right]
type = SideIntegralVariablePostprocessor
variable = flux_x
boundary = 'right'
[]
[flux_right_exact]
type = SideAdvectiveFluxIntegral
vel_x = 1
vel_y = 0.5
component = normal
advected_quantity = u
boundary = 'right'
[]
[flux_left]
type = SideIntegralVariablePostprocessor
variable = flux_x
boundary = 'left'
[]
[flux_left_exact]
type = SideAdvectiveFluxIntegral
vel_x = 1
vel_y = 0.5
component = normal
advected_quantity = u
boundary = 'left'
[]
[]
[Executioner]
type = Transient
petsc_options = '-snes_converged_reason'
num_steps = 10
dt = 0.25
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(test/tests/fvkernels/orthogonal-diffusion/orthogonal-diffusion.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 32
ny = 32
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
[]
[]
[FVKernels]
[diff]
type = FVOrthogonalDiffusion
variable = u
coeff = 1
[]
[]
[FVBCs]
[left]
type = FVOrthogonalBoundaryDiffusion
boundary = 'top'
variable = u
function = 0
coeff = 1
[]
[right]
type = FVOrthogonalBoundaryDiffusion
boundary = 'bottom'
variable = u
function = 1
coeff = 1
[]
[]
[Executioner]
solve_type = NEWTON
type = Steady
[]
[Outputs]
exodus = true
[]
(test/tests/fvkernels/mms/broken-domain/diffusion.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 2
xmax = 2
[]
[subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '1.0 0 0'
block_id = 1
top_right = '2.0 1.0 0'
[]
[interface_primary_side]
input = subdomain1
type = SideSetsBetweenSubdomainsGenerator
primary_block = '0'
paired_block = '1'
new_boundary = 'primary_interface'
[]
[interface_secondary_side]
input = interface_primary_side
type = SideSetsBetweenSubdomainsGenerator
primary_block = '1'
paired_block = '0'
new_boundary = 'secondary_interface'
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
block = 0
initial_condition = 0.5
[]
[v]
type = MooseVariableFVReal
block = 1
initial_condition = 0.5
[]
[]
[FVKernels]
[diff_left]
type = FVDiffusion
variable = u
coeff = 'left'
block = 0
[]
[diff_right]
type = FVDiffusion
variable = v
coeff = 'right'
block = 1
[]
[body_left]
type = FVBodyForce
variable = u
function = 'forcing'
block = 0
[]
[body_right]
type = FVBodyForce
variable = v
function = 'forcing'
block = 1
[]
[]
[FVInterfaceKernels]
# This will add a flux term for variable1, e.g. u
[interface]
type = FVOnlyAddDiffusionToOneSideOfInterface
variable1 = u
variable2 = v
boundary = 'primary_interface'
subdomain1 = '0'
subdomain2 = '1'
coeff2 = 'right'
[]
[]
[FVBCs]
[left]
type = FVFunctionDirichletBC
variable = u
boundary = 'left'
function = 'exact'
[]
[right]
type = FVFunctionDirichletBC
variable = v
boundary = 'right'
function = 'exact'
[]
[middle]
# by adding a dirichlet BC we ensure that flux kernels will run for variable v
type = FVADUseFunctorSideForSsfDirichletBC
variable = v
functor = u
boundary = 'secondary_interface'
[]
[]
[Materials]
[block0]
type = ADGenericFunctorMaterial
block = '0'
prop_names = 'left'
prop_values = '1'
[]
[block1]
type = ADGenericFunctorMaterial
block = '1'
prop_names = 'right'
prop_values = '1'
[]
[composite]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = 'composite'
subdomain_to_prop_value = '0 u 1 v'
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm lu NONZERO'
[]
[Outputs]
exodus = true
csv = true
[]
[Functions]
[exact]
type = ParsedFunction
value = '3*x^2 + 2*x + 1'
[]
[forcing]
type = ParsedFunction
value = '-6'
[]
[]
[Postprocessors]
[error]
type = ElementL2FunctorError
approximate = composite
exact = exact
outputs = 'console csv'
[]
[h]
type = AverageElementSize
outputs = 'console csv'
[]
[]
(test/tests/functors/matching-analytic-solution/test.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 20
[]
[]
[Variables]
[u][]
[]
[AuxVariables]
[nodal][]
[elemental]
type = MooseVariableFVReal
[]
[elemental_grad]
type = MooseVariableFVReal
[]
[elemental_dot]
type = MooseVariableFVReal
[]
[elemental_grad_dot]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[nodal]
type = FunctorAux
functor = u
variable = nodal
[]
[elemental]
type = FunctorAux
functor = u
variable = elemental
[]
[elemental_dot]
type = FunctorAux
functor = dmat_dt
variable = elemental_dot
[]
[elemental_grad]
type = FunctorVectorElementalAux
functor = grad_mat
component = 0
variable = elemental_grad
[]
[elemental_grad_dot]
type = FunctorVectorElementalAux
functor = grad_dmat_dt
component = 0
variable = elemental_grad_dot
[]
[]
[Functions]
[analytic]
type = ParsedFunction
expression = 'x*t'
[]
[grad]
type = ParsedFunction
expression = 't'
[]
[dot]
type = ParsedFunction
expression = 'x'
[]
[grad_dot]
type = ParsedFunction
expression = '1'
[]
[]
[FunctorMaterials]
[val_dot_grad_dot]
type = ADGenericFunctorMaterial
prop_names = 'mat'
prop_values = 'u'
[]
[grad]
type = ADGenericFunctorGradientMaterial
prop_names = 'grad_mat'
prop_values = 'u'
[]
[]
[NodalKernels]
[rxn]
type = ReactionNodalKernel
variable = u
[]
[ffn]
type = UserForcingFunctionNodalKernel
variable = u
function = analytic
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
num_steps = 1
dt = 1
[]
[Postprocessors]
[u_err]
type = ElementL2FunctorError
approximate = u
exact = analytic
[]
[nodal_err]
type = ElementL2FunctorError
approximate = nodal
exact = analytic
[]
[elemental_err]
type = ElementL2FunctorError
approximate = elemental
exact = analytic
[]
[dot_err]
type = ElementL2FunctorError
approximate = elemental_dot
exact = dot
[]
[grad_err]
type = ElementL2FunctorError
approximate = elemental_grad
exact = grad
[]
[grad_dot_err]
type = ElementL2FunctorError
approximate = elemental_grad_dot
exact = grad_dot
[]
[]
[Outputs]
csv = true
[]
(test/tests/functormaterials/smoother/test.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 100
ny = 1
xmax = 10
ymax = 1
[]
[]
[AuxVariables]
[checkerboard]
type = MooseVariableFVReal
[]
[smooth]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[checker]
type = ParsedAux
variable = checkerboard
# nonlinear growth to challenge the smoother a bit
expression = '2 + x * x * sin(PI * 10 * x)'
constant_names = 'PI'
constant_expressions = '3.14159265359'
use_xyzt = true
execute_on = 'TIMESTEP_BEGIN'
[]
[smooth]
type = FunctorAux
variable = smooth
functor = 'smoothed_functor'
execute_on = 'TIMESTEP_END'
[]
[]
[FunctorMaterials]
[smooth]
type = FunctorSmoother
functors_in = 'checkerboard'
functors_out = 'smoothed_functor'
# Using the face values will not smooth a checkerboard because the 'extreme' neighbor value are
# mixed with the element value
# Using the layered element average will smooth a checkerboard in 2D inside the volume, and fail to do so
# near the boundaries. In 1D it wont fix a checkboard as it does not average with the local value
# smoothing_technique = 'layered_elem_average'
smoothing_technique = 'remove_checkerboard'
# smoothing_technique = 'face_average'
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[VectorPostprocessors]
[line]
type = LineValueSampler
variable = 'smooth'
num_points = 100
start_point = '0.05 0.5 0'
end_point = '9.95 0.5 0'
sort_by = 'x'
[]
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/segregated/2d-heated.i)
mu = 1
rho = 1
k = 1e-3
cp = 1
u_inlet = 1
T_inlet = 200
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
pressure_tag = "pressure_grad"
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '5 5'
dy = '1.0'
ix = '10 10'
iy = '5'
subdomain_id = '1 2'
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = PINSFVRhieChowInterpolatorSegregated
u = superficial_vel_x
v = superficial_vel_y
pressure = pressure
porosity = porosity
[]
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system energy_system solid_energy_system'
previous_nl_solution_required = true
[]
[Variables]
[superficial_vel_x]
type = PINSFVSuperficialVelocityVariable
initial_condition = ${u_inlet}
solver_sys = u_system
two_term_boundary_expansion = false
[]
[superficial_vel_y]
type = PINSFVSuperficialVelocityVariable
initial_condition = 1e-6
solver_sys = v_system
two_term_boundary_expansion = false
[]
[pressure]
type = INSFVPressureVariable
two_term_boundary_expansion = false
solver_sys = pressure_system
[]
[T_fluid]
type = INSFVEnergyVariable
two_term_boundary_expansion = false
solver_sys = energy_system
initial_condition = 200
[]
[T_solid]
type = MooseVariableFVReal
two_term_boundary_expansion = false
solver_sys = solid_energy_system
initial_condition = 200
[]
[]
[AuxVariables]
[porosity]
type = MooseVariableFVReal
initial_condition = 0.5
two_term_boundary_expansion = false
[]
[]
[FVKernels]
[u_advection]
type = PINSFVMomentumAdvection
variable = superficial_vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
porosity = porosity
momentum_component = 'x'
[]
[u_viscosity]
type = PINSFVMomentumDiffusion
variable = superficial_vel_x
mu = ${mu}
porosity = porosity
momentum_component = 'x'
[]
[u_pressure]
type = PINSFVMomentumPressure
variable = superficial_vel_x
momentum_component = 'x'
pressure = pressure
porosity = porosity
extra_vector_tags = ${pressure_tag}
[]
[v_advection]
type = PINSFVMomentumAdvection
variable = superficial_vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
porosity = porosity
momentum_component = 'y'
[]
[v_viscosity]
type = PINSFVMomentumDiffusion
variable = superficial_vel_y
mu = ${mu}
porosity = porosity
momentum_component = 'y'
[]
[v_pressure]
type = PINSFVMomentumPressure
variable = superficial_vel_y
momentum_component = 'y'
pressure = pressure
porosity = porosity
extra_vector_tags = ${pressure_tag}
[]
[p_diffusion]
type = FVAnisotropicDiffusion
variable = pressure
coeff = "Ainv"
coeff_interp_method = 'average'
[]
[p_source]
type = FVDivergence
variable = pressure
vector_field = "HbyA"
force_boundary_execution = true
[]
[energy_advection]
type = PINSFVEnergyAdvection
variable = T_fluid
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
boundaries_to_force = bottom
[]
[energy_diffusion]
type = PINSFVEnergyDiffusion
k = ${k}
variable = T_fluid
porosity = porosity
[]
[energy_convection]
type = PINSFVEnergyAmbientConvection
variable = T_fluid
is_solid = false
T_fluid = 'T_fluid'
T_solid = 'T_solid'
h_solid_fluid = 'h_cv'
[]
[solid_energy_diffusion]
type = FVDiffusion
coeff = ${k}
variable = T_solid
[]
[solid_energy_convection]
type = PINSFVEnergyAmbientConvection
variable = T_solid
is_solid = true
T_fluid = 'T_fluid'
T_solid = 'T_solid'
h_solid_fluid = 'h_cv'
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = superficial_vel_x
function = ${u_inlet}
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = superficial_vel_y
function = 0
[]
[inlet-T]
type = FVDirichletBC
variable = T_fluid
value = ${T_inlet}
boundary = 'left'
[]
[no-slip-u]
type = INSFVNoSlipWallBC
boundary = 'top'
variable = superficial_vel_x
function = 0
[]
[no-slip-v]
type = INSFVNoSlipWallBC
boundary = 'top'
variable = superficial_vel_y
function = 0
[]
[heated-side]
type = FVDirichletBC
boundary = 'top'
variable = 'T_solid'
value = 250
[]
[symmetry-u]
type = PINSFVSymmetryVelocityBC
boundary = 'bottom'
variable = superficial_vel_x
u = superficial_vel_x
v = superficial_vel_y
mu = ${mu}
momentum_component = 'x'
[]
[symmetry-v]
type = PINSFVSymmetryVelocityBC
boundary = 'bottom'
variable = superficial_vel_y
u = superficial_vel_x
v = superficial_vel_y
mu = ${mu}
momentum_component = 'y'
[]
[symmetry-p]
type = INSFVSymmetryPressureBC
boundary = 'bottom'
variable = pressure
[]
[outlet-p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = 0.1
[]
[]
[FunctorMaterials]
[constants]
type = ADGenericFunctorMaterial
prop_names = 'h_cv cp'
prop_values = '0.1 ${cp}'
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
rho = ${rho}
temperature = 'T_fluid'
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
energy_l_abs_tol = 1e-14
solid_energy_l_abs_tol = 1e-14
momentum_l_tol = 0
pressure_l_tol = 0
energy_l_tol = 0
solid_energy_l_tol = 0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
energy_system = 'energy_system'
solid_energy_system = 'solid_energy_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.4
energy_equation_relaxation = 1.0
num_iterations = 160
pressure_absolute_tolerance = 1e-13
momentum_absolute_tolerance = 1e-13
energy_absolute_tolerance = 1e-13
solid_energy_absolute_tolerance = 1e-13
print_fields = false
[]
[Outputs]
exodus = true
csv = false
[]
(test/tests/fvkernels/mms/advective-outflow/advection-outflow.i)
a=1.1
[GlobalParams]
advected_interp_method = 'average'
[]
[Mesh]
[./gen_mesh]
type = GeneratedMeshGenerator
dim = 1
xmin = 0
xmax = 1.1
nx = 2
[../]
[]
[Variables]
[./u]
family = MONOMIAL
order = CONSTANT
fv = true
two_term_boundary_expansion = false
type = MooseVariableFVReal
[../]
[./v]
family = MONOMIAL
order = CONSTANT
fv = true
two_term_boundary_expansion = true
type = MooseVariableFVReal
[../]
[]
[FVKernels]
[./advection_u]
type = FVAdvection
variable = u
velocity = '${a} 0 0'
[../]
[body_u]
type = FVBodyForce
variable = u
function = 'forcing'
[]
[./advection_v]
type = FVAdvection
variable = v
velocity = '${a} 0 0'
[../]
[body_v]
type = FVBodyForce
variable = v
function = 'forcing'
[]
[]
[FVBCs]
[left_u]
type = FVFunctionDirichletBC
boundary = 'left'
function = 'exact'
variable = u
[]
[right_u]
type = FVConstantScalarOutflowBC
variable = u
velocity = '${a} 0 0'
boundary = 'right'
[]
[left_v]
type = FVFunctionDirichletBC
boundary = 'left'
function = 'exact'
variable = v
[]
[right_v]
type = FVConstantScalarOutflowBC
variable = v
velocity = '${a} 0 0'
boundary = 'right'
[]
[]
[Functions]
[exact]
type = ParsedFunction
expression = 'cos(x)'
[]
[forcing]
type = ParsedFunction
expression = '-${a} * sin(x)'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu NONZERO mumps'
[]
[Outputs]
exodus = true
csv = true
[]
[Postprocessors]
[./L2u]
type = ElementL2Error
variable = u
function = exact
outputs = 'console csv'
execute_on = 'timestep_end'
[../]
[./L2v]
type = ElementL2Error
variable = v
function = exact
outputs = 'console csv'
execute_on = 'timestep_end'
[../]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/cns/heated-channel/transient-porous-kt-primitive.i)
p_initial=1.01e5
T=273.15
u_in=10
eps=1
superficial_vel_in=${fparse u_in * eps}
[GlobalParams]
fp = fp
limiter = 'vanLeer'
two_term_boundary_expansion = true
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = 0
xmax = 10
nx = 100
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
initial_condition = ${p_initial}
[]
[superficial_vel_x]
type = MooseVariableFVReal
initial_condition = ${superficial_vel_in}
[]
[temperature]
type = MooseVariableFVReal
initial_condition = ${T}
[]
[]
[AuxVariables]
[rho]
type = MooseVariableFVReal
[]
[superficial_rhou]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[rho]
type = ADMaterialRealAux
variable = rho
property = rho
execute_on = 'timestep_end'
[]
[superficial_rhou]
type = ADMaterialRealAux
variable = superficial_rhou
property = superficial_rhou
execute_on = 'timestep_end'
[]
[]
[FVKernels]
[mass_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_dt'
variable = pressure
[]
[mass_advection]
type = PCNSFVKT
variable = pressure
eqn = "mass"
[]
[momentum_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhou_dt'
variable = superficial_vel_x
[]
[momentum_advection]
type = PCNSFVKT
variable = superficial_vel_x
eqn = "momentum"
momentum_component = 'x'
[]
[energy_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_et_dt'
variable = temperature
[]
[energy_advection]
type = PCNSFVKT
variable = temperature
eqn = "energy"
[]
[heat]
type = FVBodyForce
variable = temperature
value = 1e6
[]
[]
[FVBCs]
[rho_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = pressure
superficial_velocity = 'superficial_vel_in'
T_fluid = ${T}
eqn = 'mass'
[]
[rhou_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = superficial_vel_x
superficial_velocity = 'superficial_vel_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'x'
[]
[rho_et_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = temperature
superficial_velocity = 'superficial_vel_in'
T_fluid = ${T}
eqn = 'energy'
[]
[rho_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = pressure
pressure = ${p_initial}
eqn = 'mass'
[]
[rhou_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = superficial_vel_x
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'x'
[]
[rho_et_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = temperature
pressure = ${p_initial}
eqn = 'energy'
[]
# Use these to help create more accurate cell centered gradients for cells adjacent to boundaries
[T_left]
type = FVDirichletBC
variable = temperature
value = ${T}
boundary = 'left'
[]
[sup_vel_left]
type = FVDirichletBC
variable = superficial_vel_x
value = ${superficial_vel_in}
boundary = 'left'
[]
[p_right]
type = FVDirichletBC
variable = pressure
value = ${p_initial}
boundary = 'right'
[]
[]
[Functions]
[superficial_vel_in]
type = ParsedVectorFunction
expression_x = '${superficial_vel_in}'
[]
[]
[Materials]
[var_mat]
type = PorousPrimitiveVarMaterial
pressure = pressure
T_fluid = temperature
superficial_vel_x = superficial_vel_x
fp = fp
porosity = porosity
[]
[fluid_only]
type = GenericConstantMaterial
prop_names = 'porosity'
prop_values = '${eps}'
[]
[]
[Executioner]
solve_type = NEWTON
type = Transient
nl_max_its = 20
[TimeStepper]
type = IterationAdaptiveDT
dt = 5e-5
optimal_iterations = 10
[]
steady_state_detection = false
steady_state_tolerance = 1e-12
abort_on_solve_fail = false
end_time = 100
nl_abs_tol = 1e-8
dtmin = 5e-5
automatic_scaling = true
compute_scaling_once = false
verbose = true
petsc_options_iname = '-pc_type -pc_factor_mat_solver_type -pc_factor_shift_type -snes_linesearch_minlambda'
petsc_options_value = 'lu mumps NONZERO 1e-3 '
[]
[Outputs]
[exo]
type = Exodus
execute_on = 'final'
[]
[dof]
type = DOFMap
execute_on = 'initial'
[]
checkpoint = true
[]
[Debug]
show_var_residual_norms = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/varying-eps-basic-kt-mixed.i)
[GlobalParams]
fp = fp
limiter = 'central_difference'
two_term_boundary_expansion = true
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = .1
xmax = .6
nx = 2
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
[]
[sup_mom_x]
type = MooseVariableFVReal
[]
[T_fluid]
type = MooseVariableFVReal
[]
[]
[ICs]
[pressure]
type = FunctionIC
variable = pressure
function = 'exact_p'
[]
[sup_mom_x]
type = FunctionIC
variable = sup_mom_x
function = 'exact_rho_ud'
[]
[T_fluid]
type = FunctionIC
variable = T_fluid
function = 'exact_T'
[]
[]
[FVKernels]
[mass_advection]
type = PCNSFVKT
variable = pressure
eqn = "mass"
[]
[mass_fn]
type = FVBodyForce
variable = pressure
function = 'forcing_rho'
[]
[momentum_x_advection]
type = PCNSFVKT
variable = sup_mom_x
momentum_component = x
eqn = "momentum"
[]
[eps_grad]
type = PNSFVPGradEpsilon
variable = sup_mom_x
momentum_component = 'x'
epsilon_function = 'eps'
[]
[momentum_fn]
type = FVBodyForce
variable = sup_mom_x
function = 'forcing_rho_ud'
[]
[fluid_energy_advection]
type = PCNSFVKT
variable = T_fluid
eqn = "energy"
[]
[energy_fn]
type = FVBodyForce
variable = T_fluid
function = 'forcing_rho_et'
[]
[]
[FVBCs]
[mass_left]
variable = pressure
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'mass'
[]
[momentum_left]
variable = sup_mom_x
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'momentum'
momentum_component = 'x'
[]
[energy_left]
variable = T_fluid
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'energy'
[]
[mass_right]
variable = pressure
type = PCNSFVStrongBC
boundary = right
eqn = 'mass'
pressure = 'exact_p'
[]
[momentum_right]
variable = sup_mom_x
type = PCNSFVStrongBC
boundary = right
eqn = 'momentum'
momentum_component = 'x'
pressure = 'exact_p'
[]
[energy_right]
variable = T_fluid
type = PCNSFVStrongBC
boundary = right
eqn = 'energy'
pressure = 'exact_p'
[]
# help gradient reconstruction
[pressure_right]
type = FVFunctionDirichletBC
variable = pressure
function = exact_p
boundary = 'right'
[]
[sup_mom_x_left]
type = FVFunctionDirichletBC
variable = sup_mom_x
function = exact_rho_ud
boundary = 'left'
[]
[T_fluid_left]
type = FVFunctionDirichletBC
variable = T_fluid
function = exact_T
boundary = 'left'
[]
[]
[Materials]
[var_mat]
type = PorousMixedVarMaterial
pressure = pressure
superficial_rhou = sup_mom_x
T_fluid = T_fluid
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[]
[Functions]
[exact_rho]
type = ParsedFunction
expression = '3.48788261470924*cos(x)'
[]
[forcing_rho]
type = ParsedFunction
expression = '-3.83667087618017*sin(1.1*x)*cos(1.3*x) - 4.53424739912202*sin(1.3*x)*cos(1.1*x)'
[]
[exact_rho_ud]
type = ParsedFunction
expression = '3.48788261470924*cos(1.1*x)*cos(1.3*x)'
[]
[forcing_rho_ud]
type = ParsedFunction
expression = '(-(10.6975765229419*cos(1.5*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + (10.6975765229419*sin(x)*cos(1.5*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 16.0463647844128*sin(1.5*x)/cos(x))*cos(x))*cos(1.3*x) + 3.48788261470924*sin(x)*cos(1.1*x)^2*cos(1.3*x)/cos(x)^2 - 7.67334175236034*sin(1.1*x)*cos(1.1*x)*cos(1.3*x)/cos(x) - 4.53424739912202*sin(1.3*x)*cos(1.1*x)^2/cos(x)'
[]
[exact_rho_et]
type = ParsedFunction
expression = '26.7439413073546*cos(1.5*x)'
[]
[forcing_rho_et]
type = ParsedFunction
expression = '1.0*(3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.5*x))*sin(x)*cos(1.1*x)*cos(1.3*x)/cos(x)^2 - 1.1*(3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.5*x))*sin(1.1*x)*cos(1.3*x)/cos(x) - 1.3*(3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.5*x))*sin(1.3*x)*cos(1.1*x)/cos(x) + 1.0*(-(10.6975765229419*cos(1.5*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + (10.6975765229419*sin(x)*cos(1.5*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 16.0463647844128*sin(1.5*x)/cos(x))*cos(x) - 40.1159119610319*sin(1.5*x))*cos(1.1*x)*cos(1.3*x)/cos(x)'
[]
[exact_T]
type = ParsedFunction
expression = '0.0106975765229418*cos(1.5*x)/cos(x) - 0.000697576522941848*cos(1.1*x)^2/cos(x)^2'
[]
[exact_eps_p]
type = ParsedFunction
expression = '3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)*cos(1.3*x)'
[]
[exact_p]
type = ParsedFunction
expression = '3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)'
[]
[exact_sup_vel_x]
type = ParsedFunction
expression = '1.0*cos(1.1*x)*cos(1.3*x)/cos(x)'
[]
[eps]
type = ParsedFunction
expression = 'cos(1.3*x)'
[]
[exact_superficial_velocity]
type = ParsedVectorFunction
expression_x = '1.0*cos(1.1*x)*cos(1.3*x)/cos(x)'
[]
[]
[Executioner]
solve_type = NEWTON
type = Transient
num_steps = 1
dtmin = 1
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_max_its = 50
line_search = bt
nl_rel_tol = 1e-12
nl_abs_tol = 1e-12
[]
[Outputs]
exodus = true
csv = true
[]
[Debug]
show_var_residual_norms = true
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2pressure]
type = ElementL2Error
variable = pressure
function = exact_p
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2sup_mom_x]
variable = sup_mom_x
function = exact_rho_ud
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2T_fluid]
variable = T_fluid
function = exact_T
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/dirichlet_bcs_velocity.i)
rho = 'rho'
l = 10
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 10
ny = 5
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = WCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = u
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = v
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T
rho = rho
drho_dt = drho_dt
h = h
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T
v = power_density
[]
[]
[FVBCs]
# Inlet
[inlet_u]
type = WCNSFVInletVelocityBC
variable = u
boundary = 'left'
velocity_pp = 'inlet_u'
[]
[inlet_v]
type = WCNSFVInletVelocityBC
variable = v
boundary = 'left'
velocity_pp = 0
[]
[inlet_T]
type = WCNSFVInletTemperatureBC
variable = T
boundary = 'left'
temperature_pp = 'inlet_T'
[]
[outlet_p]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
[]
# Walls
[no_slip_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = v
boundary = 'top bottom'
function = 0
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_u]
type = Receiver
default = ${inlet_velocity}
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-2
optimal_iterations = 6
[]
end_time = 1
line_search = 'none'
automatic_scaling = true
compute_scaling_once = false
off_diagonals_in_auto_scaling = true
[]
[Debug]
show_var_residual_norms = true
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(modules/porous_flow/test/tests/gravity/grav01a_fv.i)
# Checking that gravity head is established using FV
# 1phase, vanGenuchten, constant fluid-bulk, constant viscosity, constant permeability, Corey relative perm
# fully saturated
# For better agreement with the analytical solution (ana_pp), just increase nx
[Mesh]
type = GeneratedMesh
dim = 1
nx = 100
xmin = -1
xmax = 0
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[pp]
type = MooseVariableFVReal
[]
[]
[ICs]
[p]
type = RandomIC
variable = pp
min = 0
max = 1
[]
[]
[FVKernels]
[flux0]
type = FVPorousFlowAdvectiveFlux
fluid_component = 0
variable = pp
gravity = '-1 0 0'
[]
[]
[Functions]
[ana_pp]
type = ParsedFunction
symbol_names = 'g B p0 rho0'
symbol_values = '1 1.2 0 1'
expression = '-B*log(exp(-p0/B)+g*rho0*x/B)' # expected pp at base
[]
[]
[FVBCs]
[z]
type = FVDirichletBC
variable = pp
boundary = right
value = 0
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp'
number_fluid_phases = 1
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
m = 0.5
alpha = 1
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 1.2
density0 = 1
viscosity = 1
thermal_expansion = 0
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
[]
[ppss]
type = ADPorousFlow1PhaseP
porepressure = pp
capillary_pressure = pc
[]
[massfrac]
type = ADPorousFlowMassFraction
[]
[simple_fluid]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[permeability]
type = ADPorousFlowPermeabilityConst
permeability = '1 0 0 0 2 0 0 0 3'
[]
[relperm]
type = ADPorousFlowRelativePermeabilityCorey
n = 1
phase = 0
[]
[]
[Postprocessors]
[pp_base]
type = PointValue
variable = pp
point = '-1 0 0'
[]
[pp_analytical]
type = FunctionValuePostprocessor
function = ana_pp
point = '-1 0 0'
[]
[pp_00]
type = PointValue
variable = pp
point = '0 0 0'
[]
[pp_01]
type = PointValue
variable = pp
point = '-0.1 0 0'
[]
[pp_02]
type = PointValue
variable = pp
point = '-0.2 0 0'
[]
[pp_03]
type = PointValue
variable = pp
point = '-0.3 0 0'
[]
[pp_04]
type = PointValue
variable = pp
point = '-0.4 0 0'
[]
[pp_05]
type = PointValue
variable = pp
point = '-0.5 0 0'
[]
[pp_06]
type = PointValue
variable = pp
point = '-0.6 0 0'
[]
[pp_07]
type = PointValue
variable = pp
point = '-0.7 0 0'
[]
[pp_08]
type = PointValue
variable = pp
point = '-0.8 0 0'
[]
[pp_09]
type = PointValue
variable = pp
point = '-0.9 0 0'
[]
[pp_10]
type = PointValue
variable = pp
point = '-1 0 0'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = Newton
[]
[Outputs]
[csv]
type = CSV
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/channel/channel_ERCOFTAC.i)
##########################################################
# ERCOFTAC test case foe turbulent channel flow
# Case Number: 032
# Author: Dr. Mauricio Tano
# Last Update: Novomber, 2023
# Turbulent model using:
# k-epsilon model
# Equilibrium + Newton wall treatement
# SIMPLE solve
##########################################################
H = 1 #halfwidth of the channel
L = 30
Re = 13700
rho = 1
bulk_u = 1
mu = '${fparse rho * bulk_u * 2 * H / Re}'
advected_interp_method = 'upwind'
pressure_tag = "pressure_grad"
### k-epslilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Initial and Boundary Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * bulk_u)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / H}'
### Modeling parameters ###
non_equilibrium_treatment = true
bulk_wall_treatment = false
walls = 'top'
max_mixing_length = 1e10
linearized_yplus_mu_t = false
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = 0
ymax = ${H}
nx = 20
ny = 5
bias_y = 0.7
[]
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
velocity_interp_method = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolatorSegregated
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = ${bulk_u}
solver_sys = u_system
two_term_boundary_expansion = false
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 0
solver_sys = v_system
two_term_boundary_expansion = false
[]
[pressure]
type = INSFVPressureVariable
initial_condition = 1e-8
solver_sys = pressure_system
two_term_boundary_expansion = false
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
[]
[]
[FVKernels]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = true
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = true
u = vel_x
v = vel_y
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[p_diffusion]
type = FVAnisotropicDiffusion
variable = pressure
coeff = "Ainv"
coeff_interp_method = 'average'
[]
[p_source]
type = FVDivergence
variable = pressure
vector_field = "HbyA"
force_boundary_execution = true
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
non_equilibrium_treatment = ${non_equilibrium_treatment}
max_mixing_length = ${max_mixing_length}
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
k = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
non_equilibrium_treatment = ${non_equilibrium_treatment}
max_mixing_length = ${max_mixing_length}
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_x
function = '${bulk_u}'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_y
function = 0
[]
[walls-u]
type = FVDirichletBC
boundary = 'top'
variable = vel_x
value = 0
[]
[walls-v]
type = FVDirichletBC
boundary = 'top'
variable = vel_y
value = 0
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = 0
[]
[inlet_TKE]
type = INSFVInletIntensityTKEBC
boundary = 'left'
variable = TKE
u = vel_x
v = vel_y
intensity = ${intensity}
[]
[inlet_TKED]
type = INSFVMixingLengthTKEDBC
boundary = 'left'
variable = TKED
k = TKE
characteristic_length = '${fparse 2*H}'
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = 'top'
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
wall_treatment = ${wall_treatment}
[]
[sym-u]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = vel_x
u = vel_x
v = vel_y
mu = 'mu_t'
momentum_component = x
[]
[sym-v]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = vel_y
u = vel_x
v = vel_y
mu = 'mu_t'
momentum_component = y
[]
[symmetry_pressure]
type = INSFVSymmetryPressureBC
boundary = 'bottom'
variable = pressure
[]
[symmetry_TKE]
type = INSFVSymmetryScalarBC
boundary = 'bottom'
variable = TKE
[]
[symmetry_TKED]
type = INSFVSymmetryScalarBC
boundary = 'bottom'
variable = TKED
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
k = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
linearized_yplus = ${linearized_yplus_mu_t}
non_equilibrium_treatment = ${non_equilibrium_treatment}
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKED_system TKE_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
turbulence_equation_relaxation = '0.25 0.25'
num_iterations = 1000
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/include/variables/INSFVVariable.h)
// This file is part of the MOOSE framework
// https://www.mooseframework.org
//
// All rights reserved, see COPYRIGHT for full restrictions
// https://github.com/idaholab/moose/blob/master/COPYRIGHT
//
// Licensed under LGPL 2.1, please see LICENSE for details
// https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "MooseVariableFV.h"
class InputParameters;
class INSFVVariable : public MooseVariableFVReal
{
public:
INSFVVariable(const InputParameters & params);
static InputParameters validParams();
// The INSFV system relies on on-the-fly functor evaluation and does not need any pre-init'd data
void computeFaceValues(const FaceInfo &) override;
void computeElemValues() override;
void computeElemValuesFace() override;
void computeNeighborValuesFace() override;
void computeNeighborValues() override;
void requireQpComputations() const override { _qp_calculations = true; }
protected:
/**
* Returns whether the passed-in \p FaceInfo corresponds to a fully-developed flow face
*/
bool isFullyDevelopedFlowFace(const FaceInfo & fi) const;
private:
/// Whether to pre-initialize variable data for use in traditional MOOSE quadrature point based
/// objects. This can be changed to true if objects request variable values in a way that is
/// generated by quadrature point based calculations
mutable bool _qp_calculations;
};
inline void
INSFVVariable::computeFaceValues(const FaceInfo & fi)
{
if (_qp_calculations)
MooseVariableFVReal::computeFaceValues(fi);
}
inline void
INSFVVariable::computeElemValues()
{
if (_qp_calculations)
MooseVariableFVReal::computeElemValues();
else
_element_data->setGeometry(Moose::Volume);
}
inline void
INSFVVariable::computeElemValuesFace()
{
if (_qp_calculations)
MooseVariableFVReal::computeElemValuesFace();
}
inline void
INSFVVariable::computeNeighborValuesFace()
{
if (_qp_calculations)
MooseVariableFVReal::computeNeighborValuesFace();
}
inline void
INSFVVariable::computeNeighborValues()
{
if (_qp_calculations)
MooseVariableFVReal::computeNeighborValues();
}