- vThe coupled functor which provides the force. A functor is any of the following: a variable, a functor material property, a function, a post-processor, or a number.
C++ Type:MooseFunctorName
Controllable:No
Description:The coupled functor which provides the force. A functor is any of the following: a variable, a functor material property, a function, a post-processor, or a number.
- variableThe name of the variable that this residual object operates on
C++ Type:NonlinearVariableName
Controllable:No
Description:The name of the variable that this residual object operates on
FVCoupledForce
Description
FVCoupledForce
implements a source term within the domain proportional to a coupled variable: where is a known scalar coefficient, is a coupled unknown value, and the second term on the left hand side corresponds to the strong forms of other kernels. In a species transport context, the value can be regarded as a reaction rate coefficient.
Example Syntax
[FVKernels]
[diff]
type = FVDiffusion
variable = v
coeff = coeff
[]
[rxn]
type = FVReaction
variable = v
rate = 2.0
[]
[diffw]
type = FVDiffusion
variable = w
coeff = coeff
[]
[prod]
type = FVCoupledForce
variable = w
v = 'v'
[]
[]
(test/tests/fvkernels/fv_coupled_var/coupled.i)Input Parameters
- 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
- coef1Coefficent multiplier for the coupled force term.
Default:1
C++ Type:double
Controllable:No
Description:Coefficent multiplier for the coupled force term.
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Optional Parameters
- absolute_value_vector_tagsThe tags for the vectors this residual object should fill with the absolute value of the residual contribution
C++ Type:std::vector<TagName>
Controllable:No
Description:The tags for the vectors this residual object should fill with the absolute value of the residual contribution
- extra_matrix_tagsThe extra tags for the matrices this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the matrices this Kernel should fill
- extra_vector_tagsThe extra tags for the vectors this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the vectors this Kernel should fill
- matrix_tagssystemThe tag for the matrices this Kernel should fill
Default:system
C++ Type:MultiMooseEnum
Options:nontime, system
Controllable:No
Description:The tag for the matrices this Kernel should fill
- vector_tagsnontimeThe tag for the vectors this Kernel should fill
Default:nontime
C++ Type:MultiMooseEnum
Options:nontime, time
Controllable:No
Description:The tag for the vectors this Kernel should fill
Tagging 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.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- implicitTrueDetermines whether this object is calculated using an implicit or explicit form
Default:True
C++ Type:bool
Controllable:No
Description:Determines whether this object is calculated using an implicit or explicit form
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
- ghost_layers1The number of layers of elements to ghost.
Default:1
C++ Type:unsigned short
Controllable:No
Description:The number of layers of elements to ghost.
- use_point_neighborsFalseWhether to use point neighbors, which introduces additional ghosting to that used for simple face neighbors.
Default:False
C++ Type:bool
Controllable:No
Description:Whether to use point neighbors, which introduces additional ghosting to that used for simple face neighbors.
Parallel Ghosting Parameters
Input Files
- (test/tests/fvkernels/block-restriction/fv-and-fe-block-restriction.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_mdot.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_velocity.i)
- (modules/navier_stokes/test/tests/finite_volume/controls/switch-pressure-bc/switch_vel_pres_bc.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_reversal.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/segregated/3d/3d-segregated-scalar.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/materials/2d-transient.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/with-direction/errors/flux_bcs.i)
- (test/tests/misc/multiple-nl-systems/test-fv.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_direct.i)
- (test/tests/outputs/debug/show_functors.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/segregated/2d/2d-segregated-scalar.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/dirichlet_bcs_velocity.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/channel-flow/2d-transient.i)
- (test/tests/fvkernels/fv_coupled_var/coupled.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/dirichlet_bcs_mdot.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/2d-scalar-transport.i)
- (test/tests/fvkernels/fv-to-fe-coupling/1d.i)
(test/tests/fvkernels/fv_coupled_var/coupled.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 2
[]
[Variables]
[u][]
[v]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[w]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[s][]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[rxn]
type = Reaction
variable = u
rate = 2.0
[]
[diffs]
type = Diffusion
variable = s
[]
[prod]
type = CoupledForce
variable = s
v = u
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = v
coeff = coeff
[]
[rxn]
type = FVReaction
variable = v
rate = 2.0
[]
[diffw]
type = FVDiffusion
variable = w
coeff = coeff
[]
[prod]
type = FVCoupledForce
variable = w
v = 'v'
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = v
boundary = left
value = 0
[]
[right]
type = FVDirichletBC
variable = v
boundary = right
value = 1
[]
[leftw]
type = FVDirichletBC
variable = w
boundary = left
value = 0
[]
[rightw]
type = FVDirichletBC
variable = w
boundary = right
value = 1
[]
[]
[Materials]
[diff]
type = ADGenericFunctorMaterial
prop_names = 'coeff'
prop_values = '1'
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[lefts]
type = DirichletBC
variable = s
boundary = left
value = 0
[]
[rights]
type = DirichletBC
variable = s
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
exodus = true
[]
(test/tests/fvkernels/block-restriction/fv-and-fe-block-restriction.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 80
xmax = 4
[]
[subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '2.0 0 0'
block_id = 1
top_right = '4.0 1.0 0'
[]
[left_right]
input = subdomain1
type = SideSetsBetweenSubdomainsGenerator
primary_block = '0'
paired_block = '1'
new_boundary = 'left_right'
[]
[right_left]
input = left_right
type = SideSetsBetweenSubdomainsGenerator
primary_block = '1'
paired_block = '0'
new_boundary = 'right_left'
[]
[]
[Variables]
[left_fv]
family = MONOMIAL
order = CONSTANT
fv = true
initial_condition = 1
block = 0
[]
[left_fe]
initial_condition = 1
block = 0
[]
[right_fv]
family = MONOMIAL
order = CONSTANT
fv = true
initial_condition = 1
block = 1
[]
[right_fe]
initial_condition = 1
block = 1
[]
[]
[FVKernels]
active = 'bad_left_diff left_coupled bad_right_diff right_coupled'
[bad_left_diff]
type = FVDiffusion
variable = left_fv
coeff = fv_prop
block = 0
coeff_interp_method = average
[]
[good_left_diff]
type = FVDiffusion
variable = left_fv
coeff = left_fv_prop
block = 0
coeff_interp_method = average
[]
[left_coupled]
type = FVCoupledForce
v = left_fv
variable = left_fv
block = 0
[]
[bad_right_diff]
type = FVDiffusion
variable = right_fv
coeff = fv_prop
block = 1
coeff_interp_method = average
[]
[good_right_diff]
type = FVDiffusion
variable = right_fv
coeff = right_fv_prop
block = 1
coeff_interp_method = average
[]
[right_coupled]
type = FVCoupledForce
v = right_fv
variable = right_fv
block = 1
[]
[]
[Kernels]
[left_diff]
type = ADFunctorMatDiffusion
variable = left_fe
diffusivity = fe_prop
[]
[left_coupled]
type = CoupledForce
v = left_fv
variable = left_fe
[]
[right_diff]
type = ADFunctorMatDiffusion
variable = right_fe
diffusivity = fe_prop
[]
[right_coupled]
type = CoupledForce
v = right_fv
variable = right_fe
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = left_fv
boundary = left
value = 0
[]
[left_right]
type = FVDirichletBC
variable = left_fv
boundary = left_right
value = 1
[]
[right_left]
type = FVDirichletBC
variable = right_fv
boundary = right_left
value = 0
[]
[right]
type = FVDirichletBC
variable = right_fv
boundary = right
value = 1
[]
[]
[BCs]
[left]
type = DirichletBC
variable = left_fe
boundary = left
value = 0
[]
[left_right]
type = DirichletBC
variable = left_fe
boundary = left_right
value = 1
[]
[right_left]
type = DirichletBC
variable = right_fe
boundary = right_left
value = 0
[]
[right]
type = DirichletBC
variable = right_fe
boundary = right
value = 1
[]
[]
[Materials]
active = 'fe_mat_left bad_fv_mat_left fe_mat_right bad_fv_mat_right'
[fe_mat_left]
type = FEFVCouplingMaterial
fe_var = left_fe
block = 0
[]
[bad_fv_mat_left]
type = FEFVCouplingMaterial
fv_var = left_fv
block = 0
[]
[good_fv_mat_left]
type = FEFVCouplingMaterial
fv_var = left_fv
fv_prop_name = 'left_fv_prop'
block = 0
[]
[fe_mat_right]
type = FEFVCouplingMaterial
fe_var = right_fe
block = 1
[]
[bad_fv_mat_right]
type = FEFVCouplingMaterial
fv_var = right_fv
block = 1
[]
[good_fv_mat_right]
type = FEFVCouplingMaterial
fv_var = right_fv
fv_prop_name = 'right_fv_prop'
block = 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
[]
(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/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/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'
[]
(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/ins/channel-flow/segregated/3d/3d-segregated-scalar.i)
mu = 0.002
rho = 1.0
diff = 1.5
advected_interp_method = 'average'
velocity_interp_method = 'rc'
pressure_tag = "pressure_grad"
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 3
dx = '0.2'
dy = '0.2'
dz = '0.8'
ix = '3'
iy = '3'
iz = '6'
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[Problem]
nl_sys_names = 'u_system v_system w_system pressure_system scalar_1_system scalar_2_system'
previous_nl_solution_required = true
error_on_jacobian_nonzero_reallocation = true
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolatorSegregated
u = vel_x
v = vel_y
w = vel_z
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
[]
[vel_z]
type = INSFVVelocityVariable
initial_condition = 0.5
solver_sys = w_system
two_term_boundary_expansion = false
[]
[pressure]
type = INSFVPressureVariable
solver_sys = pressure_system
initial_condition = 0.2
two_term_boundary_expansion = false
[]
[scalar_1]
type = INSFVScalarFieldVariable
solver_sys = scalar_1_system
initial_condition = 1.2
[]
[scalar_2]
type = INSFVScalarFieldVariable
solver_sys = scalar_2_system
initial_condition = 1.2
[]
[]
[FVKernels]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_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
extra_vector_tags = ${pressure_tag}
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_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
extra_vector_tags = ${pressure_tag}
[]
[w_advection]
type = INSFVMomentumAdvection
variable = vel_z
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[w_viscosity]
type = INSFVMomentumDiffusion
variable = vel_z
mu = ${mu}
momentum_component = 'z'
[]
[w_pressure]
type = INSFVMomentumPressure
variable = vel_z
momentum_component = 'z'
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
[]
[scalar_1_advection]
type = INSFVScalarFieldAdvection
variable = scalar_1
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_1_diffusion]
type = FVDiffusion
coeff = ${diff}
variable = scalar_1
[]
[scalar_1_src]
type = FVBodyForce
variable = scalar_1
value = 1.0
[]
[scalar_1_coupled_source]
type = FVCoupledForce
variable = scalar_1
v = scalar_2
coef = 0.1
[]
[scalar_2_advection]
type = INSFVScalarFieldAdvection
variable = scalar_2
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_2_diffusion]
type = FVDiffusion
coeff = '${fparse 2*diff}'
variable = scalar_2
[]
[scalar_2_src]
type = FVBodyForce
variable = scalar_2
value = 5.0
[]
[scalar_2_coupled_source]
type = FVCoupledForce
variable = scalar_2
v = scalar_1
coef = 0.05
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'back'
variable = vel_x
function = '0'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'back'
variable = vel_y
function = '0'
[]
[inlet-w]
type = INSFVInletVelocityBC
boundary = 'back'
variable = vel_z
function = '1.1'
[]
[walls-u]
type = INSFVNoSlipWallBC
boundary = 'left right top bottom '
variable = vel_x
function = 0.0
[]
[walls-v]
type = INSFVNoSlipWallBC
boundary = 'left right top bottom'
variable = vel_y
function = 0.0
[]
[walls-w]
type = INSFVNoSlipWallBC
boundary = 'left right top bottom'
variable = vel_z
function = 0.0
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'front'
variable = pressure
function = 1.4
[]
[zero-grad-pressure]
type = FVFunctionNeumannBC
variable = pressure
boundary = 'back left right top bottom'
function = 0.0
[]
[inlet_scalar_1]
type = FVDirichletBC
boundary = 'back'
variable = scalar_1
value = 1
[]
[inlet_scalar_2]
type = FVDirichletBC
boundary = 'back'
variable = scalar_2
value = 2
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
passive_scalar_l_abs_tol = 1e-14
momentum_l_tol = 0
pressure_l_tol = 0
passive_scalar_l_tol = 0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system w_system'
pressure_system = 'pressure_system'
passive_scalar_systems = 'scalar_1_system scalar_2_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.3
passive_scalar_equation_relaxation = '0.98 0.98'
num_iterations = 150
pressure_absolute_tolerance = 1e-13
momentum_absolute_tolerance = 1e-13
passive_scalar_absolute_tolerance = '1e-13 1e-13'
print_fields = false
[]
[Outputs]
exodus = true
csv = false
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
(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
[]
(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/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'
[]
[]
(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
[]
(test/tests/outputs/debug/show_functors.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 40
xmax = 2
[]
[]
[Debug]
show_functors = true
[]
[Variables]
[fv]
family = MONOMIAL
order = CONSTANT
fv = true
initial_condition = 1
[]
[fe]
initial_condition = 1
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = fv
coeff = fv_prop
coeff_interp_method = average
[]
[coupled]
type = FVCoupledForce
v = fv
variable = fv
[]
[]
[Kernels]
[diff]
type = ADFunctorMatDiffusion
variable = fe
diffusivity = fe_prop
[]
[coupled]
type = CoupledForce
v = fv
variable = fe
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = fv
boundary = left
value = 0
[]
[right]
type = FVDirichletBC
variable = fv
boundary = right
value = 1
[]
[]
[BCs]
[left]
type = DirichletBC
variable = fe
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = fe
boundary = right
value = 1
[]
[]
[Materials]
active = 'fe_mat fv_mat'
[bad_mat]
type = FEFVCouplingMaterial
fe_var = fe
fv_var = fv
execute_on = 'linear nonlinear'
[]
[fe_mat]
type = FEFVCouplingMaterial
fe_var = fe
execute_on = 'linear nonlinear'
[]
[fv_mat]
type = FEFVCouplingMaterial
fv_var = fv
[]
[fe_mat_bad_dep]
type = FEFVCouplingMaterial
fe_var = fe
declared_prop_name = bad
[]
[fv_mat_bad_dep]
type = FEFVCouplingMaterial
fv_var = fv
retrieved_prop_name = bad
[]
[]
[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
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/segregated/2d/2d-segregated-scalar.i)
mu = 2.6
rho = 1.0
diff = 1.5
advected_interp_method = 'average'
velocity_interp_method = 'rc'
pressure_tag = "pressure_grad"
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '0.3'
dy = '0.3'
ix = '3'
iy = '3'
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system scalar_1_system scalar_2_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.5
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
[]
[scalar_1]
type = INSFVScalarFieldVariable
solver_sys = scalar_1_system
initial_condition = 1.2
[]
[scalar_2]
type = INSFVScalarFieldVariable
solver_sys = scalar_2_system
initial_condition = 1.2
[]
[]
[FVKernels]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_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
extra_vector_tags = ${pressure_tag}
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_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
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
[]
[scalar_1_advection]
type = INSFVScalarFieldAdvection
variable = scalar_1
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_1_diffusion]
type = FVDiffusion
coeff = ${diff}
variable = scalar_1
[]
[scalar_1_src]
type = FVBodyForce
variable = scalar_1
value = 1.0
[]
[scalar_1_coupled_source]
type = FVCoupledForce
variable = scalar_1
v = scalar_2
coef = 0.1
[]
[scalar_2_advection]
type = INSFVScalarFieldAdvection
variable = scalar_2
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_2_diffusion]
type = FVDiffusion
coeff = '${fparse 2*diff}'
variable = scalar_2
[]
[scalar_2_src]
type = FVBodyForce
variable = scalar_2
value = 5.0
[]
[scalar_2_coupled_source]
type = FVCoupledForce
variable = scalar_2
v = scalar_1
coef = 0.05
[]
[]
[FVBCs]
inactive = "symmetry-u symmetry-v symmetry-p"
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_x
function = '1.1'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_y
function = '0.0'
[]
[walls-u]
type = INSFVNoSlipWallBC
boundary = 'top bottom'
variable = vel_x
function = 0.0
[]
[walls-v]
type = INSFVNoSlipWallBC
boundary = 'top bottom'
variable = vel_y
function = 0.0
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = 1.4
[]
[inlet_scalar_1]
type = FVDirichletBC
boundary = 'left'
variable = scalar_1
value = 1
[]
[inlet_scalar_2]
type = FVDirichletBC
boundary = 'left'
variable = scalar_2
value = 2
[]
### Inactive by default, some tests will turn these on ###
[symmetry-u]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = vel_x
u = vel_x
v = vel_y
mu = ${mu}
momentum_component = 'x'
[]
[symmetry-v]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = vel_y
u = vel_x
v = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[symmetry-p]
type = INSFVSymmetryPressureBC
boundary = 'bottom'
variable = pressure
[]
##########################################################
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
passive_scalar_l_abs_tol = 1e-14
momentum_l_tol = 0
pressure_l_tol = 0
passive_scalar_l_tol = 0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
passive_scalar_systems = 'scalar_1_system scalar_2_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.3
passive_scalar_equation_relaxation = '0.9 0.9'
num_iterations = 100
pressure_absolute_tolerance = 1e-13
momentum_absolute_tolerance = 1e-13
passive_scalar_absolute_tolerance = '1e-13 1e-13'
print_fields = false
[]
[Outputs]
exodus = true
[csv]
type = CSV
execute_on = FINAL
[]
[]
[Postprocessors]
inactive = "out1 out2 in1 in2"
[out1]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
advected_quantity = 'scalar_1'
boundary = right
execute_on = FINAL
outputs = csv
[]
[in1]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
advected_quantity = 'scalar_1'
boundary = left
execute_on = FINAL
outputs = csv
[]
[out2]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
advected_quantity = 'scalar_2'
boundary = right
execute_on = FINAL
outputs = csv
[]
[in2]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
advected_quantity = 'scalar_2'
boundary = left
execute_on = FINAL
outputs = csv
[]
[]
(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/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
[]
(test/tests/fvkernels/fv_coupled_var/coupled.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 2
[]
[Variables]
[u][]
[v]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[w]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[s][]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[rxn]
type = Reaction
variable = u
rate = 2.0
[]
[diffs]
type = Diffusion
variable = s
[]
[prod]
type = CoupledForce
variable = s
v = u
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = v
coeff = coeff
[]
[rxn]
type = FVReaction
variable = v
rate = 2.0
[]
[diffw]
type = FVDiffusion
variable = w
coeff = coeff
[]
[prod]
type = FVCoupledForce
variable = w
v = 'v'
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = v
boundary = left
value = 0
[]
[right]
type = FVDirichletBC
variable = v
boundary = right
value = 1
[]
[leftw]
type = FVDirichletBC
variable = w
boundary = left
value = 0
[]
[rightw]
type = FVDirichletBC
variable = w
boundary = right
value = 1
[]
[]
[Materials]
[diff]
type = ADGenericFunctorMaterial
prop_names = 'coeff'
prop_values = '1'
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[lefts]
type = DirichletBC
variable = s
boundary = left
value = 0
[]
[rights]
type = DirichletBC
variable = s
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
exodus = true
[]
(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/navier_stokes/test/tests/finite_volume/ins/channel-flow/2d-scalar-transport.i)
mu = 1
rho = 1
k = 1e-3
diff = 1e-3
cp = 1
advected_interp_method = 'average'
velocity_interp_method = 'rc'
[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 = 10
ymin = -1
ymax = 1
nx = 100
ny = 20
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = vel_x
y = vel_y
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 1
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1
[]
[pressure]
type = INSFVPressureVariable
[]
[T_fluid]
type = INSFVEnergyVariable
[]
[scalar]
type = INSFVScalarFieldVariable
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_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_advection]
type = INSFVMomentumAdvection
variable = vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_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_advection]
type = INSFVEnergyAdvection
variable = T_fluid
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[energy_diffusion]
type = FVDiffusion
coeff = ${k}
variable = T_fluid
[]
[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
[]
[scalar_coupled_source]
type = FVCoupledForce
variable = scalar
v = U
coef = 0.1
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_x
function = '1'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_y
function = 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_t]
type = FVDirichletBC
boundary = 'left'
variable = T_fluid
value = 1
[]
[inlet_scalar]
type = FVDirichletBC
boundary = 'left'
variable = scalar
value = 1
[]
[]
[FunctorMaterials]
[const]
type = ADGenericFunctorMaterial
prop_names = 'cp'
prop_values = '${cp}'
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
rho = ${rho}
temperature = 'T_fluid'
[]
[]
[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
[]
(test/tests/fvkernels/fv-to-fe-coupling/1d.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 40
xmax = 2
[]
[]
[Variables]
[fv]
family = MONOMIAL
order = CONSTANT
fv = true
initial_condition = 1
[]
[fe]
initial_condition = 1
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = fv
coeff = fv_prop
coeff_interp_method = average
[]
[coupled]
type = FVCoupledForce
v = fv
variable = fv
[]
[]
[Kernels]
[diff]
type = ADFunctorMatDiffusion
variable = fe
diffusivity = fe_prop
[]
[coupled]
type = CoupledForce
v = fv
variable = fe
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = fv
boundary = left
value = 0
[]
[right]
type = FVDirichletBC
variable = fv
boundary = right
value = 1
[]
[]
[BCs]
[left]
type = DirichletBC
variable = fe
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = fe
boundary = right
value = 1
[]
[]
[Materials]
active = 'fe_mat fv_mat'
[bad_mat]
type = FEFVCouplingMaterial
fe_var = fe
fv_var = fv
execute_on = 'linear nonlinear'
[]
[fe_mat]
type = FEFVCouplingMaterial
fe_var = fe
execute_on = 'linear nonlinear'
[]
[fv_mat]
type = FEFVCouplingMaterial
fv_var = fv
[]
[fe_mat_bad_dep]
type = FEFVCouplingMaterial
fe_var = fe
declared_prop_name = bad
[]
[fv_mat_bad_dep]
type = FEFVCouplingMaterial
fv_var = fv
retrieved_prop_name = bad
[]
[]
[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
[]