- T_c0Critical temperature, K
Default:0
C++ Type:double
Controllable:No
Description:Critical temperature, K
- allow_imperfect_jacobiansFalsetrue to allow unimplemented property derivative terms to be set to zero for the AD API
Default:False
C++ Type:bool
Controllable:No
Description:true to allow unimplemented property derivative terms to be set to zero for the AD API
- e_c0Internal energy at the critical point, J/kg
Default:0
C++ Type:double
Controllable:No
Description:Internal energy at the critical point, J/kg
- emit_on_nannoneRaise mooseWarning or mooseError?
Default:none
C++ Type:MooseEnum
Controllable:No
Description:Raise mooseWarning or mooseError?
- execute_onTIMESTEP_ENDThe list of flag(s) indicating when this object should be executed, the available options include NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM, ALWAYS.
Default:TIMESTEP_END
C++ Type:ExecFlagEnum
Controllable:No
Description:The list of flag(s) indicating when this object should be executed, the available options include NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM, ALWAYS.
- fp_typesingle-phase-fpType of the fluid property object
Default:single-phase-fp
C++ Type:FPType
Controllable:No
Description:Type of the fluid property object
- gamma1.4gamma value (cp/cv)
Default:1.4
C++ Type:double
Controllable:No
Description:gamma value (cp/cv)
- k0.02568Thermal conductivity, W/(m-K)
Default:0.02568
C++ Type:double
Controllable:No
Description:Thermal conductivity, W/(m-K)
- molar_mass0.029Constant molar mass of the fluid (kg/mol)
Default:0.029
C++ Type:double
Controllable:No
Description:Constant molar mass of the fluid (kg/mol)
- mu1.823e-05Dynamic viscosity, Pa.s
Default:1.823e-05
C++ Type:double
Controllable:No
Description:Dynamic viscosity, Pa.s
- 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.
- rho_c0Critical density, kg/m3
Default:0
C++ Type:double
Controllable:No
Description:Critical density, kg/m3
IdealGasFluidProperties
Fluid properties for an ideal gas
A simple formulation that is suitable for ideal gases, where properties are derived from the ideal gas law
Temperature is calculated using the internal energy of an ideal gas
Input Parameters
- allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
Default:False
C++ Type:bool
Controllable:No
Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
- 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.
- force_postauxFalseForces the UserObject to be executed in POSTAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in POSTAUX
- force_preauxFalseForces the UserObject to be executed in PREAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREAUX
- force_preicFalseForces the UserObject to be executed in PREIC during initial setup
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREIC during initial setup
- 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
Input Files
- (modules/fluid_properties/test/tests/functions/saturation_temperature_function/saturation_temperature_function.i)
- (modules/thermal_hydraulics/test/tests/problems/sedov_blast_wave/sedov_blast_wave.i)
- (modules/fluid_properties/test/tests/fp_interrogator/2ph.T.i)
- (modules/fluid_properties/test/tests/fp_interrogator/1ph.rho_e.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/free-flow-hllc.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_specified_temperature_1phase/err.no_phf.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/implicit-euler-basic-kt-primitive.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/userobject/HLLC/hllc_uo_1D.i)
- (modules/thermal_hydraulics/tutorials/single_phase_flow/02_core.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_external_app_1phase/phy.q_wall_transfer_3eqn.slave.i)
- (modules/thermal_hydraulics/test/tests/components/junction_parallel_channels_1phase/phy.shower.i)
- (modules/thermal_hydraulics/tutorials/single_phase_flow/05_secondary_side.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_1phase/phy.heat_structure_multiple_3eqn.i)
- (modules/thermal_hydraulics/test/tests/problems/woodward_colella_blast_wave/woodward_colella_blast_wave.i)
- (modules/fluid_properties/test/tests/ideal_gas/test.i)
- (modules/thermal_hydraulics/test/tests/problems/double_rarefaction/1phase.i)
- (modules/thermal_hydraulics/test/tests/components/deprecated/gate_valve.i)
- (modules/thermal_hydraulics/test/tests/components/shaft_connected_pump_1phase/shaft_motor_pump.i)
- (modules/thermal_hydraulics/test/tests/output/vector_velocity/test.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/boussinesq/wcnsfv.i)
- (modules/fluid_properties/test/tests/ideal_gas/test2.i)
- (modules/thermal_hydraulics/test/tests/problems/area_constriction/area_constriction.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/rotated-2d-bkt-function-porosity.i)
- (modules/thermal_hydraulics/test/tests/problems/brayton_cycle/open_brayton_cycle.i)
- (modules/thermal_hydraulics/test/tests/components/component/err.nonexisting_component.i)
- (modules/thermal_hydraulics/test/tests/components/inlet_stagnation_enthalpy_1phase/phy.h_rhou_3eqn.i)
- (modules/thermal_hydraulics/test/tests/components/deprecated/solid_wall.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/varying-eps-basic-kt-primitive.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_1phase/jac.1phase.i)
- (modules/fluid_properties/test/tests/two_phase_fluid_properties_independent/test.i)
- (modules/thermal_hydraulics/test/tests/components/junction_one_to_one_1phase/constriction_1phase.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/porous-hllc.i)
- (modules/thermal_hydraulics/test/tests/postprocessors/heat_rate_convection_1phase/heat_rate_convection_1phase.i)
- (modules/thermal_hydraulics/test/tests/problems/square_wave/square_wave.i)
- (modules/thermal_hydraulics/test/tests/output/paraview_component_annotation_map/test.i)
- (modules/thermal_hydraulics/test/tests/problems/brayton_cycle/closed_brayton_cycle.i)
- (modules/thermal_hydraulics/tutorials/single_phase_flow/04_loop.i)
- (modules/fluid_properties/test/tests/ics/rho_vapor_mixture_from_pressure_temperature/test.i)
- (modules/thermal_hydraulics/test/tests/components/deprecated/junction_one_to_one.i)
- (modules/porous_flow/test/tests/fluids/ideal_gas.i)
- (modules/thermal_hydraulics/tutorials/single_phase_flow/06_custom_closures.i)
- (modules/thermal_hydraulics/test/tests/components/junction_one_to_one_1phase/junction_one_to_one_1phase.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/heated-channel/transient-porous-kt-primitive.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/implicit_bcs/hllc_sod_shocktube.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/userobject/HLLC/hllc_uo_2D_tri.i)
- (modules/navier_stokes/test/tests/ics/pns_test.i)
- (modules/porous_flow/test/tests/jacobian/esbc02.i)
- (modules/fluid_properties/test/tests/functions/saturation_pressure_function/saturation_pressure_function.i)
- (modules/fluid_properties/test/tests/fp_interrogator/1ph.p_T.i)
- (modules/fluid_properties/test/tests/fp_interrogator/vapor_mixture_rho_e.i)
- (modules/fluid_properties/fp_interrogator/fp_interrogator.i)
- (modules/thermal_hydraulics/test/tests/problems/super_sonic_tube/test.i)
- (modules/thermal_hydraulics/test/tests/postprocessors/specific_impulse_1phase/Isp_1ph.i)
- (modules/thermal_hydraulics/test/tests/components/shaft_connected_compressor_1phase/shaft_motor_compressor.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/basic-primitive-pcnsfv-kt.i)
- (modules/thermal_hydraulics/test/tests/jacobians/scalarkernels/volume_junction_advection_scalar_kernel/1phase.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/dc.i)
- (modules/porous_flow/test/tests/jacobian/esbc01.i)
- (modules/thermal_hydraulics/test/tests/components/flow_connection/err.connection_format.i)
- (modules/navier_stokes/test/tests/finite_element/cns/step/step.i)
- (modules/fluid_properties/test/tests/fp_interrogator/err.no_params.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/symmetry_test/2D_symmetry.i)
- (modules/thermal_hydraulics/test/tests/components/deprecated/free_boundary.i)
- (modules/thermal_hydraulics/test/tests/problems/sod_shock_tube/sod_shock_tube.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/hllc.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/boussinesq/transient-wcnsfv.i)
- (modules/thermal_hydraulics/test/tests/postprocessors/flow_junction_flux_1phase/flow_junction_flux_1phase.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/pressure_outlet/subsonic_nozzle_fixed_inflow_hllc.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/varying-eps-basic-kt-mixed.i)
- (modules/fluid_properties/test/tests/fp_interrogator/1ph.rho_p.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/regular-straight-channel.i)
- (modules/fluid_properties/test/tests/fp_interrogator/2ph_ncg_p_T.i)
- (modules/thermal_hydraulics/test/tests/components/shaft_connected_turbine_1phase/turbine_startup.i)
- (modules/fluid_properties/test/tests/fp_interrogator/2ph.p_T.i)
- (modules/navier_stokes/test/tests/ics/test.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_1phase/err.1phase.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/shock_tube_2D_cavity/hllc_sod_shocktube_2D.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/scalar_advection/mass-frac-advection.i)
- (modules/thermal_hydraulics/test/tests/components/junction_one_to_one_1phase/no_junction_1phase.i)
- (modules/porous_flow/test/tests/newton_cooling/nc08.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/varying-eps-hllc.i)
- (modules/thermal_hydraulics/test/tests/components/gate_valve_1phase/gate_valve_1phase.i)
- (modules/thermal_hydraulics/test/tests/problems/mms/mms_1phase.i)
- (modules/thermal_hydraulics/test/tests/problems/lax_shock_tube/lax_shock_tube.i)
- (modules/thermal_hydraulics/test/tests/components/simple_turbine_1phase/phy.conservation.i)
- (modules/thermal_hydraulics/test/tests/components/supersonic_inlet/err.i)
- (modules/thermal_hydraulics/tutorials/single_phase_flow/01_flow_channel.i)
- (modules/thermal_hydraulics/test/tests/components/shaft_connected_turbine_1phase/shaft_motor_turbine.i)
- (modules/thermal_hydraulics/test/tests/problems/area_constriction/area_constriction_junction.i)
- (modules/thermal_hydraulics/test/tests/components/simple_turbine_1phase/phy.test.i)
- (modules/thermal_hydraulics/test/tests/components/shaft_connected_pump_1phase/pump_coastdown.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/straight-channel-hllc.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/stagnation_inlet/supersonic_nozzle_hllc.i)
- (modules/fluid_properties/test/tests/fp_interrogator/2ph.p.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/benchmark_shock_tube_1D/hllc_sod_shocktube.i)
- (modules/fluid_properties/test/tests/fp_interrogator/1ph.rho_rhou_rhoE.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/basic-conserved-pcnsfv-kt.i)
- (modules/navier_stokes/test/tests/ics/test_function.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/pwcnsfv.i)
- (modules/thermal_hydraulics/tutorials/single_phase_flow/03_upper_loop.i)
- (modules/navier_stokes/test/tests/finite_element/cns/bump/bump.i)
- (modules/thermal_hydraulics/test/tests/misc/coupling_mD_flow/thm_non_overlapping.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/rotated-2d-bkt-function-porosity-mixed.i)
Child Objects
(modules/fluid_properties/test/tests/functions/saturation_temperature_function/saturation_temperature_function.i)
# TestTwoPhaseFluidProperties has the following saturation temperature function:
# T_sat(p) = 2 p
# Thus for p = 5, T_sat should be 10.
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[Modules]
[./FluidProperties]
[./fp_liquid]
type = IdealGasFluidProperties
[../]
[./fp_vapor]
type = IdealGasFluidProperties
[../]
[./fp_2phase]
type = TestTwoPhaseFluidProperties
fp_liquid = fp_liquid
fp_vapor = fp_vapor
[../]
[]
[]
[Functions]
[./p]
type = ConstantFunction
value = 5
[../]
[./T_sat]
type = SaturationTemperatureFunction
p = p
fp_2phase = fp_2phase
[../]
[]
[Postprocessors]
[./T_sat_pp]
type = FunctionValuePostprocessor
function = T_sat
execute_on = 'INITIAL'
[../]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/problems/sedov_blast_wave/sedov_blast_wave.i)
# This test problem is the Sedov blast wave test problem,
# which is a Riemann problem with the following parameters:
# * domain = (0,1)
# * gravity = 0
# * EoS: Ideal gas EoS with gamma = 1.4, R = 0.71428571428571428571
# * interface: x = 0.5
# * typical end time: 0.15
# Left initial values:
# * rho = 0.445
# * vel = 0.692
# * p = 3.52874226
# Right initial values:
# * rho = 0.5
# * vel = 0
# * p = 0.571
[GlobalParams]
gravity_vector = '0 0 0'
closures = simple_closures
[]
[Functions]
[p_ic_fn]
type = PiecewiseConstant
axis = x
direction = right
x = '0.0025 1'
y = '1.591549333333333e+06 6.666666666666668e-09'
[]
[T_ic_fn]
type = PiecewiseConstant
axis = x
direction = right
x = '0.0025 1'
y = '2.228169066666667e+06 9.333333333333334e-09'
[]
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.66666666666666666667
molar_mass = 11.64024372
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp
# geometry
position = '0 0 0'
orientation = '1 0 0'
length = 1.0
n_elems = 400
A = 1.0
# IC
initial_T = T_ic_fn
initial_p = p_ic_fn
initial_vel = 0
f = 0
[]
[left_boundary]
type = SolidWall1Phase
input = 'pipe:in'
[]
[right_boundary]
type = FreeBoundary1Phase
input = 'pipe:out'
[]
[]
[Executioner]
type = Transient
[TimeIntegrator]
type = ExplicitSSPRungeKutta
order = 2
[]
solve_type = LINEAR
l_tol = 1e-4
nl_rel_tol = 1e-20
nl_abs_tol = 1e-8
nl_max_its = 60
# run to t = 0.005
start_time = 0.0
dt = 1e-6
num_steps = 5000
abort_on_solve_fail = true
[]
[Outputs]
file_base = 'sedov_blast_wave'
velocity_as_vector = false
execute_on = 'initial timestep_end'
[out]
type = Exodus
show = 'p T vel'
[]
[]
(modules/fluid_properties/test/tests/fp_interrogator/2ph.T.i)
[FluidPropertiesInterrogator]
fp = fp
T = 300
[]
[Modules]
[./FluidProperties]
[./fp_liquid]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.02900055737704918
mu = 1.823e-05
k = 0.02568
[../]
[./fp_vapor]
type = IdealGasFluidProperties
gamma = 1.1
molar_mass = 0.027714866
mu = 1.7e-05
k = 0.05
[../]
[./fp]
type = TestTwoPhaseFluidProperties
fp_liquid = fp_liquid
fp_vapor = fp_vapor
[../]
[../]
[]
(modules/fluid_properties/test/tests/fp_interrogator/1ph.rho_e.i)
[FluidPropertiesInterrogator]
fp = fp
rho = 1
e = 2.1502500000e+05
[]
[Modules]
[./FluidProperties]
[./fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.02900055737704918
mu = 1.823e-05
k = 0.02568
[../]
[../]
[]
(modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/free-flow-hllc.i)
[GlobalParams]
fp = fp
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = .1
xmax = 1.1
nx = 2
[]
[]
[Modules]
[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'
[]
[]
[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'
[]
[]
[Materials]
[var_mat]
type = ConservedVarValuesMaterial
rho = rho
rhou = rho_u
rho_et = rho_et
[]
[]
[Functions]
[exact_rho]
type = ParsedFunction
value = '3.48788261470924*cos(x)'
[]
[forcing_rho]
type = ParsedFunction
value = '-3.83667087618017*sin(1.1*x)'
[]
[exact_rho_u]
type = ParsedFunction
value = '3.48788261470924*cos(1.1*x)'
[]
[forcing_rho_u]
type = ParsedFunction
value = '-(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)'
[]
[exact_rho_et]
type = ParsedFunction
value = '26.7439413073546*cos(1.2*x)'
[]
[forcing_rho_et]
type = ParsedFunction
value = '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)'
[]
[exact_T]
type = ParsedFunction
value = '0.0106975765229418*cos(1.2*x)/cos(x) - 0.000697576522941848*cos(1.1*x)^2/cos(x)^2'
[]
[exact_p]
type = ParsedFunction
value = '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-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_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'
[]
[]
(modules/thermal_hydraulics/test/tests/components/heat_transfer_from_specified_temperature_1phase/err.no_phf.i)
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[HeatStructureMaterials]
[mat]
type = SolidMaterialProperties
k = 1
cp = 2
rho = 3
[]
[]
[Components]
[fch1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 1 0'
length = 1
n_elems = 2
A = 1
closures = simple_closures
fp = fp
f = 0.01
initial_p = 1e5
initial_T = 300
initial_vel = 0
[]
[hs]
type = HeatStructureCylindrical
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 2
names = 'blk'
widths = '0.1'
n_part_elems = '1'
materials = 'mat'
initial_T = 300
[]
[hx]
type = HeatTransferFromHeatStructure1Phase
hs = hs
hs_side = START
flow_channel = fch1
Hw = 0
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'fch1:in'
m_dot = 1
T = 300
[]
[outlet]
type = Outlet1Phase
input = 'fch1:out'
p = 1e5
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 0.1
num_steps = 1
[]
(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
[]
[]
[Modules]
[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
value_x = '${u_in}'
[]
[eps]
type = ParsedFunction
value = '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
[]
(modules/navier_stokes/test/tests/finite_volume/cns/userobject/HLLC/hllc_uo_1D.i)
rho_left = 1.162633159
E_left = 2.1502913276e+05
u_left = 100
rho_right = 1.116127833
E_right = 1.7919094397e+05
u_right = 90
[Mesh]
allow_renumbering = false
[./cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = 0
xmax = 1
nx = 2
[../]
[]
[Modules]
[./FluidProperties]
[./fp]
type = IdealGasFluidProperties
allow_imperfect_jacobians = true
[../]
[../]
[]
[Problem]
kernel_coverage_check = false
[]
[Variables]
[./rho]
order = CONSTANT
family = MONOMIAL
[../]
[./rho_u]
order = CONSTANT
family = MONOMIAL
[../]
[./rho_E]
order = CONSTANT
family = MONOMIAL
[../]
[]
[ICs]
[./rho_ic]
type = FunctionIC
variable = rho
function = 'if (x < 0.5, ${rho_left}, ${rho_right})'
[../]
[./rho_u_ic]
type = FunctionIC
variable = rho_u
function = 'if (x < 0.5, ${fparse rho_left * u_left}, ${fparse rho_right * u_right})'
[../]
[./rho_E_ic]
type = FunctionIC
variable = rho_E
function = 'if (x < 0.5, ${fparse E_left * rho_left}, ${fparse E_right * rho_right})'
[../]
[]
[Materials]
[./var_mat]
type = ConservedVarValuesMaterial
rho = rho
rhou = rho_u
rho_et = rho_E
fp = fp
[../]
[]
[UserObjects]
[./hllc]
type = HLLCUserObject
fp = fp
[../]
[]
[VectorPostprocessors]
[./wave_speeds]
type = WaveSpeedVPP
hllc_uo = hllc
elem_id = 0
side_id = 1
[../]
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/tutorials/single_phase_flow/02_core.i)
T_in = 300. # K
m_dot_in = 1e-4 # kg/s
press = 1e5 # Pa
# core parameters
core_length = 1. # m
core_n_elems = 10
core_dia = ${units 2. cm -> m}
core_pitch = ${units 8.7 cm -> m}
tot_power = 100 # W
[GlobalParams]
initial_p = ${press}
initial_vel = 0
initial_T = ${T_in}
rdg_slope_reconstruction = full
closures = simple_closures
fp = he
[]
[Modules/FluidProperties]
[he]
type = IdealGasFluidProperties
molar_mass = 4e-3
gamma = 1.67
k = 0.2556
mu = 3.22639e-5
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[HeatStructureMaterials]
[steel]
type = SolidMaterialProperties
rho = 8050
k = 45
cp = 466
[]
[]
[Components]
[total_power]
type = TotalPower
power = ${tot_power}
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'core_chan:in'
m_dot = ${m_dot_in}
T = ${T_in}
[]
[core_chan]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
A = ${fparse core_pitch * core_pitch - pi * core_dia * core_dia / 4.}
D_h = ${fparse (4 * core_pitch * core_pitch - pi * core_dia * core_dia) / (4 * core_pitch + pi * core_dia)}
f = 1.6
[]
[core_hs]
type = HeatStructureCylindrical
position = '0 0 0'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
names = 'block'
widths = '${fparse core_dia / 2.}'
materials = 'steel'
n_part_elems = 3
[]
[core_heating]
type = HeatSourceFromTotalPower
hs = core_hs
regions = block
power = total_power
[]
[core_ht]
type = HeatTransferFromHeatStructure1Phase
flow_channel = core_chan
hs = core_hs
hs_side = outer
P_hf = ${fparse pi * core_dia}
Hw = 1.36
[]
[outlet]
type = Outlet1Phase
input = 'core_chan:out'
p = ${press}
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 1000
dt = 10
line_search = basic
solve_type = NEWTON
nl_rel_tol = 1e-5
nl_abs_tol = 1e-5
nl_max_its = 5
[]
[Outputs]
exodus = true
[console]
type = Console
max_rows = 1
outlier_variable_norms = false
[]
print_linear_residuals = false
[]
(modules/thermal_hydraulics/test/tests/components/heat_transfer_from_external_app_1phase/phy.q_wall_transfer_3eqn.slave.i)
# This is a part of phy.q_wall_transfer_3eqn test. See the master file for details.
[GlobalParams]
initial_p = 1.e5
initial_vel = 0.
initial_T = 300.
closures = simple_closures
[]
[Modules/FluidProperties]
[eos]
type = IdealGasFluidProperties
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 10
A = 9.6858407346e-01
D_h = 6.1661977237e+00
f = 0.01
fp = eos
[]
[hxconn]
type = HeatTransferFromExternalAppHeatFlux1Phase
flow_channel = pipe1
Hw = 1e3
[]
[inlet]
type = SolidWall1Phase
input = 'pipe1:in'
[]
[outlet]
type = SolidWall1Phase
input = 'pipe1:out'
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
dt = 0.5
dtmin = 1e-7
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-6
nl_max_its = 20
l_tol = 1e-3
l_max_its = 300
start_time = 0.0
end_time = 5
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Outputs]
exodus = true
show = 'q_wall'
[]
(modules/thermal_hydraulics/test/tests/components/junction_parallel_channels_1phase/phy.shower.i)
# This problem models a "shower": water from two pipes, one hot and one cold,
# mixes together to produce a temperature between the two.
[GlobalParams]
gravity_vector = '0 0 0'
initial_T = 300
initial_p = 1e5
initial_vel = 1
initial_vel_x = 1
initial_vel_y = 0
initial_vel_z = 0
# global parameters for pipes
fp = eos
orientation = '1 0 0'
length = 1
n_elems = 20
f = 0
scaling_factor_1phase = '1 1 1e-6'
closures = simple_closures
[]
[Modules/FluidProperties]
[eos]
type = IdealGasFluidProperties
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[inlet_hot]
type = InletDensityVelocity1Phase
input = 'pipe_hot:in'
# rho @ (p = 1e5, T = 310 K)
rho = 1315.9279785683
vel = 1
[]
[inlet_cold]
type = InletDensityVelocity1Phase
input = 'pipe_cold:in'
# rho @ (p = 1e5, T = 280 K)
rho = 1456.9202619863
vel = 1
[]
[outlet]
type = Outlet1Phase
input = 'pipe_warm:out'
p = 1e5
[]
[pipe_hot]
type = FlowChannel1Phase
position = '0 1 0'
A = 1
[]
[pipe_cold]
type = FlowChannel1Phase
position = '0 0 0'
A = 1
[]
[pipe_warm]
type = FlowChannel1Phase
position = '1 0.5 0'
A = 2
initial_vel = 0.5
[]
[junction]
type = JunctionParallelChannels1Phase
connections = 'pipe_cold:out pipe_hot:out pipe_warm:in'
position = '1 0.5 0'
volume = 1e-8
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-5
nl_max_its = 10
l_tol = 1e-2
l_max_its = 10
start_time = 0
end_time = 5
dt = 0.05
abort_on_solve_fail = true
[]
[Postprocessors]
# These post-processors are used to test that the energy flux on
# the warm side of the junction is equal to the sum of the energy
# fluxes of the hot and cold inlets to the junction.
[energy_flux_hot]
type = EnergyFluxIntegral
boundary = pipe_hot:out
arhouA = rhouA
H = H
[]
[energy_flux_cold]
type = EnergyFluxIntegral
boundary = pipe_cold:out
arhouA = rhouA
H = H
[]
[energy_flux_warm]
type = EnergyFluxIntegral
boundary = pipe_warm:in
arhouA = rhouA
H = H
[]
[energy_flux_inlet_sum]
type = SumPostprocessor
values = 'energy_flux_hot energy_flux_cold'
[]
[test_rel_err]
type = RelativeDifferencePostprocessor
value1 = energy_flux_warm
value2 = energy_flux_inlet_sum
[]
[]
[Outputs]
[out]
type = CSV
show = test_rel_err
sync_only = true
sync_times = '3 4 5'
[]
[]
(modules/thermal_hydraulics/tutorials/single_phase_flow/05_secondary_side.i)
T_in = 300. # K
m_dot_in = 1e-4 # kg/s
press = 1e5 # Pa
# core parameters
core_length = 1. # m
core_n_elems = 10
core_dia = ${units 2. cm -> m}
core_pitch = ${units 8.7 cm -> m}
# pipe parameters
pipe_dia = ${units 10. cm -> m}
tot_power = 100 # W
# heat exchanger parameters
hx_dia_inner = ${units 10. cm -> m}
hx_wall_thickness = ${units 5. mm -> m}
hx_dia_outer = ${units 50. cm -> m}
hx_radius_wall = ${fparse hx_dia_inner / 2. + hx_wall_thickness}
hx_length = 1 # m
hx_n_elems = 10
m_dot_sec_in = 1 # kg/s
[GlobalParams]
initial_p = ${press}
initial_vel = 0
initial_T = ${T_in}
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
rdg_slope_reconstruction = full
closures = simple_closures
fp = he
f = 0.4
[]
[Functions]
[m_dot_sec_fn]
type = PiecewiseLinear
xy_data = '
0 0
100 ${m_dot_sec_in}'
[]
[]
[Modules/FluidProperties]
[he]
type = IdealGasFluidProperties
molar_mass = 4e-3
gamma = 1.67
k = 0.2556
mu = 3.22639e-5
[]
[water]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[HeatStructureMaterials]
[steel]
type = SolidMaterialProperties
rho = 8050
k = 45
cp = 466
[]
[]
[Components]
[total_power]
type = TotalPower
power = ${tot_power}
[]
[core_chan]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
A = ${fparse core_pitch * core_pitch - pi * core_dia * core_dia / 4.}
D_h = ${core_dia}
f = 1.6
[]
[core_hs]
type = HeatStructureCylindrical
position = '0 0 0'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
names = 'block'
widths = '${fparse core_dia / 2.}'
materials = 'steel'
n_part_elems = 3
[]
[core_heating]
type = HeatSourceFromTotalPower
hs = core_hs
regions = block
power = total_power
[]
[core_ht]
type = HeatTransferFromHeatStructure1Phase
flow_channel = core_chan
hs = core_hs
hs_side = outer
P_hf = ${fparse pi * core_dia}
Hw = 1.36
[]
[jct1]
type = JunctionParallelChannels1Phase
position = '0 0 1'
connections = 'core_chan:out up_pipe:in'
volume = 1e-3
[]
[up_pipe]
type = FlowChannel1Phase
position = '0 0 1'
orientation = '0 0 1'
length = 1
n_elems = 10
A = ${fparse pi * pipe_dia * pipe_dia / 4.}
D_h = ${pipe_dia}
[]
[jct2]
type = VolumeJunction1Phase
position = '0 0 2'
connections = 'up_pipe:out top_pipe:in'
volume = 1e-3
[]
[top_pipe]
type = FlowChannel1Phase
position = '0 0 2'
orientation = '1 0 0'
length = 1
n_elems = 10
A = ${fparse pi * pipe_dia * pipe_dia / 4.}
D_h = ${pipe_dia}
[]
[jct3]
type = VolumeJunction1Phase
position = '1 0 2'
connections = 'top_pipe:out hx/pri:in'
volume = 1e-3
[]
[hx]
[pri]
type = FlowChannel1Phase
position = '1 0 2'
orientation = '0 0 -1'
length = ${hx_length}
n_elems = ${hx_n_elems}
A = ${fparse pi * hx_dia_inner * hx_dia_inner / 4.}
D_h = ${hx_dia_inner}
[]
[ht_pri]
type = HeatTransferFromHeatStructure1Phase
hs = hx/wall
hs_side = inner
flow_channel = hx/pri
Hw = 0.97
[]
[wall]
type = HeatStructureCylindrical
position = '1 0 2'
orientation = '0 0 -1'
length = ${hx_length}
n_elems = ${hx_n_elems}
widths = '${hx_wall_thickness}'
n_part_elems = '3'
materials = 'steel'
names = '0'
inner_radius = ${fparse hx_dia_inner / 2.}
[]
[ht_sec]
type = HeatTransferFromHeatStructure1Phase
hs = hx/wall
hs_side = outer
flow_channel = hx/sec
P_hf = ${fparse 2 * pi * hx_radius_wall}
Hw = 36
[]
[sec]
type = FlowChannel1Phase
position = '${fparse 1 + hx_wall_thickness} 0 2'
orientation = '0 0 -1'
length = ${hx_length}
n_elems = ${hx_n_elems}
A = ${fparse pi * (hx_dia_outer * hx_dia_outer / 4. - hx_radius_wall * hx_radius_wall)}
D_h = ${fparse hx_dia_outer - (2 * hx_radius_wall)}
fp = water
f = 0.075
[]
[]
[jct4]
type = VolumeJunction1Phase
position = '1 0 1'
connections = 'hx/pri:out down_pipe:in'
volume = 1e-3
[]
[down_pipe]
type = FlowChannel1Phase
position = '1 0 1'
orientation = '0 0 -1'
length = 1
n_elems = 10
A = ${fparse pi * pipe_dia * pipe_dia / 4.}
D_h = ${pipe_dia}
[]
[jct5]
type = VolumeJunction1Phase
position = '1 0 0'
connections = 'down_pipe:out bottom_b:in'
volume = 1e-3
[]
[bottom_b]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '-1 0 0'
length = 0.5
n_elems = 5
A = ${fparse pi * pipe_dia * pipe_dia / 4.}
D_h = ${pipe_dia}
[]
[pump]
type = Pump1Phase
position = '0.5 0 0'
connections = 'bottom_b:out bottom_a:in'
volume = 1e-3
A_ref = ${fparse pi * pipe_dia * pipe_dia / 4.}
head = 0
[]
[bottom_a]
type = FlowChannel1Phase
position = '0.5 0 0'
orientation = '-1 0 0'
length = 0.5
n_elems = 5
A = ${fparse pi * pipe_dia * pipe_dia / 4.}
D_h = ${pipe_dia}
[]
[jct6]
type = VolumeJunction1Phase
position = '0 0 0'
connections = 'bottom_a:out core_chan:in'
volume = 1e-3
[]
[inlet_sec]
type = InletMassFlowRateTemperature1Phase
input = 'hx/sec:out'
m_dot = 0
T = 300
[]
[outlet_sec]
type = Outlet1Phase
input = 'hx/sec:in'
p = ${press}
[]
[]
[ControlLogic]
[set_point]
type = GetFunctionValueControl
function = ${m_dot_in}
[]
[pid]
type = PIDControl
initial_value = 0
set_point = set_point:value
input = m_dot_pump
K_p = 250
K_i = 0.5
K_d = 0
[]
[set_pump_head]
type = SetComponentRealValueControl
component = pump
parameter = head
value = pid:output
[]
[m_dot_sec_inlet_ctrl]
type = GetFunctionValueControl
function = m_dot_sec_fn
[]
[set_m_dot_sec_ctrl]
type = SetComponentRealValueControl
component = inlet_sec
parameter = m_dot
value = m_dot_sec_inlet_ctrl:value
[]
[]
[Postprocessors]
[m_dot_pump]
type = ADFlowJunctionFlux1Phase
boundary = core_chan:in
connection_index = 1
equation = mass
junction = jct6
[]
[core_T_out]
type = SideAverageValue
boundary = core_chan:out
variable = T
[]
[hx_pri_T_out]
type = SideAverageValue
boundary = hx/pri:out
variable = T
[]
[hx_sec_T_in]
type = SideAverageValue
boundary = inlet_sec
variable = T
[]
[hx_sec_T_out]
type = SideAverageValue
boundary = outlet_sec
variable = T
[]
[]
[Executioner]
type = Transient
start_time = 0
[TimeStepper]
type = SolutionTimeAdaptiveDT
dt = 1
[]
dtmax = 100
end_time = 50000
line_search = basic
solve_type = NEWTON
nl_rel_tol = 1e-5
nl_abs_tol = 1e-5
nl_max_its = 5
[]
[Outputs]
exodus = true
[console]
type = Console
max_rows = 1
outlier_variable_norms = false
[]
print_linear_residuals = false
[]
(modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_1phase/phy.heat_structure_multiple_3eqn.i)
# Tests that energy conservation is satisfied in 1-phase flow when there are
# multiple heat structures are connected to the same pipe.
#
# This problem has 2 heat structures with different material properties and
# initial conditions connected to the same flow channel, which has solid wall
# boundary conditions at both ends. An ideal gas equation of state is used for
# the fluid:
# e(T) = cv * T
# From energy conservation, an analytic expression for the steady-state
# temperature results:
# (rho(p,T)*e(T)*V)_fluid + (rho*cp*T*V)_hs1 + (rho*cp*T*V)_hs2 = constant
# The following are constant:
# V_i domain volumes for flow channel and heat structures
# rho_fluid fluid density (due to conservation of mass)
# rho_hsi heat structure densities
# cp_hsi heat structure specific heats
# Furthermore, all volumes are set equal to 1. Therefore the expression for the
# steady-state temperature is the following:
# T = E0 / C0
# where
# E0 = (rho(p0,T0)*e(T0))_fluid + (rho*cp*T0)_hs1 + (rho*cp*T0)_hs2
# C0 = (rho(p0,T0)*cv)_fluid + (rho*cp)_hs1 + (rho*cp)_hs2
#
# An ideal gas is defined by (gamma, R), and the relation between R and cv is as
# follows:
# cp = gamma * R / (gamma - 1)
# cv = cp / gamma = R / (gamma - 1)
# For the EOS parameters
# gamma = 1.0001
# R = 100 J/kg-K
# the relevant specific heat is
# cv = 1e6 J/kg-K
#
# For the initial conditions
# p = 100 kPa
# T = 300 K
# the density and specific internal energy should be
# rho = 3.3333333333333 kg/m^3
# e = 300000000 J/kg
#
# The following heat structure parameters are used:
# T0_hs1 = 290 K T0_hs2 = 310 K
# rho_hs1 = 8000 kg/m^3 rho_hs2 = 6000 kg/m^3
# cp_hs1 = 500 J/kg-K cp_hs2 = 600 J/kg-K
#
# E0 = 1e9 + 8000 * 500 * 290 + 6000 * 600 * 310
# = 3276000000 J
# C0 = 3.3333333333333e6 + 8000 * 500 + 6000 * 600
# = 10933333.3333333 J/K
# T = E0 / C0
# = 3276000000 / 10933333.3333333
# = 299.6341463414643 K
#
T1 = 290
k1 = 50
rho1 = 8000
cp1 = 500
T2 = 310
k2 = 100
rho2 = 6000
cp2 = 600
[GlobalParams]
gravity_vector = '0 0 0'
initial_T = 300
initial_p = 100e3
initial_vel = 0
scaling_factor_1phase = '1e-3 1e-3 1e-8'
closures = simple_closures
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.0001
molar_mass = 0.083144598
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[HeatStructureMaterials]
[hs1_mat]
type = SolidMaterialProperties
k = ${k1}
rho = ${rho1}
cp = ${cp1}
[]
[hs2_mat]
type = SolidMaterialProperties
k = ${k2}
rho = ${rho2}
cp = ${cp2}
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 10
A = 1
f = 0
fp = fp
[]
[hs1]
type = HeatStructurePlate
position = '0 -1 0'
orientation = '1 0 0'
length = 1
depth = 1
n_elems = 10
materials = 'hs1_mat'
n_part_elems = '5'
widths = '1'
names = 'solid'
initial_T = ${T1}
[]
[hs2]
type = HeatStructurePlate
position = '0 -1 0'
orientation = '1 0 0'
length = 1
depth = 1
n_elems = 10
materials = 'hs2_mat'
n_part_elems = '5'
widths = '1'
names = 'solid'
initial_T = ${T2}
[]
[ht1]
type = HeatTransferFromHeatStructure1Phase
hs = hs1
hs_side = outer
flow_channel = pipe
Hw = 1e5
P_hf = 0.5
[]
[ht2]
type = HeatTransferFromHeatStructure1Phase
hs = hs2
hs_side = outer
flow_channel = pipe
Hw = 1e5
P_hf = 0.5
[]
[left]
type = SolidWall1Phase
input = 'pipe:in'
[]
[right]
type = SolidWall1Phase
input = 'pipe:out'
[]
[]
[Preconditioning]
[preconditioner]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
end_time = 4e5
dt = 1e4
abort_on_solve_fail = true
solve_type = 'newton'
line_search = 'basic'
nl_rel_tol = 0
nl_abs_tol = 1e-6
nl_max_its = 10
l_tol = 1e-3
l_max_its = 100
[Quadrature]
type = GAUSS
order = SECOND
[]
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu'
[]
[Postprocessors]
[T_steady_state_predicted]
type = FunctionValuePostprocessor
# This value is computed in the input file description
function = 299.6341463414643
[]
[T_fluid_average]
type = ElementAverageValue
variable = T
block = pipe
[]
[relative_error]
type = RelativeDifferencePostprocessor
value1 = T_steady_state_predicted
value2 = T_fluid_average
[]
[]
[Outputs]
[out]
type = CSV
show = 'relative_error'
execute_on = 'final'
[]
[]
(modules/thermal_hydraulics/test/tests/problems/woodward_colella_blast_wave/woodward_colella_blast_wave.i)
# Woodward-Colella blast wave problem
[GlobalParams]
gravity_vector = '0 0 0'
closures = simple_closures
[]
[Functions]
[p_ic_fn]
type = PiecewiseConstant
axis = x
direction = right
x = '0.1 0.9 1.0'
y = '1000 0.01 100'
[]
[T_ic_fn]
type = PiecewiseConstant
axis = x
direction = right
x = '0.1 0.9 1.0'
y = '1400 0.014 140'
[]
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 11.64024372
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp
# geometry
position = '0 0 0'
orientation = '1 0 0'
length = 1.0
n_elems = 500
A = 1.0
# IC
initial_T = T_ic_fn
initial_p = p_ic_fn
initial_vel = 0
f = 0
[]
[left_wall]
type = SolidWall1Phase
input = 'pipe:in'
[]
[right_wall]
type = SolidWall1Phase
input = 'pipe:out'
[]
[]
[Executioner]
type = Transient
[TimeIntegrator]
type = ExplicitSSPRungeKutta
order = 2
[]
solve_type = LINEAR
l_tol = 1e-4
nl_rel_tol = 1e-20
nl_abs_tol = 1e-8
nl_max_its = 60
# run to t = 0.038
start_time = 0.0
dt = 1e-5
num_steps = 3800
abort_on_solve_fail = true
[]
[Outputs]
file_base = 'woodward_colella_blast_wave'
velocity_as_vector = false
execute_on = 'initial timestep_end'
[out]
type = Exodus
show = 'p T vel'
[]
[]
(modules/fluid_properties/test/tests/ideal_gas/test.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
elem_type = QUAD4
[]
[Functions]
[./f_fn]
type = ParsedFunction
value = -4
[../]
[./bc_fn]
type = ParsedFunction
value = 'x*x+y*y'
[../]
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./e]
initial_condition = 6232.5
[../]
[./v]
initial_condition = 0.02493
[../]
[./p]
family = MONOMIAL
order = CONSTANT
[../]
[./T]
family = MONOMIAL
order = CONSTANT
[../]
[./cp]
family = MONOMIAL
order = CONSTANT
[../]
[./cv]
family = MONOMIAL
order = CONSTANT
[../]
[./c]
family = MONOMIAL
order = CONSTANT
[../]
[./mu]
family = MONOMIAL
order = CONSTANT
[../]
[./k]
family = MONOMIAL
order = CONSTANT
[../]
[./g]
family = MONOMIAL
order = CONSTANT
[../]
[]
[AuxKernels]
[./p]
type = MaterialRealAux
variable = p
property = pressure
[../]
[./T]
type = MaterialRealAux
variable = T
property = temperature
[../]
[./cp]
type = MaterialRealAux
variable = cp
property = cp
[../]
[./cv]
type = MaterialRealAux
variable = cv
property = cv
[../]
[./c]
type = MaterialRealAux
variable = c
property = c
[../]
[./mu]
type = MaterialRealAux
variable = mu
property = mu
[../]
[./k]
type = MaterialRealAux
variable = k
property = k
[../]
[./g]
type = MaterialRealAux
variable = g
property = g
[../]
[]
[Modules]
[./FluidProperties]
[./ideal_gas]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 1.000536678700361
[../]
[]
[]
[Materials]
[./fp_mat]
type = FluidPropertiesMaterial
e = e
v = v
fp = ideal_gas
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./ffn]
type = BodyForce
variable = u
function = f_fn
[../]
[]
[BCs]
[./all]
type = FunctionDirichletBC
variable = u
boundary = 'left right top bottom'
function = bc_fn
[../]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
exodus = true
[]
(modules/thermal_hydraulics/test/tests/problems/double_rarefaction/1phase.i)
# Riemann problem that has a double-rarefaction solution
[GlobalParams]
gravity_vector = '0 0 0'
rdg_slope_reconstruction = minmod
closures = simple_closures
[]
[Functions]
[vel_ic_fn]
type = PiecewiseConstant
axis = x
direction = right
x = ' 0.0 0.1'
y = '-1.0 1.0'
[]
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 11.64024372
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp
# geometry
position = '-1 0 0'
orientation = '1 0 0'
length = 2.0
n_elems = 100
A = 1.0
# IC
initial_T = 0.04
initial_p = 0.2
initial_vel = vel_ic_fn
f = 0
[]
[left_boundary]
type = FreeBoundary1Phase
input = 'pipe:in'
[]
[right_boundary]
type = FreeBoundary1Phase
input = 'pipe:out'
[]
[]
[Executioner]
type = Transient
[TimeIntegrator]
type = ExplicitSSPRungeKutta
order = 2
[]
solve_type = LINEAR
l_tol = 1e-4
nl_rel_tol = 1e-20
nl_abs_tol = 1e-8
nl_max_its = 60
# run to t = 0.6
start_time = 0.0
dt = 1e-3
num_steps = 600
abort_on_solve_fail = true
[]
[Outputs]
file_base = '1phase'
velocity_as_vector = false
execute_on = 'initial timestep_end'
[out]
type = Exodus
show = 'p T vel'
[]
[]
(modules/thermal_hydraulics/test/tests/components/deprecated/gate_valve.i)
[GlobalParams]
gravity_vector = '0 0 0'
closures = simple_closures
fp = fp
f = 0.0
initial_T = 300
initial_p = 1e5
initial_vel = 0
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.02897
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe1:in'
m_dot = 1
T = 300
[]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 0'
length = 0.5
n_elems = 2
A = 0.1
[]
[valve]
type = GateValve
connections = 'pipe1:out pipe2:in'
open_area_fraction = 1
[]
[pipe2]
type = FlowChannel1Phase
position = '0.5 0 0'
orientation = '1 0 0'
length = 0.5
n_elems = 2
A = 0.1
[]
[outlet]
type = Outlet1Phase
input = 'pipe2:out'
p = 1e5
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 20
l_tol = 1e-4
start_time = 0.0
end_time = 1.0
dt = 0.01
abort_on_solve_fail = true
[]
(modules/thermal_hydraulics/test/tests/components/shaft_connected_pump_1phase/shaft_motor_pump.i)
# Pump data used in this test comes from the Semiscale Program, summarized in NUREG/CR-4945
initial_T = 393.15
area = 1e-2
dt = 1.e-2
[GlobalParams]
initial_p = 1.4E+07
initial_T = ${initial_T}
initial_vel = 10
initial_vel_x = 10
initial_vel_y = 0
initial_vel_z = 0
A = ${area}
A_ref = ${area}
f = 100
scaling_factor_1phase = '0.04 0.04 0.04e-5'
closures = simple_closures
fp = fp
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pump]
type = ShaftConnectedPump1Phase
inlet = 'pipe:out'
outlet = 'pipe:in'
position = '0 0 0'
scaling_factor_rhoEV = 1e-5
volume = 0.3
inertia_coeff = '1 1 1 1'
inertia_const = 1.61397
omega_rated = 314
speed_cr_I = 1e12
speed_cr_fr = 0
torque_rated = 47.1825
volumetric_rated = 1
head_rated = 58.52
tau_fr_coeff = '0 0 9.084 0'
tau_fr_const = 0
head = head_fcn
torque_hydraulic = torque_fcn
density_rated = 124.2046
[]
[pipe]
type = FlowChannel1Phase
position = '0.6096 0 0'
orientation = '1 0 0'
length = 10
n_elems = 20
[]
[motor]
type = ShaftConnectedMotor
inertia = 2
torque = 47
[]
[shaft]
type = Shaft
connected_components = 'motor pump'
initial_speed = 30
[]
[]
[Functions]
[head_fcn]
type = PiecewiseLinear
data_file = semiscale_head_data.csv
format = columns
[]
[torque_fcn]
type = PiecewiseLinear
data_file = semiscale_torque_data.csv
format = columns
[]
[S_energy_fcn]
type = ParsedFunction
value = '-tau_hyd * omega'
vars = 'tau_hyd omega'
vals = 'pump:hydraulic_torque shaft:omega'
[]
[energy_conservation_fcn]
type = ParsedFunction
value = '(E_change - S_energy * dt) / E_tot'
vars = 'E_change S_energy dt E_tot'
vals = 'E_change S_energy ${dt} E_tot'
[]
[]
[Postprocessors]
# mass conservation
[mass_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoA
block = 'pipe'
execute_on = 'initial timestep_end'
[]
[mass_pump]
type = ScalarVariable
variable = pump:rhoV
execute_on = 'initial timestep_end'
[]
[mass_tot]
type = SumPostprocessor
values = 'mass_pipes mass_pump'
execute_on = 'initial timestep_end'
[]
[mass_conservation]
type = ChangeOverTimePostprocessor
postprocessor = mass_tot
change_with_respect_to_initial = true
compute_relative_change = true
execute_on = 'initial timestep_end'
[]
# energy conservation
[E_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoEA
block = 'pipe'
execute_on = 'initial timestep_end'
[]
[E_pump]
type = ScalarVariable
variable = pump:rhoEV
execute_on = 'initial timestep_end'
[]
[E_tot]
type = LinearCombinationPostprocessor
pp_coefs = '1 1'
pp_names = 'E_pipes E_pump'
execute_on = 'initial timestep_end'
[]
[S_energy]
type = FunctionValuePostprocessor
function = S_energy_fcn
execute_on = 'initial timestep_end'
[]
[E_change]
type = ChangeOverTimePostprocessor
postprocessor = E_tot
execute_on = 'initial timestep_end'
[]
# This should also execute on initial. This value is
# lagged by one timestep as a workaround to moose issue #13262.
[energy_conservation]
type = FunctionValuePostprocessor
function = energy_conservation_fcn
execute_on = 'timestep_end'
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'implicit-euler'
dt = ${dt}
num_steps = 6
solve_type = 'NEWTON'
line_search = 'basic'
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-6
nl_max_its = 15
l_tol = 1e-4
l_max_its = 10
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Outputs]
velocity_as_vector = false
[]
(modules/thermal_hydraulics/test/tests/output/vector_velocity/test.i)
[GlobalParams]
initial_vel = 0
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
initial_p = 1e5
initial_T = 300
f = 0.1
closures = simple_closures
fp = fp
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'fch1:in'
m_dot = 1
T = 300
[]
[fch1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 1 1'
length = 1.73205
n_elems = 5
A = 1
[]
[junction]
type = VolumeJunction1Phase
position = '1 1 1'
connections = 'fch1:out fch2:out'
volume = 0.1
[]
[fch2]
type = FlowChannel1Phase
position = '2 2 2'
orientation = '-1 -1 -1'
length = 1.73205
n_elems = 5
A = 2
[]
[outlet]
type = Outlet1Phase
input = 'fch2:in'
p = 1e5
[]
[]
[Executioner]
type = Transient
dt = 0.5
num_steps = 50
solve_type = NEWTON
line_search = basic
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_abs_tol = 1e-6
l_tol = 1e-03
automatic_scaling = true
[]
[Outputs]
print_linear_converged_reason = false
print_nonlinear_converged_reason = false
print_linear_residuals = false
[out]
type = Exodus
sync_only = false
sync_times = '0 5 10 15 20 25'
show = 'vel_x vel_y vel_z'
[]
[]
(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
function = 'u'
execute_on = 'initial timestep_end'
args = 'u'
[]
[vel_y]
type = ParsedAux
variable = vel_y
function = 'v'
execute_on = 'initial timestep_end'
args = 'v'
[]
[viz_T]
type = ParsedAux
variable = viz_T
function = 'T'
execute_on = 'initial timestep_end'
args = 'T'
[]
[rho_out]
type = ADFunctorElementalAux
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 = FVScalarLagrangeMultiplier
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}
[]
[]
[Modules]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[]
[Materials]
[const]
type = ADGenericConstantMaterial
prop_names = 'alpha'
prop_values = '${alpha}'
[]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyMaterial
temperature = 'T'
rho = ${rho}
[]
[]
[Functions]
[lid_function]
type = ParsedFunction
value = '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
[]
(modules/fluid_properties/test/tests/ideal_gas/test2.i)
# Test IdealGasFluidPropertiesFluidProperties using pressure and temperature
# Use values for Oxygen at 1 MPa and 350 K from NIST chemistry webook
#
# Input values:
# Cv = 669.8e J/kg/K
# Cp = 938.75 J/kg/K
# M = 31.9988e-3 kg/mol
#
# Expected output:
# density = 10.99591793 kg/m^3
# internal energy = 234.43e3 J/kg
# enthalpy = 328.5625e3 J/kg
# speed of sound = 357.0151605 m/s
[Mesh]
type = GeneratedMesh
dim = 2
nx = 1
ny = 1
[]
[Variables]
[./dummy]
[../]
[]
[AuxVariables]
[./pressure]
family = MONOMIAL
order = CONSTANT
initial_condition = 1e6
[../]
[./temperature]
family = MONOMIAL
order = CONSTANT
initial_condition = 350
[../]
[./density]
family = MONOMIAL
order = CONSTANT
[../]
[./viscosity]
family = MONOMIAL
order = CONSTANT
[../]
[./cp]
family = MONOMIAL
order = CONSTANT
[../]
[./cv]
family = MONOMIAL
order = CONSTANT
[../]
[./internal_energy]
family = MONOMIAL
order = CONSTANT
[../]
[./enthalpy]
family = MONOMIAL
order = CONSTANT
[../]
[./entropy]
family = MONOMIAL
order = CONSTANT
[../]
[./thermal_cond]
family = MONOMIAL
order = CONSTANT
[../]
[./c]
family = MONOMIAL
order = CONSTANT
[../]
[]
[AuxKernels]
[./density]
type = MaterialRealAux
variable = density
property = density
[../]
[./viscosity]
type = MaterialRealAux
variable = viscosity
property = viscosity
[../]
[./cp]
type = MaterialRealAux
variable = cp
property = cp
[../]
[./cv]
type = MaterialRealAux
variable = cv
property = cv
[../]
[./e]
type = MaterialRealAux
variable = internal_energy
property = e
[../]
[./enthalpy]
type = MaterialRealAux
variable = enthalpy
property = h
[../]
[./entropy]
type = MaterialRealAux
variable = entropy
property = s
[../]
[./thermal_cond]
type = MaterialRealAux
variable = thermal_cond
property = k
[../]
[./c]
type = MaterialRealAux
variable = c
property = c
[../]
[]
[Modules]
[./FluidProperties]
[./idealgas]
type = IdealGasFluidProperties
gamma = 1.401537772469394
molar_mass = 0.0319988
[../]
[]
[]
[Materials]
[./fp_mat]
type = FluidPropertiesMaterialPT
pressure = pressure
temperature = temperature
fp = idealgas
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = dummy
[../]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
exodus = true
[]
(modules/thermal_hydraulics/test/tests/problems/area_constriction/area_constriction.i)
# This test features air flowing through a channel whose cross-sectional area
# shrinks to half its value in the right half. Assuming incompressible flow
# conditions, such as having a low Mach number, the velocity should approximately
# double from inlet to outlet.
p_outlet = 1e5
[GlobalParams]
gravity_vector = '0 0 0'
initial_T = 300
initial_p = ${p_outlet}
initial_vel = initial_vel_fn
fp = fp
closures = simple_closures
f = 0
scaling_factor_1phase = '1 1 1e-5'
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Functions]
[A_fn]
type = PiecewiseConstant
axis = x
direction = right
x = '0.5 1.0'
y = '1.0 0.5'
[]
[initial_vel_fn]
type = PiecewiseConstant
axis = x
direction = right
x = '0.5 1.0'
y = '1.0 2'
[]
[]
[Components]
[inlet]
type = InletDensityVelocity1Phase
input = 'pipe:in'
rho = 1.16263315948279 # rho @ (p = 1e5 Pa, T = 300 K)
vel = 1
[]
[pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 100
A = A_fn
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = ${p_outlet}
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
end_time = 10
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.001
optimal_iterations = 5
iteration_window = 1
growth_factor = 1.2
[]
steady_state_detection = true
solve_type = PJFNK
nl_rel_tol = 1e-10
nl_abs_tol = 1e-8
nl_max_its = 15
l_tol = 1e-3
l_max_its = 10
[]
[Outputs]
exodus = true
velocity_as_vector = false
show = 'A rho vel p'
[]
(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
[]
[]
[Modules]
[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
value_x = '0'
value_y = '${u_in}'
[]
[eps]
type = ParsedFunction
value = '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
[]
(modules/thermal_hydraulics/test/tests/problems/brayton_cycle/open_brayton_cycle.i)
# This input file is used to demonstrate a simple open-air Brayton cycle using
# a compressor, turbine, shaft, motor, and generator.
# The flow length is divided into 5 segments as illustrated below, where
# - "(I)" denotes the inlet
# - "(C)" denotes the compressor
# - "(T)" denotes the turbine
# - "(O)" denotes the outlet
# - "*" denotes a fictitious junction
#
# Heated section
# (I)-----(C)-----*--------------*-----(T)-----(O)
# 1 2 3 4 5
#
# Initially the fluid is at rest at ambient conditions, the shaft speed is zero,
# and no heat transfer occurs with the system.
# The transient is controlled as follows:
# * 0 - 100 s: motor ramps up torque linearly from zero
# * 100 - 200 s: motor ramps down torque linearly to zero, HTC ramps up linearly from zero.
# * 200 - 300 s: (no changes; should approach steady condition)
I_motor = 1.0
motor_torque_max = 400.0
I_generator = 1.0
generator_torque_per_shaft_speed = -0.00025
motor_ramp_up_duration = 100.0
motor_ramp_down_duration = 100.0
post_motor_time = 100.0
t1 = ${motor_ramp_up_duration}
t2 = ${fparse t1 + motor_ramp_down_duration}
t3 = ${fparse t2 + post_motor_time}
D1 = 0.15
D2 = ${D1}
D3 = ${D1}
D4 = ${D1}
D5 = ${D1}
A1 = ${fparse 0.25 * pi * D1^2}
A2 = ${fparse 0.25 * pi * D2^2}
A3 = ${fparse 0.25 * pi * D3^2}
A4 = ${fparse 0.25 * pi * D4^2}
A5 = ${fparse 0.25 * pi * D5^2}
L1 = 10.0
L2 = ${L1}
L3 = ${L1}
L4 = ${L1}
L5 = ${L1}
x1 = 0.0
x2 = ${fparse x1 + L1}
x3 = ${fparse x2 + L2}
x4 = ${fparse x3 + L3}
x5 = ${fparse x4 + L4}
x2_minus = ${fparse x2 - 0.001}
x2_plus = ${fparse x2 + 0.001}
x5_minus = ${fparse x5 - 0.001}
x5_plus = ${fparse x5 + 0.001}
n_elems1 = 10
n_elems2 = ${n_elems1}
n_elems3 = ${n_elems1}
n_elems4 = ${n_elems1}
n_elems5 = ${n_elems1}
A_ref_comp = ${fparse 0.5 * (A1 + A2)}
V_comp = ${fparse A_ref_comp * 1.0}
I_comp = 1.0
A_ref_turb = ${fparse 0.5 * (A4 + A5)}
V_turb = ${fparse A_ref_turb * 1.0}
I_turb = 1.0
c0_rated_comp = 351.6925137
rho0_rated_comp = 1.146881112
rated_mfr = 0.25
speed_rated_rpm = 96000
speed_rated = ${fparse speed_rated_rpm * 2 * pi / 60.0}
speed_initial = 0
eff_comp = 0.79
eff_turb = 0.843
T_hot = 1000
T_ambient = 300
p_ambient = 1e5
[GlobalParams]
orientation = '1 0 0'
gravity_vector = '0 0 0'
initial_p = ${p_ambient}
initial_T = ${T_ambient}
initial_vel = 0
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
fp = fp_air
closures = closures
f = 0
scaling_factor_1phase = '1 1 1e-5'
scaling_factor_rhoV = 1
scaling_factor_rhouV = 1
scaling_factor_rhovV = 1
scaling_factor_rhowV = 1
scaling_factor_rhoEV = 1e-5
rdg_slope_reconstruction = none
[]
[Functions]
[motor_torque_fn]
type = PiecewiseLinear
x = '0 ${t1} ${t2}'
y = '0 ${motor_torque_max} 0'
[]
[motor_power_fn]
type = ParsedFunction
value = 'torque * speed'
vars = 'torque speed'
vals = 'motor_torque shaft:omega'
[]
[generator_torque_fn]
type = ParsedFunction
value = 'slope * t'
vars = 'slope'
vals = '${generator_torque_per_shaft_speed}'
[]
[generator_power_fn]
type = ParsedFunction
value = 'torque * speed'
vars = 'torque speed'
vals = 'generator_torque shaft:omega'
[]
[htc_wall_fn]
type = PiecewiseLinear
x = '0 ${t1} ${t2}'
y = '0 0 1e3'
[]
[]
[Modules/FluidProperties]
[fp_air]
type = IdealGasFluidProperties
emit_on_nan = none
[]
[]
[Closures]
[closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[shaft]
type = Shaft
connected_components = 'motor compressor turbine generator'
initial_speed = ${speed_initial}
[]
[motor]
type = ShaftConnectedMotor
inertia = ${I_motor}
torque = 0 # controlled
[]
[generator]
type = ShaftConnectedMotor
inertia = ${I_generator}
torque = generator_torque_fn
[]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe1:in'
p0 = ${p_ambient}
T0 = ${T_ambient}
[]
[pipe1]
type = FlowChannel1Phase
position = '${x1} 0 0'
length = ${L1}
n_elems = ${n_elems1}
A = ${A1}
[]
[compressor]
type = ShaftConnectedCompressor1Phase
position = '${x2} 0 0'
inlet = 'pipe1:out'
outlet = 'pipe2:in'
A_ref = ${A_ref_comp}
volume = ${V_comp}
omega_rated = ${speed_rated}
mdot_rated = ${rated_mfr}
c0_rated = ${c0_rated_comp}
rho0_rated = ${rho0_rated_comp}
speeds = '0.5208 0.6250 0.7292 0.8333 0.9375'
Rp_functions = 'rp_comp1 rp_comp2 rp_comp3 rp_comp4 rp_comp5'
eff_functions = 'eff_comp1 eff_comp2 eff_comp3 eff_comp4 eff_comp5'
min_pressure_ratio = 1.0
speed_cr_I = 0
inertia_const = ${I_comp}
inertia_coeff = '${I_comp} 0 0 0'
# assume no shaft friction
speed_cr_fr = 0
tau_fr_const = 0
tau_fr_coeff = '0 0 0 0'
[]
[pipe2]
type = FlowChannel1Phase
position = '${x2} 0 0'
length = ${L2}
n_elems = ${n_elems2}
A = ${A2}
[]
[junction2_3]
type = JunctionOneToOne1Phase
connections = 'pipe2:out pipe3:in'
[]
[pipe3]
type = FlowChannel1Phase
position = '${x3} 0 0'
length = ${L3}
n_elems = ${n_elems3}
A = ${A3}
[]
[junction3_4]
type = JunctionOneToOne1Phase
connections = 'pipe3:out pipe4:in'
[]
[pipe4]
type = FlowChannel1Phase
position = '${x4} 0 0'
length = ${L4}
n_elems = ${n_elems4}
A = ${A4}
[]
[turbine]
type = ShaftConnectedCompressor1Phase
position = '${x5} 0 0'
inlet = 'pipe4:out'
outlet = 'pipe5:in'
A_ref = ${A_ref_turb}
volume = ${V_turb}
treat_as_turbine = true
omega_rated = ${speed_rated}
mdot_rated = ${rated_mfr}
c0_rated = ${c0_rated_comp}
rho0_rated = ${rho0_rated_comp}
speeds = '0 0.5208 0.6250 0.7292 0.8333 0.9375'
Rp_functions = 'rp_turb0 rp_turb1 rp_turb2 rp_turb3 rp_turb4 rp_turb5'
eff_functions = 'eff_turb1 eff_turb1 eff_turb2 eff_turb3 eff_turb4 eff_turb5'
min_pressure_ratio = 1.0
speed_cr_I = 0
inertia_const = ${I_turb}
inertia_coeff = '${I_turb} 0 0 0'
# assume no shaft friction
speed_cr_fr = 0
tau_fr_const = 0
tau_fr_coeff = '0 0 0 0'
[]
[pipe5]
type = FlowChannel1Phase
position = '${x5} 0 0'
length = ${L5}
n_elems = ${n_elems5}
A = ${A5}
[]
[outlet]
type = Outlet1Phase
input = 'pipe5:out'
p = ${p_ambient}
[]
[heating]
type = HeatTransferFromSpecifiedTemperature1Phase
flow_channel = pipe3
T_wall = ${T_hot}
Hw = htc_wall_fn
[]
[]
[ControlLogic]
[motor_ctrl]
type = TimeFunctionComponentControl
component = motor
parameter = torque
function = motor_torque_fn
[]
[]
[Postprocessors]
[heating_rate]
type = ADHeatRateConvection1Phase
block = 'pipe3'
T = T
T_wall = T_wall
Hw = Hw
P_hf = P_hf
execute_on = 'INITIAL TIMESTEP_END'
[]
[motor_torque]
type = RealComponentParameterValuePostprocessor
component = motor
parameter = torque
execute_on = 'INITIAL TIMESTEP_END'
[]
[motor_power]
type = FunctionValuePostprocessor
function = motor_power_fn
execute_on = 'INITIAL TIMESTEP_END'
[]
[generator_torque]
type = ShaftConnectedComponentPostprocessor
quantity = torque
shaft_connected_component_uo = generator:shaftconnected_uo
execute_on = 'INITIAL TIMESTEP_END'
[]
[generator_power]
type = FunctionValuePostprocessor
function = generator_power_fn
execute_on = 'INITIAL TIMESTEP_END'
[]
[shaft_speed]
type = ScalarVariable
variable = 'shaft:omega'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_in_comp]
type = PointValue
variable = p
point = '${x2_minus} 0 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_out_comp]
type = PointValue
variable = p
point = '${x2_plus} 0 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_ratio_comp]
type = ParsedPostprocessor
pp_names = 'p_in_comp p_out_comp'
function = 'p_out_comp / p_in_comp'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_in_turb]
type = PointValue
variable = p
point = '${x5_minus} 0 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_out_turb]
type = PointValue
variable = p
point = '${x5_plus} 0 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_ratio_turb]
type = ParsedPostprocessor
pp_names = 'p_in_turb p_out_turb'
function = 'p_in_turb / p_out_turb'
execute_on = 'INITIAL TIMESTEP_END'
[]
[mfr_comp]
type = ADFlowJunctionFlux1Phase
boundary = pipe1:out
connection_index = 0
equation = mass
junction = compressor
[]
[mfr_turb]
type = ADFlowJunctionFlux1Phase
boundary = pipe4:out
connection_index = 0
equation = mass
junction = turbine
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
end_time = ${t3}
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.01
optimal_iterations = 5
iteration_window = 1
growth_factor = 1.1
cutback_factor = 0.9
[]
dtmin = 1e-5
steady_state_detection = true
steady_state_start_time = ${t2}
solve_type = NEWTON
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 15
l_tol = 1e-4
l_max_its = 10
[]
[Outputs]
exodus = true
[csv]
type = CSV
file_base = 'open_brayton_cycle'
execute_vector_postprocessors_on = 'INITIAL'
[]
[console]
type = Console
show = 'shaft_speed p_ratio_comp p_ratio_turb compressor:pressure_ratio turbine:pressure_ratio'
[]
[]
[Functions]
# compressor pressure ratio
[rp_comp1]
type = PiecewiseLinear
data_file = 'rp_comp1.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_comp2]
type = PiecewiseLinear
data_file = 'rp_comp2.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_comp3]
type = PiecewiseLinear
data_file = 'rp_comp3.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_comp4]
type = PiecewiseLinear
data_file = 'rp_comp4.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_comp5]
type = PiecewiseLinear
data_file = 'rp_comp5.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
# compressor efficiency
[eff_comp1]
type = ConstantFunction
value = ${eff_comp}
[]
[eff_comp2]
type = ConstantFunction
value = ${eff_comp}
[]
[eff_comp3]
type = ConstantFunction
value = ${eff_comp}
[]
[eff_comp4]
type = ConstantFunction
value = ${eff_comp}
[]
[eff_comp5]
type = ConstantFunction
value = ${eff_comp}
[]
# turbine pressure ratio
[rp_turb0]
type = ConstantFunction
value = 1
[]
[rp_turb1]
type = PiecewiseLinear
data_file = 'rp_turb1.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_turb2]
type = PiecewiseLinear
data_file = 'rp_turb2.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_turb3]
type = PiecewiseLinear
data_file = 'rp_turb3.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_turb4]
type = PiecewiseLinear
data_file = 'rp_turb4.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_turb5]
type = PiecewiseLinear
data_file = 'rp_turb5.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
# turbine efficiency
[eff_turb1]
type = ConstantFunction
value = ${eff_turb}
[]
[eff_turb2]
type = ConstantFunction
value = ${eff_turb}
[]
[eff_turb3]
type = ConstantFunction
value = ${eff_turb}
[]
[eff_turb4]
type = ConstantFunction
value = ${eff_turb}
[]
[eff_turb5]
type = ConstantFunction
value = ${eff_turb}
[]
[]
(modules/thermal_hydraulics/test/tests/components/component/err.nonexisting_component.i)
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Components]
[cmp]
type = HeatTransferFromSpecifiedTemperature1Phase
flow_channel = pipe
T_wall = 100
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
[]
(modules/thermal_hydraulics/test/tests/components/inlet_stagnation_enthalpy_1phase/phy.h_rhou_3eqn.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = 101325
initial_T = 300
initial_vel = 0
scaling_factor_1phase = '1.e2 1. 1.e-3'
closures = simple_closures
[]
[Modules/FluidProperties]
[eos]
type = IdealGasFluidProperties
gamma = 1.41
molar_mass = 28.9662e-3
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = eos
# geometry
position = '0 0 0'
orientation = '1 0 0'
A = 1e-4
D_h = 1.1283791671e-02
f = 0.0
length = 1
n_elems = 100
[]
[inlet]
type = InletStagnationEnthalpyMomentum1Phase
input = 'pipe:in'
H = 296748.357480000
rhou = 41.0009888754850
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 101325
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
dt = 1.e-2
abort_on_solve_fail = true
solve_type = 'PJFNK'
nl_rel_tol = 1e-14
nl_abs_tol = 5e-8
nl_max_its = 30
l_tol = 1e-3
l_max_its = 100
start_time = 0.0
end_time = 0.2
[]
(modules/thermal_hydraulics/test/tests/components/deprecated/solid_wall.i)
[GlobalParams]
gravity_vector = '0 0 0'
closures = simple_closures
fp = fp
f = 0.0
initial_T = 300
initial_p = 1e5
initial_vel = 0
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.02897
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[in]
type = SolidWall
input = 'pipe:in'
[]
[pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 0'
length = 0.5
n_elems = 2
A = 0.1
[]
[out]
type = SolidWall
connections = 'pipe:out'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 20
l_tol = 1e-4
start_time = 0.0
end_time = 1.0
dt = 0.01
abort_on_solve_fail = true
[]
(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
[]
[]
[Modules]
[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
value = '3.48788261470924*cos(x)'
[]
[forcing_rho]
type = ParsedFunction
value = '-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
value = '3.48788261470924*cos(1.1*x)*cos(1.3*x)'
[]
[forcing_rho_ud]
type = ParsedFunction
value = '(-(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
value = '26.7439413073546*cos(1.5*x)'
[]
[forcing_rho_et]
type = ParsedFunction
value = '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
value = '0.0106975765229418*cos(1.5*x)/cos(x) - 0.000697576522941848*cos(1.1*x)^2/cos(x)^2'
[]
[exact_eps_p]
type = ParsedFunction
value = '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
value = '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
value = '1.0*cos(1.1*x)*cos(1.3*x)/cos(x)'
[]
[eps]
type = ParsedFunction
value = 'cos(1.3*x)'
[]
[exact_superficial_velocity]
type = ParsedVectorFunction
value_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/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_1phase/jac.1phase.i)
[GlobalParams]
initial_p = 1.e5
initial_vel = 2
initial_T = 300
scaling_factor_1phase = '1 1 1'
scaling_factor_temperature = '1'
closures = simple_closures
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[HeatStructureMaterials]
[fuel-mat]
type = SolidMaterialProperties
k = 2.5
cp = 300.
rho = 1.032e4
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
position = '0 0.1 0'
orientation = '0 0 1'
length = 2
n_elems = 1
A = 8.78882e-5
D_h = 0.01179
f = 0.01
fp = fp
[]
[hs]
type = HeatStructureCylindrical
position = '0 0 0'
orientation = '0 0 1'
length = 2
n_elems = 1
names = 'fuel'
widths = '0.1'
n_part_elems = '1'
materials = 'fuel-mat'
initial_T = 300
[]
[hx]
type = HeatTransferFromHeatStructure1Phase
hs = hs
hs_side = outer
flow_channel = pipe
Hw = 100
P_hf = 0.029832559676
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 0
dt = 1
num_steps = 1
abort_on_solve_fail = true
solve_type = 'NEWTON'
petsc_options_iname = '-snes_test_err'
petsc_options_value = ' 1e-11'
[]
(modules/fluid_properties/test/tests/two_phase_fluid_properties_independent/test.i)
# Tests the TwoPhaseFluidPropertiesIndependent class, which takes the names
# of 2 single-phase fluid properties independently. This test uses a dummy
# aux to make sure that the single-phase fluid properties can be recovered
# from the 2-phase fluid properties. A modification to this test checks that
# an error results if one tries to call a 2-phase fluid properties interface
# using this class, which is designed to ensure that the 2 phases are independent.
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
# Required for NodalVariableValue on distributed mesh
allow_renumbering = false
[]
[Problem]
solve = false
[]
[AuxVariables]
[./p]
initial_condition = 1e5
[../]
[./T]
initial_condition = 300
[../]
[./rho_avg]
[../]
[]
[Modules]
[./FluidProperties]
# rho1 = 1.149425287 kg/m^3
[./fp1]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.02867055103448276
[../]
# rho2 = 0.6666666667 kg/m^3
[./fp2]
type = IdealGasFluidProperties
gamma = 1.2
molar_mass = 0.0166289196
[../]
[./fp_2phase]
type = TwoPhaseFluidPropertiesIndependent
fp_liquid = fp1
fp_vapor = fp2
[../]
[]
[]
[AuxKernels]
# correct value (0.5*(rho1 + rho2)) should be: 0.90804597685 kg/m^3
[./rho_avg_aux]
type = TwoPhaseAverageDensityAux
variable = rho_avg
p = p
T = T
fp_2phase = fp_2phase
execute_on = 'initial'
[../]
[]
[Postprocessors]
[./rho_avg_value]
type = NodalVariableValue
variable = rho_avg
nodeid = 0
[../]
[]
[Executioner]
type = Steady
[]
[Outputs]
execute_on = 'timestep_end'
csv = true
[]
(modules/thermal_hydraulics/test/tests/components/junction_one_to_one_1phase/constriction_1phase.i)
# This test is used to test the JunctionOneToOne1Phase1Phase component with unequal areas
# at the junction. The downstream flow channel has an area half that of the
# upstream pipe, so there should be a pressure increase just upstream of the
# junction due to the partial wall. The velocity should increase through the
# junction (approximately by a factor of 2, but there are compressibility effects).
[GlobalParams]
gravity_vector = '0 0 0'
fp = fp
closures = simple_closures
f = 0
initial_T = 300
initial_p = 1e5
initial_vel = 1
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 11.64024372
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[left_boundary]
type = InletDensityVelocity1Phase
input = 'left_channel:in'
rho = 466.6666667
vel = 1
[]
[left_channel]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 0.5
n_elems = 50
A = 1.0
[]
[junction]
type = JunctionOneToOne1Phase
connections = 'left_channel:out right_channel:in'
[]
[right_channel]
type = FlowChannel1Phase
position = '0.5 0 0'
orientation = '1 0 0'
length = 0.5
n_elems = 50
A = 0.5
[]
[right_boundary]
type = Outlet1Phase
input = 'right_channel:out'
p = 1e5
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
dt = 0.01
num_steps = 10
abort_on_solve_fail = true
solve_type = NEWTON
nl_rel_tol = 1e-10
nl_abs_tol = 1e-8
nl_max_its = 60
l_tol = 1e-4
[]
[Outputs]
exodus = true
show = 'p T vel'
execute_on = 'initial timestep_end'
velocity_as_vector = false
[]
(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
[]
[]
[Modules]
[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
value = '3.48788261470924*cos(x)'
[]
[forcing_rho]
type = ParsedFunction
value = '-3.83667087618017*eps*sin(1.1*x)'
vars = 'eps'
vals = '${eps}'
[]
[exact_rho_ud]
type = ParsedFunction
value = '3.48788261470924*eps*cos(1.1*x)'
vars = 'eps'
vals = '${eps}'
[]
[forcing_rho_ud]
type = ParsedFunction
value = '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)'
vars = 'eps'
vals = '${eps}'
[]
[exact_rho_et]
type = ParsedFunction
value = '26.7439413073546*cos(1.2*x)'
[]
[forcing_rho_et]
type = ParsedFunction
value = '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)'
vars = 'eps'
vals = '${eps}'
[]
[exact_T]
type = ParsedFunction
value = '0.0106975765229418*cos(1.2*x)/cos(x) - 0.000697576522941848*cos(1.1*x)^2/cos(x)^2'
vars = 'eps'
vals = '${eps}'
[]
[exact_p]
type = ParsedFunction
value = '3.48788261470924*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)'
vars = 'eps'
vals = '${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/thermal_hydraulics/test/tests/postprocessors/heat_rate_convection_1phase/heat_rate_convection_1phase.i)
# Gold value should be the following:
# htc * (T_wall - T) * P_hf * L
T_wall = 350
T = 300
htc = 50
P_hf = 0.3
L = 2.0
[GlobalParams]
gravity_vector = '0 0 0'
closures = simple_closures
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[left_wall]
type = SolidWall1Phase
input = 'pipe:in'
[]
[pipe]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '1 0 0'
length = ${L}
n_elems = 10
A = 1
f = 0.
initial_p = 1e6
initial_T = ${T}
initial_vel = 0
[]
[right_wall]
type = SolidWall1Phase
input = 'pipe:out'
[]
[heat_flux]
type = HeatTransferFromSpecifiedTemperature1Phase
flow_channel = pipe
Hw = ${htc}
T_wall = ${T_wall}
P_hf = ${P_hf}
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
start_time = 0.0
dt = 0.01
num_steps = 0
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 1e-6
nl_abs_tol = 1e-6
nl_max_its = 10
l_tol = 1e-3
l_max_its = 10
[]
[Postprocessors]
[heat_rate]
type = ADHeatRateConvection1Phase
P_hf = P_hf
execute_on = 'INITIAL'
[]
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/problems/square_wave/square_wave.i)
# Square wave problem
[GlobalParams]
gravity_vector = '0 0 0'
rdg_slope_reconstruction = minmod
closures = simple_closures
[]
[Functions]
[T_ic_fn]
type = PiecewiseConstant
axis = x
direction = right
x = '0.1 0.6 1.0'
y = '2.8 1.4 2.8'
[]
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 11.64024372
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp
# geometry
position = '0 0 0'
orientation = '1 0 0'
length = 1.0
n_elems = 400
A = 1.0
# IC
initial_T = T_ic_fn
initial_p = 1
initial_vel = 1
f = 0
[]
[left_boundary]
type = FreeBoundary1Phase
input = 'pipe:in'
[]
[right_boundary]
type = FreeBoundary1Phase
input = 'pipe:out'
[]
[]
[Executioner]
type = Transient
[TimeIntegrator]
type = ExplicitSSPRungeKutta
order = 2
[]
solve_type = LINEAR
l_tol = 1e-4
nl_rel_tol = 1e-20
nl_abs_tol = 1e-8
nl_max_its = 60
# run to t = 0.3
start_time = 0.0
dt = 2e-4
num_steps = 1500
abort_on_solve_fail = true
[]
[Outputs]
file_base = 'square_wave'
velocity_as_vector = false
execute_on = 'initial timestep_end'
[out]
type = Exodus
show = 'p T vel'
[]
[]
(modules/thermal_hydraulics/test/tests/output/paraview_component_annotation_map/test.i)
[GlobalParams]
initial_p = 1e5
initial_T = 300
initial_vel = 0
closures = simple_closures
f = 0
fp = fp
gravity_vector = '0 0 0'
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[HeatStructureMaterials]
[m]
type = SolidMaterialProperties
rho = 1
cp = 1
k = 1
[]
[]
[Components]
[fch1]
type = FlowChannel1Phase
position = '-0.1 0 0'
orientation = '0 0 1'
length = 1
A = 1
n_elems = 10
[]
[wall1i]
type = SolidWall1Phase
input = fch1:in
[]
[wall1o]
type = SolidWall1Phase
input = fch1:out
[]
[hs1]
type = HeatStructureCylindrical
position = '-0.2 0 0'
orientation = '0 0 1'
length = 1
n_elems = 10
names = '1 2'
widths = '0.2 0.3'
materials = 'm m'
n_part_elems = '1 1'
rotation = 90
[]
[fch2]
type = FlowChannel1Phase
position = '0.1 0 0'
orientation = '0 0 1'
length = '0.6 0.4'
A = 1
n_elems = '5 5'
axial_region_names = 'longer shorter'
[]
[wall2i]
type = SolidWall1Phase
input = fch2:in
[]
[wall2o]
type = SolidWall1Phase
input = fch2:out
[]
[hs2]
type = HeatStructureCylindrical
position = '0.2 0 0'
orientation = '0 0 1'
length = '0.6 0.4'
axial_region_names = 'longer shorter'
n_elems = '5 5'
names = '1 2'
widths = '0.2 0.3'
materials = 'm m'
n_part_elems = '1 1'
rotation = 270
[]
[]
[Executioner]
type = Transient
dt = 0.1
num_steps = 1
automatic_scaling = true
nl_abs_tol = 1e-7
[]
[Outputs]
exodus = true
[map]
type = ParaviewComponentAnnotationMap
[]
[]
(modules/thermal_hydraulics/test/tests/problems/brayton_cycle/closed_brayton_cycle.i)
# This input file is used to demonstrate a simple closed, air Brayton cycle using
# a compressor, turbine, shaft, motor, and generator.
# The flow length is divided into 6 segments as illustrated below, where
# - "(C)" denotes the compressor
# - "(T)" denotes the turbine
# - "*" denotes a fictitious junction
#
# Heated section Cooled section
# *-----(C)-----*--------------*-----(T)-----*--------------*
# 1 2 3 4 5 6
#
# Initially the fluid is at rest at ambient conditions, the shaft speed is zero,
# and no heat transfer occurs with the system.
# The transient is controlled as follows:
# * 0 - 100 s: motor ramps up torque linearly from zero
# * 100 - 200 s: motor ramps down torque linearly to zero, HTC ramps up linearly from zero.
# * 200 - 300 s: (no changes; should approach steady condition)
I_motor = 1.0
motor_torque_max = 400.0
I_generator = 1.0
generator_torque_per_shaft_speed = -0.00025
motor_ramp_up_duration = 100.0
motor_ramp_down_duration = 100.0
post_motor_time = 100.0
t1 = ${motor_ramp_up_duration}
t2 = ${fparse t1 + motor_ramp_down_duration}
t3 = ${fparse t2 + post_motor_time}
D1 = 0.15
D2 = ${D1}
D3 = ${D1}
D4 = ${D1}
D5 = ${D1}
D6 = ${D1}
A1 = ${fparse 0.25 * pi * D1^2}
A2 = ${fparse 0.25 * pi * D2^2}
A3 = ${fparse 0.25 * pi * D3^2}
A4 = ${fparse 0.25 * pi * D4^2}
A5 = ${fparse 0.25 * pi * D5^2}
A6 = ${fparse 0.25 * pi * D6^2}
L1 = 10.0
L2 = ${L1}
L3 = ${L1}
L4 = ${L1}
L5 = ${L1}
L6 = ${L1}
x1 = 0.0
x2 = ${fparse x1 + L1}
x3 = ${fparse x2 + L2}
x4 = ${fparse x3 + L3}
x5 = ${fparse x4 + L4}
x6 = ${fparse x5 + L5}
x2_minus = ${fparse x2 - 0.001}
x2_plus = ${fparse x2 + 0.001}
x5_minus = ${fparse x5 - 0.001}
x5_plus = ${fparse x5 + 0.001}
n_elems1 = 10
n_elems2 = ${n_elems1}
n_elems3 = ${n_elems1}
n_elems4 = ${n_elems1}
n_elems5 = ${n_elems1}
n_elems6 = ${n_elems1}
A_ref_comp = ${fparse 0.5 * (A1 + A2)}
V_comp = ${fparse A_ref_comp * 1.0}
I_comp = 1.0
A_ref_turb = ${fparse 0.5 * (A4 + A5)}
V_turb = ${fparse A_ref_turb * 1.0}
I_turb = 1.0
c0_rated_comp = 351.6925137
rho0_rated_comp = 1.146881112
rated_mfr = 0.25
speed_rated_rpm = 96000
speed_rated = ${fparse speed_rated_rpm * 2 * pi / 60.0}
speed_initial = 0
eff_comp = 0.79
eff_turb = 0.843
T_hot = 1000
T_cold = 300
T_ambient = 300
p_ambient = 1e5
[GlobalParams]
orientation = '1 0 0'
gravity_vector = '0 0 0'
initial_p = ${p_ambient}
initial_T = ${T_ambient}
initial_vel = 0
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
fp = fp_air
closures = closures
f = 0
scaling_factor_1phase = '1 1 1e-5'
scaling_factor_rhoV = 1
scaling_factor_rhouV = 1
scaling_factor_rhovV = 1
scaling_factor_rhowV = 1
scaling_factor_rhoEV = 1e-5
rdg_slope_reconstruction = none
[]
[Functions]
[motor_torque_fn]
type = PiecewiseLinear
x = '0 ${t1} ${t2}'
y = '0 ${motor_torque_max} 0'
[]
[motor_power_fn]
type = ParsedFunction
value = 'torque * speed'
vars = 'torque speed'
vals = 'motor_torque shaft:omega'
[]
[generator_torque_fn]
type = ParsedFunction
value = 'slope * t'
vars = 'slope'
vals = '${generator_torque_per_shaft_speed}'
[]
[generator_power_fn]
type = ParsedFunction
value = 'torque * speed'
vars = 'torque speed'
vals = 'generator_torque shaft:omega'
[]
[htc_wall_fn]
type = PiecewiseLinear
x = '0 ${t1} ${t2}'
y = '0 0 1e3'
[]
[]
[Modules/FluidProperties]
[fp_air]
type = IdealGasFluidProperties
emit_on_nan = none
[]
[]
[Closures]
[closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[shaft]
type = Shaft
connected_components = 'motor compressor turbine generator'
initial_speed = ${speed_initial}
[]
[motor]
type = ShaftConnectedMotor
inertia = ${I_motor}
torque = 0 # controlled
[]
[generator]
type = ShaftConnectedMotor
inertia = ${I_generator}
torque = generator_torque_fn
[]
[pipe1]
type = FlowChannel1Phase
position = '${x1} 0 0'
length = ${L1}
n_elems = ${n_elems1}
A = ${A1}
[]
[compressor]
type = ShaftConnectedCompressor1Phase
position = '${x2} 0 0'
inlet = 'pipe1:out'
outlet = 'pipe2:in'
A_ref = ${A_ref_comp}
volume = ${V_comp}
omega_rated = ${speed_rated}
mdot_rated = ${rated_mfr}
c0_rated = ${c0_rated_comp}
rho0_rated = ${rho0_rated_comp}
speeds = '0.5208 0.6250 0.7292 0.8333 0.9375'
Rp_functions = 'rp_comp1 rp_comp2 rp_comp3 rp_comp4 rp_comp5'
eff_functions = 'eff_comp1 eff_comp2 eff_comp3 eff_comp4 eff_comp5'
min_pressure_ratio = 1.0
speed_cr_I = 0
inertia_const = ${I_comp}
inertia_coeff = '${I_comp} 0 0 0'
# assume no shaft friction
speed_cr_fr = 0
tau_fr_const = 0
tau_fr_coeff = '0 0 0 0'
[]
[pipe2]
type = FlowChannel1Phase
position = '${x2} 0 0'
length = ${L2}
n_elems = ${n_elems2}
A = ${A2}
[]
[junction2_3]
type = JunctionOneToOne1Phase
connections = 'pipe2:out pipe3:in'
[]
[pipe3]
type = FlowChannel1Phase
position = '${x3} 0 0'
length = ${L3}
n_elems = ${n_elems3}
A = ${A3}
[]
[junction3_4]
type = JunctionOneToOne1Phase
connections = 'pipe3:out pipe4:in'
[]
[pipe4]
type = FlowChannel1Phase
position = '${x4} 0 0'
length = ${L4}
n_elems = ${n_elems4}
A = ${A4}
[]
[turbine]
type = ShaftConnectedCompressor1Phase
position = '${x5} 0 0'
inlet = 'pipe4:out'
outlet = 'pipe5:in'
A_ref = ${A_ref_turb}
volume = ${V_turb}
treat_as_turbine = true
omega_rated = ${speed_rated}
mdot_rated = ${rated_mfr}
c0_rated = ${c0_rated_comp}
rho0_rated = ${rho0_rated_comp}
speeds = '0 0.5208 0.6250 0.7292 0.8333 0.9375'
Rp_functions = 'rp_turb0 rp_turb1 rp_turb2 rp_turb3 rp_turb4 rp_turb5'
eff_functions = 'eff_turb1 eff_turb1 eff_turb2 eff_turb3 eff_turb4 eff_turb5'
min_pressure_ratio = 1.0
speed_cr_I = 0
inertia_const = ${I_turb}
inertia_coeff = '${I_turb} 0 0 0'
# assume no shaft friction
speed_cr_fr = 0
tau_fr_const = 0
tau_fr_coeff = '0 0 0 0'
[]
[pipe5]
type = FlowChannel1Phase
position = '${x5} 0 0'
length = ${L5}
n_elems = ${n_elems5}
A = ${A5}
[]
[junction5_6]
type = JunctionOneToOne1Phase
connections = 'pipe5:out pipe6:in'
[]
[pipe6]
type = FlowChannel1Phase
position = '${x6} 0 0'
length = ${L6}
n_elems = ${n_elems6}
A = ${A6}
[]
[junction6_1]
type = JunctionOneToOne1Phase
connections = 'pipe6:out pipe1:in'
[]
[heating]
type = HeatTransferFromSpecifiedTemperature1Phase
flow_channel = pipe3
T_wall = ${T_hot}
Hw = htc_wall_fn
[]
[cooling]
type = HeatTransferFromSpecifiedTemperature1Phase
flow_channel = pipe6
T_wall = ${T_cold}
Hw = htc_wall_fn
[]
[]
[ControlLogic]
[motor_ctrl]
type = TimeFunctionComponentControl
component = motor
parameter = torque
function = motor_torque_fn
[]
[]
[Postprocessors]
[heating_rate]
type = ADHeatRateConvection1Phase
block = 'pipe3'
T = T
T_wall = T_wall
Hw = Hw
P_hf = P_hf
execute_on = 'INITIAL TIMESTEP_END'
[]
[cooling_rate]
type = ADHeatRateConvection1Phase
block = 'pipe6'
T = T
T_wall = T_wall
Hw = Hw
P_hf = P_hf
execute_on = 'INITIAL TIMESTEP_END'
[]
[motor_torque]
type = RealComponentParameterValuePostprocessor
component = motor
parameter = torque
execute_on = 'INITIAL TIMESTEP_END'
[]
[motor_power]
type = FunctionValuePostprocessor
function = motor_power_fn
execute_on = 'INITIAL TIMESTEP_END'
[]
[generator_torque]
type = ShaftConnectedComponentPostprocessor
quantity = torque
shaft_connected_component_uo = generator:shaftconnected_uo
execute_on = 'INITIAL TIMESTEP_END'
[]
[generator_power]
type = FunctionValuePostprocessor
function = generator_power_fn
execute_on = 'INITIAL TIMESTEP_END'
[]
[shaft_speed]
type = ScalarVariable
variable = 'shaft:omega'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_in_comp]
type = PointValue
variable = p
point = '${x2_minus} 0 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_out_comp]
type = PointValue
variable = p
point = '${x2_plus} 0 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_ratio_comp]
type = ParsedPostprocessor
pp_names = 'p_in_comp p_out_comp'
function = 'p_out_comp / p_in_comp'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_in_turb]
type = PointValue
variable = p
point = '${x5_minus} 0 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_out_turb]
type = PointValue
variable = p
point = '${x5_plus} 0 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_ratio_turb]
type = ParsedPostprocessor
pp_names = 'p_in_turb p_out_turb'
function = 'p_in_turb / p_out_turb'
execute_on = 'INITIAL TIMESTEP_END'
[]
[mfr_comp]
type = ADFlowJunctionFlux1Phase
boundary = pipe1:out
connection_index = 0
equation = mass
junction = compressor
[]
[mfr_turb]
type = ADFlowJunctionFlux1Phase
boundary = pipe4:out
connection_index = 0
equation = mass
junction = turbine
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
end_time = ${t3}
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.01
optimal_iterations = 5
iteration_window = 1
growth_factor = 1.1
cutback_factor = 0.9
[]
dtmin = 1e-5
steady_state_detection = true
steady_state_start_time = ${t2}
solve_type = NEWTON
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 15
l_tol = 1e-4
l_max_its = 10
[]
[Outputs]
exodus = true
[csv]
type = CSV
file_base = 'closed_brayton_cycle'
execute_vector_postprocessors_on = 'INITIAL'
[]
[console]
type = Console
show = 'shaft_speed p_ratio_comp p_ratio_turb compressor:pressure_ratio turbine:pressure_ratio'
[]
[]
[Functions]
# compressor pressure ratio
[rp_comp1]
type = PiecewiseLinear
data_file = 'rp_comp1.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_comp2]
type = PiecewiseLinear
data_file = 'rp_comp2.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_comp3]
type = PiecewiseLinear
data_file = 'rp_comp3.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_comp4]
type = PiecewiseLinear
data_file = 'rp_comp4.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_comp5]
type = PiecewiseLinear
data_file = 'rp_comp5.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
# compressor efficiency
[eff_comp1]
type = ConstantFunction
value = ${eff_comp}
[]
[eff_comp2]
type = ConstantFunction
value = ${eff_comp}
[]
[eff_comp3]
type = ConstantFunction
value = ${eff_comp}
[]
[eff_comp4]
type = ConstantFunction
value = ${eff_comp}
[]
[eff_comp5]
type = ConstantFunction
value = ${eff_comp}
[]
# turbine pressure ratio
[rp_turb0]
type = ConstantFunction
value = 1
[]
[rp_turb1]
type = PiecewiseLinear
data_file = 'rp_turb1.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_turb2]
type = PiecewiseLinear
data_file = 'rp_turb2.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_turb3]
type = PiecewiseLinear
data_file = 'rp_turb3.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_turb4]
type = PiecewiseLinear
data_file = 'rp_turb4.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_turb5]
type = PiecewiseLinear
data_file = 'rp_turb5.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
# turbine efficiency
[eff_turb1]
type = ConstantFunction
value = ${eff_turb}
[]
[eff_turb2]
type = ConstantFunction
value = ${eff_turb}
[]
[eff_turb3]
type = ConstantFunction
value = ${eff_turb}
[]
[eff_turb4]
type = ConstantFunction
value = ${eff_turb}
[]
[eff_turb5]
type = ConstantFunction
value = ${eff_turb}
[]
[]
(modules/thermal_hydraulics/tutorials/single_phase_flow/04_loop.i)
T_in = 300. # K
m_dot_in = 1e-4 # kg/s
press = 1e5 # Pa
# core parameters
core_length = 1. # m
core_n_elems = 10
core_dia = ${units 2. cm -> m}
core_pitch = ${units 8.7 cm -> m}
# pipe parameters
pipe_dia = ${units 10. cm -> m}
tot_power = 100 # W
[GlobalParams]
initial_p = ${press}
initial_vel = 0
initial_T = ${T_in}
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
rdg_slope_reconstruction = full
closures = simple_closures
fp = he
f = 0.4
[]
[Modules/FluidProperties]
[he]
type = IdealGasFluidProperties
molar_mass = 4e-3
gamma = 1.67
k = 0.2556
mu = 3.22639e-5
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[HeatStructureMaterials]
[steel]
type = SolidMaterialProperties
rho = 8050
k = 45
cp = 466
[]
[]
[Components]
[total_power]
type = TotalPower
power = ${tot_power}
[]
[core_chan]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
A = ${fparse core_pitch * core_pitch - pi * core_dia * core_dia / 4.}
D_h = ${core_dia}
f = 1.6
[]
[core_hs]
type = HeatStructureCylindrical
position = '0 0 0'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
names = 'block'
widths = '${fparse core_dia / 2.}'
materials = 'steel'
n_part_elems = 3
[]
[core_heating]
type = HeatSourceFromTotalPower
hs = core_hs
regions = block
power = total_power
[]
[core_ht]
type = HeatTransferFromHeatStructure1Phase
flow_channel = core_chan
hs = core_hs
hs_side = outer
P_hf = ${fparse pi * core_dia}
Hw = 1.36
[]
[jct1]
type = JunctionParallelChannels1Phase
position = '0 0 1'
connections = 'core_chan:out up_pipe:in'
volume = 1e-3
[]
[up_pipe]
type = FlowChannel1Phase
position = '0 0 1'
orientation = '0 0 1'
length = 1
n_elems = 10
A = ${fparse pi * pipe_dia * pipe_dia / 4.}
D_h = ${pipe_dia}
[]
[jct2]
type = VolumeJunction1Phase
position = '0 0 2'
connections = 'up_pipe:out top_pipe:in'
volume = 1e-3
[]
[top_pipe]
type = FlowChannel1Phase
position = '0 0 2'
orientation = '1 0 0'
length = 1
n_elems = 10
A = ${fparse pi * pipe_dia * pipe_dia / 4.}
D_h = ${pipe_dia}
[]
[jct3]
type = VolumeJunction1Phase
position = '1 0 2'
connections = 'top_pipe:out cooling_pipe:in'
volume = 1e-3
[]
[cooling_pipe]
type = FlowChannel1Phase
position = '1 0 2'
orientation = '0 0 -1'
length = 1
n_elems = 10
A = ${fparse pi * pipe_dia * pipe_dia / 4.}
D_h = ${pipe_dia}
[]
[cold_wall]
type = HeatTransferFromSpecifiedTemperature1Phase
flow_channel = cooling_pipe
T_wall = 300
Hw = 0.97
[]
[jct4]
type = VolumeJunction1Phase
position = '1 0 1'
connections = 'cooling_pipe:out down_pipe:in'
volume = 1e-3
[]
[down_pipe]
type = FlowChannel1Phase
position = '1 0 1'
orientation = '0 0 -1'
length = 1
n_elems = 10
A = ${fparse pi * pipe_dia * pipe_dia / 4.}
D_h = ${pipe_dia}
[]
[jct5]
type = VolumeJunction1Phase
position = '1 0 0'
connections = 'down_pipe:out bottom_b:in'
volume = 1e-3
[]
[bottom_b]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '-1 0 0'
length = 0.5
n_elems = 5
A = ${fparse pi * pipe_dia * pipe_dia / 4.}
D_h = ${pipe_dia}
[]
[pump]
type = Pump1Phase
position = '0.5 0 0'
connections = 'bottom_b:out bottom_a:in'
volume = 1e-3
A_ref = ${fparse pi * pipe_dia * pipe_dia / 4.}
head = 0
[]
[bottom_a]
type = FlowChannel1Phase
position = '0.5 0 0'
orientation = '-1 0 0'
length = 0.5
n_elems = 5
A = ${fparse pi * pipe_dia * pipe_dia / 4.}
D_h = ${pipe_dia}
[]
[jct6]
type = VolumeJunction1Phase
position = '0 0 0'
connections = 'bottom_a:out core_chan:in'
volume = 1e-3
[]
[]
[ControlLogic]
[set_point]
type = GetFunctionValueControl
function = ${m_dot_in}
[]
[pid]
type = PIDControl
initial_value = 0
set_point = set_point:value
input = m_dot_pump
K_p = 250
K_i = 0.5
K_d = 0
[]
[set_pump_head]
type = SetComponentRealValueControl
component = pump
parameter = head
value = pid:output
[]
[]
[Postprocessors]
[m_dot_pump]
type = ADFlowJunctionFlux1Phase
boundary = core_chan:in
connection_index = 1
equation = mass
junction = jct6
[]
[core_T_out]
type = SideAverageValue
boundary = core_chan:out
variable = T
[]
[hx_pri_T_out]
type = SideAverageValue
boundary = cooling_pipe:out
variable = T
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 1000
dt = 10
line_search = basic
solve_type = NEWTON
nl_rel_tol = 1e-5
nl_abs_tol = 1e-5
nl_max_its = 5
[]
[Outputs]
exodus = true
[console]
type = Console
max_rows = 1
outlier_variable_norms = false
[]
print_linear_residuals = false
[]
(modules/fluid_properties/test/tests/ics/rho_vapor_mixture_from_pressure_temperature/test.i)
# Tests the initial condition for mixture density from pressure and temperature.
# This test uses the general vapor mixture fluid properties with steam, air,
# and helium with mass fractions 0.5, 0.3, and 0.2, respectively. The individual
# specific volumes (in m^3/kg) at p = 100 kPa, T = 500 K are:
# steam: 2.298113001
# air: 1.43525
# helium: 10.3855
# For the general vapor mixture, the mixture specific volume is computed as
# v = \sum\limits_i x_i v_i ,
# where x_i is the mass fraction of component i, and v_i is the specific volume
# of component i. Therefore, the correct value for specific volume of the mixture is
# v = 3.65673150050 m^3/kg
# and thus density is
# rho = 0.27346825980066236 kg/m^3
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
allow_renumbering = false
[]
[Modules]
[FluidProperties]
[fp_steam]
type = StiffenedGasFluidProperties
gamma = 1.43
cv = 1040.0
q = 2.03e6
p_inf = 0.0
q_prime = -2.3e4
k = 0.026
mu = 134.4e-7
M = 0.01801488
rho_c = 322.0
[]
[fp_air]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 28.965197004e-3
[]
[fp_helium]
type = IdealGasFluidProperties
gamma = 1.66
molar_mass = 4.002917432959e-3
[]
[fp_vapor_mixture]
type = IdealRealGasMixtureFluidProperties
fp_primary = fp_steam
fp_secondary = 'fp_air fp_helium'
[]
[]
[]
[AuxVariables]
[rho]
[]
[p]
[]
[T]
[]
[x_air]
[]
[x_helium]
[]
[]
[ICs]
[rho_ic]
type = RhoVaporMixtureFromPressureTemperatureIC
variable = rho
p = p
T = T
x_secondary_vapors = 'x_air x_helium'
fp_vapor_mixture = fp_vapor_mixture
[]
[p_ic]
type = ConstantIC
variable = p
value = 100e3
[]
[T_ic]
type = ConstantIC
variable = T
value = 500
[]
[x_air_ic]
type = ConstantIC
variable = x_air
value = 0.3
[]
[x_helium_ic]
type = ConstantIC
variable = x_helium
value = 0.2
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[rho_test]
type = ElementalVariableValue
elementid = 0
variable = rho
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Outputs]
csv = true
execute_on = 'INITIAL'
[]
[Problem]
solve = false
[]
(modules/thermal_hydraulics/test/tests/components/deprecated/junction_one_to_one.i)
[GlobalParams]
gravity_vector = '0 0 0'
closures = simple_closures
fp = fp
f = 0.0
initial_T = 300
initial_p = 1e5
initial_vel = 0
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.02897
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe1:in'
m_dot = 1
T = 300
[]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 0'
length = 0.5
n_elems = 2
A = 0.1
[]
[valve]
type = JunctionOneToOne
connections = 'pipe1:out pipe2:in'
[]
[pipe2]
type = FlowChannel1Phase
position = '0.5 0 0'
orientation = '1 0 0'
length = 0.5
n_elems = 2
A = 0.1
[]
[outlet]
type = Outlet1Phase
input = 'pipe2:out'
p = 1e5
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 20
l_tol = 1e-4
start_time = 0.0
end_time = 1.0
dt = 0.01
abort_on_solve_fail = true
[]
(modules/porous_flow/test/tests/fluids/ideal_gas.i)
# Example of using the IdealGasFluidProperties userobject to provide fluid
# properties for an ideal gas. Use values for hydrogen (H2) at 1 MPa and 50 C.
#
# Input values:
# M = 2.01588e-3 kg/mol
# gamma = 1.4
# viscosity = 9.4393e-6 Pa.s
#
# Expected output:
# density = 750.2854 kg/m^3
# internal energy = 3.33 MJ/kg
# enthalpy = 4.66 MJ/kg
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp'
number_fluid_phases = 1
number_fluid_components = 1
[]
[]
[Variables]
[pp]
initial_condition = 1e6
[]
[]
[Kernels]
[dummy]
type = Diffusion
variable = pp
[]
[]
[AuxVariables]
[temp]
initial_condition = 50.0
[]
[]
[Modules]
[FluidProperties]
[idealgas]
type = IdealGasFluidProperties
molar_mass = 2.01588e-3
gamma = 1.4
mu = 9.4393e-6
[]
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = temp
[]
[ppss]
type = PorousFlow1PhaseFullySaturated
porepressure = pp
[]
[idealgass]
type = PorousFlowSingleComponentFluid
temperature_unit = Celsius
fp = idealgas
phase = 0
[]
[]
[Executioner]
type = Steady
solve_type = Newton
[]
[Postprocessors]
[pressure]
type = ElementIntegralVariablePostprocessor
variable = pp
[]
[temperature]
type = ElementIntegralVariablePostprocessor
variable = temp
[]
[density]
type = ElementIntegralMaterialProperty
mat_prop = 'PorousFlow_fluid_phase_density_qp0'
[]
[viscosity]
type = ElementIntegralMaterialProperty
mat_prop = 'PorousFlow_viscosity_qp0'
[]
[internal_energy]
type = ElementIntegralMaterialProperty
mat_prop = 'PorousFlow_fluid_phase_internal_energy_qp0'
[]
[enthalpy]
type = ElementIntegralMaterialProperty
mat_prop = 'PorousFlow_fluid_phase_enthalpy_qp0'
[]
[]
[Outputs]
execute_on = 'timestep_end'
file_base = ideal_gas
csv = true
[]
(modules/thermal_hydraulics/tutorials/single_phase_flow/06_custom_closures.i)
T_in = 300. # K
m_dot_in = 1e-4 # kg/s
press = 1e5 # Pa
# core parameters
core_length = 1. # m
core_n_elems = 10
core_dia = ${units 2. cm -> m}
core_pitch = ${units 8.7 cm -> m}
# pipe parameters
pipe_dia = ${units 10. cm -> m}
tot_power = 100 # W
# heat exchanger parameters
hx_dia_inner = ${units 10. cm -> m}
hx_wall_thickness = ${units 5. mm -> m}
hx_dia_outer = ${units 50. cm -> m}
hx_radius_wall = ${fparse hx_dia_inner / 2. + hx_wall_thickness}
hx_length = 1 # m
hx_n_elems = 10
m_dot_sec_in = 1 # kg/s
flow_blocks = 'core_chan up_pipe top_pipe hx/pri hx/sec down_pipe bottom_b bottom_a'
ht_blocks = 'core_chan hx/pri hx/sec'
[GlobalParams]
initial_p = ${press}
initial_vel = 0
initial_T = ${T_in}
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
rdg_slope_reconstruction = full
closures = no_closures
fp = he
[]
[Functions]
[m_dot_sec_fn]
type = PiecewiseLinear
xy_data = '
0 0
100 ${m_dot_sec_in}'
[]
[]
[Materials]
[f_mat]
type = ADWallFrictionChurchillMaterial
block = ${flow_blocks}
D_h = D_h
f_D = f_D
mu = mu
rho = rho
vel = vel
[]
[Hw_mat]
type = ADWallHeatTransferCoefficient3EqnDittusBoelterMaterial
block = ${ht_blocks}
D_h = D_h
rho = rho
vel = vel
T = T
T_wall = T_wall
cp = cp
mu = mu
k = k
[]
[]
[Modules/FluidProperties]
[he]
type = IdealGasFluidProperties
molar_mass = 4e-3
gamma = 1.67
k = 0.2556
mu = 3.22639e-5
[]
[water]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[no_closures]
type = Closures1PhaseNone
[]
[]
[HeatStructureMaterials]
[steel]
type = SolidMaterialProperties
rho = 8050
k = 45
cp = 466
[]
[]
[Components]
[total_power]
type = TotalPower
power = ${tot_power}
[]
[core_chan]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
A = ${fparse core_pitch * core_pitch - pi * core_dia * core_dia / 4.}
D_h = ${core_dia}
[]
[core_hs]
type = HeatStructureCylindrical
position = '0 0 0'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
names = 'block'
widths = '${fparse core_dia / 2.}'
materials = 'steel'
n_part_elems = 3
[]
[core_heating]
type = HeatSourceFromTotalPower
hs = core_hs
regions = block
power = total_power
[]
[core_ht]
type = HeatTransferFromHeatStructure1Phase
flow_channel = core_chan
hs = core_hs
hs_side = outer
P_hf = ${fparse pi * core_dia}
[]
[jct1]
type = JunctionParallelChannels1Phase
position = '0 0 1'
connections = 'core_chan:out up_pipe:in'
volume = 1e-3
[]
[up_pipe]
type = FlowChannel1Phase
position = '0 0 1'
orientation = '0 0 1'
length = 1
n_elems = 10
A = ${fparse pi * pipe_dia * pipe_dia / 4.}
D_h = ${pipe_dia}
[]
[jct2]
type = VolumeJunction1Phase
position = '0 0 2'
connections = 'up_pipe:out top_pipe:in'
volume = 1e-3
[]
[top_pipe]
type = FlowChannel1Phase
position = '0 0 2'
orientation = '1 0 0'
length = 1
n_elems = 10
A = ${fparse pi * pipe_dia * pipe_dia / 4.}
D_h = ${pipe_dia}
[]
[jct3]
type = VolumeJunction1Phase
position = '1 0 2'
connections = 'top_pipe:out hx/pri:in'
volume = 1e-3
[]
[hx]
[pri]
type = FlowChannel1Phase
position = '1 0 2'
orientation = '0 0 -1'
length = ${hx_length}
n_elems = ${hx_n_elems}
A = ${fparse pi * hx_dia_inner * hx_dia_inner / 4.}
D_h = ${hx_dia_inner}
[]
[ht_pri]
type = HeatTransferFromHeatStructure1Phase
hs = hx/wall
hs_side = inner
flow_channel = hx/pri
[]
[wall]
type = HeatStructureCylindrical
position = '1 0 2'
orientation = '0 0 -1'
length = ${hx_length}
n_elems = ${hx_n_elems}
widths = '${hx_wall_thickness}'
n_part_elems = '3'
materials = 'steel'
names = '0'
inner_radius = ${fparse hx_dia_inner / 2.}
[]
[ht_sec]
type = HeatTransferFromHeatStructure1Phase
hs = hx/wall
hs_side = outer
flow_channel = hx/sec
P_hf = ${fparse 2 * pi * hx_radius_wall}
[]
[sec]
type = FlowChannel1Phase
position = '${fparse 1 + hx_wall_thickness} 0 2'
orientation = '0 0 -1'
length = ${hx_length}
n_elems = ${hx_n_elems}
A = ${fparse pi * (hx_dia_outer * hx_dia_outer / 4. - hx_radius_wall * hx_radius_wall)}
D_h = ${fparse hx_dia_outer - (2 * hx_radius_wall)}
fp = water
[]
[]
[jct4]
type = VolumeJunction1Phase
position = '1 0 1'
connections = 'hx/pri:out down_pipe:in'
volume = 1e-3
[]
[down_pipe]
type = FlowChannel1Phase
position = '1 0 1'
orientation = '0 0 -1'
length = 1
n_elems = 10
A = ${fparse pi * pipe_dia * pipe_dia / 4.}
D_h = ${pipe_dia}
[]
[jct5]
type = VolumeJunction1Phase
position = '1 0 0'
connections = 'down_pipe:out bottom_b:in'
volume = 1e-3
[]
[bottom_b]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '-1 0 0'
length = 0.5
n_elems = 5
A = ${fparse pi * pipe_dia * pipe_dia / 4.}
D_h = ${pipe_dia}
[]
[pump]
type = Pump1Phase
position = '0.5 0 0'
connections = 'bottom_b:out bottom_a:in'
volume = 1e-3
A_ref = ${fparse pi * pipe_dia * pipe_dia / 4.}
head = 0
[]
[bottom_a]
type = FlowChannel1Phase
position = '0.5 0 0'
orientation = '-1 0 0'
length = 0.5
n_elems = 5
A = ${fparse pi * pipe_dia * pipe_dia / 4.}
D_h = ${pipe_dia}
[]
[jct6]
type = VolumeJunction1Phase
position = '0 0 0'
connections = 'bottom_a:out core_chan:in'
volume = 1e-3
[]
[inlet_sec]
type = InletMassFlowRateTemperature1Phase
input = 'hx/sec:out'
m_dot = 0
T = 300
[]
[outlet_sec]
type = Outlet1Phase
input = 'hx/sec:in'
p = ${press}
[]
[]
[ControlLogic]
[set_point]
type = GetFunctionValueControl
function = ${m_dot_in}
[]
[pid]
type = PIDControl
initial_value = 0
set_point = set_point:value
input = m_dot_pump
K_p = 250
K_i = 0.5
K_d = 0
[]
[set_pump_head]
type = SetComponentRealValueControl
component = pump
parameter = head
value = pid:output
[]
[m_dot_sec_inlet_ctrl]
type = GetFunctionValueControl
function = m_dot_sec_fn
[]
[set_m_dot_sec_ctrl]
type = SetComponentRealValueControl
component = inlet_sec
parameter = m_dot
value = m_dot_sec_inlet_ctrl:value
[]
[]
[Postprocessors]
[m_dot_pump]
type = ADFlowJunctionFlux1Phase
boundary = core_chan:in
connection_index = 1
equation = mass
junction = jct6
[]
[core_T_out]
type = SideAverageValue
boundary = core_chan:out
variable = T
[]
[hx_pri_T_out]
type = SideAverageValue
boundary = hx/pri:out
variable = T
[]
[hx_sec_T_in]
type = SideAverageValue
boundary = inlet_sec
variable = T
[]
[hx_sec_T_out]
type = SideAverageValue
boundary = outlet_sec
variable = T
[]
[]
[Executioner]
type = Transient
start_time = 0
[TimeStepper]
type = SolutionTimeAdaptiveDT
dt = 1
[]
dtmax = 100
end_time = 50000
line_search = basic
solve_type = NEWTON
nl_rel_tol = 1e-5
nl_abs_tol = 1e-5
nl_max_its = 5
[]
[Outputs]
exodus = true
[console]
type = Console
max_rows = 1
outlier_variable_norms = false
[]
print_linear_residuals = false
[]
(modules/thermal_hydraulics/test/tests/components/junction_one_to_one_1phase/junction_one_to_one_1phase.i)
# This input file simulates the Sod shock tube using a junction in the middle
# of the domain. The solution should be exactly equivalent to the problem with
# no junction. This test examines the solutions at the junction connections
# and compares them to gold values generated from a version of this input file
# that has no junction.
[GlobalParams]
gravity_vector = '0 0 0'
closures = simple_closures
[]
[Functions]
[p_ic_fn]
type = PiecewiseConstant
axis = x
direction = right
x = '0.5 1.0'
y = '1.0 0.1'
[]
[T_ic_fn]
type = PiecewiseConstant
axis = x
direction = right
x = '0.5 1.0'
y = '1.4 1.12'
[]
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 11.64024372
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[left_boundary]
type = FreeBoundary1Phase
input = 'left_channel:in'
[]
[left_channel]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '1 0 0'
length = 0.5
n_elems = 50
A = 1.0
initial_T = T_ic_fn
initial_p = p_ic_fn
initial_vel = 0
f = 0
[]
[junction]
type = JunctionOneToOne1Phase
connections = 'left_channel:out right_channel:in'
[]
[right_channel]
type = FlowChannel1Phase
fp = fp
position = '0.5 0 0'
orientation = '1 0 0'
length = 0.5
n_elems = 50
A = 1.0
initial_T = T_ic_fn
initial_p = p_ic_fn
initial_vel = 0
f = 0
[]
[right_boundary]
type = FreeBoundary1Phase
input = 'right_channel:out'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
nl_rel_tol = 1e-10
nl_abs_tol = 1e-8
nl_max_its = 60
l_tol = 1e-4
start_time = 0.0
dt = 1e-3
num_steps = 5
abort_on_solve_fail = true
[]
[Postprocessors]
[rhoA_left]
type = SideAverageValue
variable = rhoA
boundary = left_channel:out
execute_on = 'initial timestep_end'
[]
[rhouA_left]
type = SideAverageValue
variable = rhouA
boundary = left_channel:out
execute_on = 'initial timestep_end'
[]
[rhoEA_left]
type = SideAverageValue
variable = rhoEA
boundary = left_channel:out
execute_on = 'initial timestep_end'
[]
[rhoA_right]
type = SideAverageValue
variable = rhoA
boundary = right_channel:in
execute_on = 'initial timestep_end'
[]
# rhouA_right is added by tests file
[rhoEA_right]
type = SideAverageValue
variable = rhoEA
boundary = right_channel:in
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
csv = true
show = 'rhoA_left rhouA_left rhoEA_left rhoA_right rhouA_right rhoEA_right'
execute_on = 'initial 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
[]
[]
[Modules]
[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
value_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/implicit_bcs/hllc_sod_shocktube.i)
rho_left = 1
E_left = 2.501505578
u_left = 1e-15
rho_right = 0.125
E_right = 1.999770935
u_right = 1e-15
middle = 0.5
[GlobalParams]
fp = fp
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${fparse 2 * middle}
nx = 5
ymin = 0
ymax = 1
ny = 2
[]
[]
[Modules]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
allow_imperfect_jacobians = true
[]
[]
[]
[Variables]
[rho]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[rho_u]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[rho_v]
order = CONSTANT
family = MONOMIAL
fv = true
initial_condition = 1e-10
[]
[rho_E]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[FVKernels]
[mass_time]
type = FVTimeKernel
variable = rho
[]
[mass_advection]
type = CNSFVMassHLLC
variable = rho
[]
[momentum_x_time]
type = FVTimeKernel
variable = rho_u
[]
[momentum_x_advection]
type = CNSFVMomentumHLLC
variable = rho_u
momentum_component = x
[]
[momentum_y_time]
type = FVTimeKernel
variable = rho_v
[]
[momentum_y_advection]
type = CNSFVMomentumHLLC
variable = rho_v
momentum_component = y
[]
[fluid_energy_time]
type = FVTimeKernel
variable = rho_E
[]
[fluid_energy_advection]
type = CNSFVFluidEnergyHLLC
variable = rho_E
[]
[]
[FVBCs]
[mass_implicit]
type = CNSFVHLLCMassImplicitBC
variable = rho
fp = fp
boundary = 'left right'
[]
[mom_x_implicit]
type = CNSFVHLLCMomentumImplicitBC
variable = rho_u
momentum_component = x
fp = fp
boundary = 'left right'
[]
[wall]
type = CNSFVMomImplicitPressureBC
variable = rho_v
momentum_component = y
boundary = 'top bottom'
[]
[fluid_energy_implicit]
type = CNSFVHLLCFluidEnergyImplicitBC
variable = rho_E
fp = fp
boundary = 'left right'
[]
[]
[ICs]
[rho_ic]
type = FunctionIC
variable = rho
function = 'if (x < ${middle}, ${rho_left}, ${rho_right})'
[]
[rho_u_ic]
type = FunctionIC
variable = rho_u
function = 'if (x < ${middle}, ${fparse rho_left * u_left}, ${fparse rho_right * u_right})'
[]
[rho_E_ic]
type = FunctionIC
variable = rho_E
function = 'if (x < ${middle}, ${fparse E_left * rho_left}, ${fparse E_right * rho_right})'
[]
[]
[Materials]
[var_mat]
type = ConservedVarValuesMaterial
rho = rho
rhou = rho_u
rhov = rho_v
rho_et = rho_E
fp = fp
[]
[]
[Executioner]
type = Transient
[TimeIntegrator]
type = ExplicitSSPRungeKutta
order = 2
[]
l_tol = 1e-8
# run to t = 0.15
start_time = 0.0
dt = 1e-1
end_time = 10
abort_on_solve_fail = true
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/userobject/HLLC/hllc_uo_2D_tri.i)
rho_left = 1.162633159
E_left = 2.1502913276e+05
v_left = 40
rho_right = 1.116127833
E_right = 1.7919094397e+05
v_right = 50
[Mesh]
[./cartesian]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 2
nx = 1
ny = 1
elem_type = 'TRI3'
[../]
[]
[Modules]
[./FluidProperties]
[./fp]
type = IdealGasFluidProperties
allow_imperfect_jacobians = true
[../]
[../]
[]
[Problem]
kernel_coverage_check = false
[]
[Variables]
[./rho]
order = CONSTANT
family = MONOMIAL
[../]
[./rho_v]
order = CONSTANT
family = MONOMIAL
[../]
[./rho_E]
order = CONSTANT
family = MONOMIAL
[../]
[]
[ICs]
[./rho_ic]
type = FunctionIC
variable = rho
function = 'if (y / (2 * x) < 0.5, ${rho_left}, ${rho_right})'
[../]
[./rho_v_ic]
type = FunctionIC
variable = rho_v
function = 'if (y / (2 * x) < 0.5, ${fparse rho_left * v_left}, ${fparse rho_right * v_right})'
[../]
[./rho_E_ic]
type = FunctionIC
variable = rho_E
function = 'if (y / (2 * x) < 0.5, ${fparse E_left * rho_left}, ${fparse E_right * rho_right})'
[../]
[]
[Materials]
[./var_mat]
type = ConservedVarValuesMaterial
rho = rho
rhou = 0
rhov = rho_v
rho_et = rho_E
fp = fp
[../]
[]
[UserObjects]
[./hllc]
type = HLLCUserObject
fp = fp
[../]
[]
[VectorPostprocessors]
[./wave_speeds]
type = WaveSpeedVPP
hllc_uo = hllc
elem_id = 0
side_id = 2
[../]
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
exodus = true
[]
(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
[]
[]
[Modules]
[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
[]
(modules/porous_flow/test/tests/jacobian/esbc02.i)
# Tests the Jacobian of PorousFlowEnthalpySink when pressure
[Mesh]
type = GeneratedMesh
dim = 2
[]
[GlobalParams]
PorousFlowDictator = dictator
at_nodes = true
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp temp'
number_fluid_phases = 1
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureConst
pc = 0.1
[]
[]
[Variables]
[pp]
initial_condition = 1
[]
[temp]
initial_condition = 2
[]
[]
[AuxVariables]
[pressure]
[]
[]
[Kernels]
[mass0]
type = TimeDerivative
variable = pp
[]
[heat_conduction]
type = TimeDerivative
variable = temp
[]
[]
[Modules]
[FluidProperties]
[simple_fluid]
type = IdealGasFluidProperties
[]
[]
[]
[Materials]
[ppss]
type = PorousFlow1PhaseFullySaturated
porepressure = pp
[]
[simple_fluid]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[temperature]
type = PorousFlowTemperature
temperature = temp
[]
[]
[BCs]
[left]
type = PorousFlowEnthalpySink
variable = temp
boundary = left
porepressure_var = pressure
T_in = 300
fp = simple_fluid
flux_function = -23
[]
[]
[Preconditioning]
[andy]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 0.1
num_steps = 1
nl_rel_tol = 1E-12
nl_abs_tol = 1E-12
petsc_options_iname = '-snes_test_err'
petsc_options_value = '1e-1'
[]
(modules/fluid_properties/test/tests/functions/saturation_pressure_function/saturation_pressure_function.i)
# TestTwoPhaseFluidProperties has the following saturation pressure function:
# p_sat(p) = 3 T
# Thus for T = 5, p_sat should be 15.
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[Modules]
[./FluidProperties]
[./fp_liquid]
type = IdealGasFluidProperties
[../]
[./fp_vapor]
type = IdealGasFluidProperties
[../]
[./fp_2phase]
type = TestTwoPhaseFluidProperties
fp_liquid = fp_liquid
fp_vapor = fp_vapor
[../]
[]
[]
[Functions]
[./T]
type = ConstantFunction
value = 5
[../]
[./p_sat]
type = SaturationPressureFunction
T = T
fp_2phase = fp_2phase
[../]
[]
[Postprocessors]
[./p_sat_pp]
type = FunctionValuePostprocessor
function = p_sat
execute_on = 'INITIAL'
[../]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(modules/fluid_properties/test/tests/fp_interrogator/1ph.p_T.i)
[FluidPropertiesInterrogator]
fp = fp
p = 1e5
T = 300
[]
[Modules]
[./FluidProperties]
[./fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.02900055737704918
mu = 1.823e-05
k = 0.02568
[../]
[../]
[]
(modules/fluid_properties/test/tests/fp_interrogator/vapor_mixture_rho_e.i)
[FluidPropertiesInterrogator]
fp = fp_vapor_mix
rho = 1.1870052372064208
e = 2477165.9033225174
x_ncg = '0.1'
[]
[Modules]
[./FluidProperties]
[./fp_nitrogen]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.02867055103448276
[../]
[./fp_primary]
type = IdealGasFluidProperties
gamma = 1.3
molar_mass = 0.027714866
T_c = 126.19
rho_c = 313.189812
[../]
[./fp_vapor_mix]
type = IdealRealGasMixtureFluidProperties
fp_primary = fp_primary
fp_secondary = 'fp_nitrogen'
[../]
[../]
[]
(modules/fluid_properties/fp_interrogator/fp_interrogator.i)
# The parameters in this block are used to specify the thermodynamic state
# at which to query the fluid properties package
[FluidPropertiesInterrogator]
fp = fp
p = 1e5
T = 300
vel = 10
[]
# The fluid properties (equation of state) to query is defined here
[Modules]
[./FluidProperties]
[./fp]
type = IdealGasFluidProperties
[../]
[../]
[]
(modules/thermal_hydraulics/test/tests/problems/super_sonic_tube/test.i)
[GlobalParams]
gravity_vector = '0 0 0'
scaling_factor_1phase = '1 1e-2 1e-4'
initial_p = 101325
initial_T = 300
initial_vel = 522.676
closures = simple_closures
spatial_discretization = cg
[]
[Modules/FluidProperties]
[ig]
type = IdealGasFluidProperties
gamma = 1.41
molar_mass = 0.028966206103678928
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = ig
# geometry
position = '0 0 0'
orientation = '1 0 0'
A = 1.
D_h = 1.12837916709551
f = 0.0
length = 1
n_elems = 100
[]
[inlet]
type = SupersonicInlet
input = 'pipe:in'
p = 101325
T = 300.0
vel = 522.676
[]
[outlet]
type = FreeBoundary1Phase
input = 'pipe:out'
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 1e-5
num_steps = 10
abort_on_solve_fail = true
solve_type = 'PJFNK'
nl_rel_tol = 1e-9
nl_abs_tol = 1e-8
nl_max_its = 30
l_tol = 1e-3
l_max_its = 100
[Quadrature]
type = TRAP
order = FIRST
[]
[]
[Outputs]
[out]
type = Exodus
[]
[]
(modules/thermal_hydraulics/test/tests/postprocessors/specific_impulse_1phase/Isp_1ph.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = 6e6
initial_T = 600
initial_vel = 0
scaling_factor_1phase = '1 1 1e-5'
closures = simple_closures
[]
[Modules/FluidProperties]
[eos]
type = IdealGasFluidProperties
gamma = 1.3066
molar_mass = 2.016e-3
k = 0.437
mu = 3e-5
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
fp = eos
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 10
A = 0.1
f = 0.
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
m_dot = 0.1
T = 800
input = 'pipe1:in'
[]
[outlet]
type = Outlet1Phase
input = 'pipe1:out'
p = 6e6
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.01
growth_factor = 1.4
optimal_iterations = 6
iteration_window = 2
[]
start_time = 0.0
end_time = 100
abort_on_solve_fail = true
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-6
nl_abs_tol = 1e-6
nl_max_its = 10
l_tol = 1e-3
l_max_its = 10
[]
[Postprocessors]
# hand calcs show that Isp should start at 274.3 at 600 K
# and rise to 316.7 at 800 K.
[Isp]
type = ADSpecificImpulse1Phase
p_exit = 1e6
fp = eos
boundary = outlet
[]
[Isp_inst]
type = ADSpecificImpulse1Phase
p_exit = 1e6
fp = eos
cumulative = false
boundary = outlet
[]
[outletT]
type = SideAverageValue
variable = T
boundary = pipe1:out
[]
[]
[Outputs]
[out]
type = CSV
show = 'Isp Isp_inst'
execute_on = 'INITIAL FINAL'
[]
[]
(modules/thermal_hydraulics/test/tests/components/shaft_connected_compressor_1phase/shaft_motor_compressor.i)
area = 0.2359
dt = 1.e-3
[GlobalParams]
initial_p = 1e5
initial_T = 288
initial_vel = 60
initial_vel_x = 60
initial_vel_y = 0
initial_vel_z = 0
A = ${area}
A_ref = ${area}
f = 100
scaling_factor_1phase = '0.04 0.04 0.04e-5'
closures = simple_closures
fp = fp
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[compressor]
type = ShaftConnectedCompressor1Phase
inlet = 'pipe:out'
outlet = 'pipe:in'
position = '0 0 0'
scaling_factor_rhoEV = 1e-5
volume = ${fparse area*0.45}
inertia_coeff = '1 1 1 1'
inertia_const = 1.61397
speed_cr_I = 1e12
speed_cr_fr = 0
tau_fr_coeff = '0 0 0 0'
tau_fr_const = 0
omega_rated = 200
mdot_rated = 21.74
rho0_rated = 1.1812
c0_rated = 340
speeds = '0.0 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 2'
Rp_functions = 'Rp00 Rp04 Rp05 Rp06 Rp07 Rp08 Rp09 Rp10 Rp11 Rp11'
eff_functions = 'eff00 eff04 eff05 eff06 eff07 eff08 eff09 eff10 eff11 eff11'
[]
[pipe]
type = FlowChannel1Phase
position = '0.1 0 0'
orientation = '1 0 0'
length = 10
n_elems = 20
[]
[motor]
type = ShaftConnectedMotor
inertia = 1e2
torque = 100
[]
[shaft]
type = Shaft
connected_components = 'motor compressor'
initial_speed = 100
[]
[]
[Functions]
[Rp00]
type = PiecewiseLinear
x = '0 0.3736 0.4216'
y = '1 0.9701 0.9619'
[]
[eff00]
type = PiecewiseLinear
x = '0 0.3736 0.4216'
y = '0.001 0.8941 0.6641'
[]
[Rp04]
type = PiecewiseLinear
x = '0.3736 0.3745 0.3753 0.3762 0.3770 0.3919 0.4067 0.4216 0.4826'
y = '1.0789 1.0779 1.0771 1.0759 1.0749 1.0570 1.0388 1.0204 0.9450'
[]
[eff04]
type = PiecewiseLinear
x = '0.3736 0.3745 0.3753 0.3762 0.3770 0.3919 0.4067 0.4216 0.4826'
y = '0.8941 0.8929 0.8925 0.8915 0.8901 0.8601 0.7986 0.6641 0.1115'
[]
[Rp05]
type = PiecewiseLinear
x = '0.3736 0.4026 0.4106 0.4186 0.4266 0.4346 0.4426 0.4506 0.4586 0.4666 0.4746 0.4826 0.5941'
y = '1.2898 1.2442 1.2316 1.2189 1.2066 1.1930 1.1804 1.1677 1.1542 1.1413 1.1279 1.1150 0.9357'
[]
[eff05]
type = PiecewiseLinear
x = '0.3736 0.4026 0.4106 0.4186 0.4266 0.4346 0.4426 0.4506 0.4586 0.4666 0.4746 0.4826 0.5941'
y = '0.9281 0.9263 0.9258 0.9244 0.9226 0.9211 0.9195 0.9162 0.9116 0.9062 0.8995 0.8914 0.7793'
[]
[Rp06]
type = PiecewiseLinear
x = '0.4026 0.4613 0.4723 0.4834 0.4945 0.5055 0.5166 0.5277 0.5387 0.5609 0.5719 0.583 0.5941 0.7124'
y = '1.5533 1.4438 1.4232 1.4011 1.3793 1.3589 1.3354 1.3100 1.2867 1.2376 1.2131 1.1887 1.1636 0.896'
[]
[eff06]
type = PiecewiseLinear
x = '0.4026 0.4613 0.4723 0.4834 0.4945 0.5055 0.5166 0.5277 0.5387 0.5609 0.5719 0.583 0.5941 0.7124'
y = '0.9148 0.9255 0.9275 0.9277 0.9282 0.9295 0.9290 0.9269 0.9242 0.9146 0.9080 0.900 0.8920 0.8061'
[]
[Rp07]
type = PiecewiseLinear
x = '0.4613 0.5447 0.5587 0.5726 0.5866 0.6006 0.6145 0.6285 0.6425 0.6565 0.6704 0.6844 0.6984 0.7124 0.8358'
y = '1.8740 1.6857 1.6541 1.6168 1.5811 1.5430 1.5067 1.4684 1.4292 1.3891 1.3479 1.3061 1.2628 1.2208 0.8498'
[]
[eff07]
type = PiecewiseLinear
x = '0.4613 0.5447 0.5587 0.5726 0.5866 0.6006 0.6145 0.6285 0.6425 0.6565 0.6704 0.6844 0.6984 0.7124 0.8358'
y = '0.9004 0.9232 0.9270 0.9294 0.9298 0.9312 0.9310 0.9290 0.9264 0.9225 0.9191 0.9128 0.9030 0.8904 0.7789'
[]
[Rp08]
type = PiecewiseLinear
x = '0.5447 0.6638 0.6810 0.6982 0.7154 0.7326 0.7498 0.7670 0.7842 0.8014 0.8186 0.8358 0.9702'
y = '2.3005 1.9270 1.8732 1.8195 1.7600 1.7010 1.6357 1.5697 1.5019 1.4327 1.3638 1.2925 0.7347'
[]
[eff08]
type = PiecewiseLinear
x = '0.5447 0.6638 0.6810 0.6982 0.7154 0.7326 0.7498 0.7670 0.7842 0.8014 0.8186 0.8358 0.9702'
y = '0.9102 0.9276 0.9301 0.9313 0.9319 0.9318 0.9293 0.9256 0.9231 0.9153 0.9040 0.8933 0.8098'
[]
[Rp09]
type = PiecewiseLinear
x = '0.6638 0.7762 0.7938 0.8115 0.8291 0.8467 0.8644 0.8820 0.8997 0.9173 0.9349 0.9526 0.9702 1.1107 1.25120'
y = '2.6895 2.2892 2.2263 2.1611 2.0887 2.0061 1.9211 1.8302 1.7409 1.6482 1.5593 1.4612 1.3586 0.5422 -0.2742'
[]
[eff09]
type = PiecewiseLinear
x = '0.6638 0.7762 0.7938 0.8115 0.8291 0.8467 0.8644 0.8820 0.8997 0.9173 0.9349 0.9526 0.9702 1.1107 1.2512'
y = '0.8961 0.9243 0.9288 0.9323 0.9330 0.9325 0.9319 0.9284 0.9254 0.9215 0.9134 0.9051 0.8864 0.7380 0.5896'
[]
[Rp10]
type = PiecewiseLinear
x = '0.7762 0.9255 0.9284 0.9461 0.9546 0.9816 0.9968 1.0170 1.039 1.0525 1.0812 1.0880 1.1056 1.1107 1.2511'
y = '3.3162 2.6391 2.6261 2.5425 2.5000 2.3469 2.2521 2.1211 1.974 1.8806 1.6701 1.6169 1.4710 1.4257 0.1817'
[]
[eff10]
type = PiecewiseLinear
x = '0.7762 0.9255 0.9284 0.9461 0.9546 0.9816 0.9968 1.0170 1.0390 1.0525 1.0812 1.0880 1.1056 1.1107 1.2511'
y = '0.8991 0.9276 0.9281 0.9308 0.9317 0.9329 0.9318 0.9291 0.9252 0.9223 0.9116 0.9072 0.8913 0.8844 0.6937'
[]
[Rp11]
type = PiecewiseLinear
x = '0.9255 1.0749 1.134 1.2511'
y = '3.9586 2.9889 2.605 1.4928'
[]
[eff11]
type = PiecewiseLinear
x = '0.9255 1.0749 1.1340 1.2511'
y = '0.9257 0.9308 0.9328 0.8823'
[]
[S_energy_fcn]
type = ParsedFunction
value = '-(tau_isen+tau_diss)*omega'
vars = 'tau_isen tau_diss omega'
vals = 'compressor:isentropic_torque compressor:dissipation_torque shaft:omega'
[]
[energy_conservation_fcn]
type = ParsedFunction
value = '(E_change - S_energy * dt) / E_tot'
vars = 'E_change S_energy dt E_tot'
vals = 'E_change S_energy ${dt} E_tot'
[]
[]
[Postprocessors]
# mass conservation
[mass_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoA
block = 'pipe'
execute_on = 'initial timestep_end'
[]
[mass_compressor]
type = ScalarVariable
variable = compressor:rhoV
execute_on = 'initial timestep_end'
[]
[mass_tot]
type = SumPostprocessor
values = 'mass_pipes mass_compressor'
execute_on = 'initial timestep_end'
[]
[mass_conservation]
type = ChangeOverTimePostprocessor
postprocessor = mass_tot
change_with_respect_to_initial = true
compute_relative_change = true
execute_on = 'initial timestep_end'
[]
# energy conservation
[E_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoEA
block = 'pipe'
execute_on = 'initial timestep_end'
[]
[E_compressor]
type = ScalarVariable
variable = compressor:rhoEV
execute_on = 'initial timestep_end'
[]
[E_tot]
type = LinearCombinationPostprocessor
pp_coefs = '1 1'
pp_names = 'E_pipes E_compressor'
execute_on = 'initial timestep_end'
[]
[S_energy]
type = FunctionValuePostprocessor
function = S_energy_fcn
execute_on = 'initial timestep_end'
[]
[E_change]
type = ChangeOverTimePostprocessor
postprocessor = E_tot
execute_on = 'initial timestep_end'
[]
# This should also execute on initial. This value is
# lagged by one timestep as a workaround to moose issue #13262.
[energy_conservation]
type = FunctionValuePostprocessor
function = energy_conservation_fcn
execute_on = 'timestep_end'
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'implicit-euler'
dt = ${dt}
num_steps = 6
solve_type = 'NEWTON'
line_search = 'basic'
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-6
nl_max_its = 15
l_tol = 1e-4
l_max_its = 10
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Outputs]
velocity_as_vector = false
[]
(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
[]
[]
[Modules]
[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
value = '3.48788261470924*cos(x)'
[]
[forcing_rho]
type = ParsedFunction
value = '-3.45300378856215*sin(1.1*x)'
[]
[exact_rho_ud]
type = ParsedFunction
value = '3.13909435323832*cos(1.1*x)'
[]
[forcing_rho_ud]
type = ParsedFunction
value = '-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
value = '26.7439413073546*cos(1.2*x)'
[]
[forcing_rho_et]
type = ParsedFunction
value = '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
value = '0.0106975765229418*cos(1.2*x)/cos(x) - 0.000697576522941848*cos(1.1*x)^2/cos(x)^2'
[]
[exact_eps_p]
type = ParsedFunction
value = '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
value = '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
value = '0.9*cos(1.1*x)/cos(x)'
[]
[exact_superficial_velocity]
type = ParsedVectorFunction
value_x = '0.9*cos(1.1*x)/cos(x)'
[]
[eps]
type = ParsedFunction
value = '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'
[]
[]
(modules/thermal_hydraulics/test/tests/jacobians/scalarkernels/volume_junction_advection_scalar_kernel/1phase.i)
[JacobianTestGeneral]
variable_names = 'rhoA rhouA rhoEA'
variable_values = '1.8 0.3 3.2'
scalar_variable_names = 'rhoV rhouV rhovV rhowV rhoEV'
scalar_variable_values = '1.2 0.2 0.5 0.8 2.9'
aux_variable_names = 'A_elem A_linear'
aux_variable_values = '1.1 1.2'
snes_test_err = 1e-7
generate_mesh = false
[]
[Mesh]
file = ../../meshes/skew_2channel_1elem.e
construct_side_list_from_node_list = true
[]
[ScalarKernels]
[scalar_kernel]
type = ADVolumeJunctionAdvectionScalarKernel
variable = rhoV
equation_index = 0
volume_junction_uo = volume_junction_uo
[]
[]
[Materials]
[direction_mat]
type = DirectionMaterial
[]
[]
[UserObjects]
[numerical_flux1]
type = ADNumericalFlux3EqnCentered
fluid_properties = fp
execute_on = 'initial linear nonlinear'
[]
[numerical_flux2]
type = ADNumericalFlux3EqnCentered
fluid_properties = fp
execute_on = 'initial linear nonlinear'
[]
[volume_junction_uo]
type = ADVolumeJunction1PhaseUserObject
volume = 0.3
A = A_elem
rhoA = rhoA
rhouA = rhouA
rhoEA = rhoEA
rhoV = rhoV
rhouV = rhouV
rhovV = rhovV
rhowV = rhowV
rhoEV = rhoEV
fp = fp
boundary = '1 3'
normals = '-1 -1'
K = 2
A_ref = 1.1
numerical_flux_names = 'numerical_flux1 numerical_flux2'
execute_on = 'initial linear nonlinear'
[]
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 28.67055e-3
[]
[]
(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
[]
[]
[Modules]
[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
value_x = '0'
value_y = '${sup_mom_y_in}'
[]
[eps]
type = ParsedFunction
value = '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/porous_flow/test/tests/jacobian/esbc01.i)
# Tests the Jacobian of PorousFlowEnthalpySink when pore pressure is specified
[Mesh]
type = GeneratedMesh
dim = 2
[]
[GlobalParams]
PorousFlowDictator = dictator
at_nodes = true
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp temp'
number_fluid_phases = 1
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureConst
pc = 0.1
[]
[]
[Variables]
[pp]
initial_condition = 1
[]
[temp]
initial_condition = 2
[]
[]
[Kernels]
[mass0]
type = TimeDerivative
variable = pp
[]
[heat_conduction]
type = TimeDerivative
variable = temp
[]
[]
[Modules]
[FluidProperties]
[simple_fluid]
type = IdealGasFluidProperties
[]
[]
[]
[Materials]
[ppss]
type = PorousFlow1PhaseFullySaturated
porepressure = pp
[]
[simple_fluid]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[temperature]
type = PorousFlowTemperature
temperature = temp
[]
[]
[BCs]
[left]
type = PorousFlowEnthalpySink
variable = temp
boundary = left
fluid_phase = 0
T_in = 300
fp = simple_fluid
flux_function = -23
[]
[]
[Preconditioning]
[andy]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 0.1
num_steps = 1
nl_rel_tol = 1E-12
nl_abs_tol = 1E-12
petsc_options_iname = '-snes_test_err'
petsc_options_value = '1e-2'
[]
(modules/thermal_hydraulics/test/tests/components/flow_connection/err.connection_format.i)
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 28.964e-3
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[left_wall]
type = SolidWall1Phase
[]
[pipe]
type = FlowChannel1Phase
fp = fp
closures = simple_closures
position = '0 0 0'
orientation = '1 0 0'
length = 1.0
n_elems = 5
A = 1.0
initial_T = 300
initial_p = 1e5
initial_vel = 0
f = 0
[]
[right_wall]
type = SolidWall1Phase
input = 'pipe:out'
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
nl_rel_tol = 0
nl_abs_tol = 1e-6
nl_max_its = 15
l_tol = 1e-3
l_max_its = 10
start_time = 0.0
dt = 0.01
num_steps = 1
abort_on_solve_fail = true
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
(modules/navier_stokes/test/tests/finite_element/cns/step/step.i)
# Navier-Stokes (or Euler) flow of an ideal gas over a step.
#
# Note: this problem is not currently a regression test for the
# Navier-Stokes module since it is in some sense ill-posed. As
# discussed in [0], the sharp corner of the step (both forward and
# backward-facing) introduces a singularity in the first derivative of
# the velocity and pressure fields, and therefore produces large
# numerical errors in the neighborhood of these points. Physically,
# this numerical error can be interpreted as causing an artificial
# "boundary layer" to form just above the step, as well as a spurious
# production of entropy even though the flow remains subsonic.
# Nevertheless, the forward-facing step problem in particular remains
# a challenging and well-document test problem for flow solvers, and
# this input file is included to help facilitate its development and
# employment by users of the module.
#
# [0]: Woodward and Colella, "The numerical simulation of
# two-dimenstional fluid flow with strong shocks," Journal of
# Computational Physics 54(1), pp. 115-173, 1984
[Mesh]
type = FileMesh
file = step.e
dim = 2
# uniform_refine = 3
[]
[Modules]
[FluidProperties]
[ideal_gas]
type = IdealGasFluidProperties
gamma = 1.4
[]
[]
[CompressibleNavierStokes]
# steady-state or transient
equation_type = transient
# fluid
fluid_properties = ideal_gas
# boundary conditions
stagnation_boundary = left
stagnation_pressure = 120192.995549849 # Pa, Mach=0.5 at 1 atm
stagnation_temperature = 315 # K, Mach=0.5 at 1 atm
stagnation_flow_direction = '1 0'
no_penetration_boundary = 'top bottom step_top step_left step_right'
static_pressure_boundary = 'right'
static_pressure = 101325 # Pa
# variable types, scalings and initial conditions
family = LAGRANGE
order = FIRST
total_energy_scaling = 9.869232667160121e-6
initial_pressure = 101325.
initial_temperature = 300.
initial_velocity = '173.594354746921 0 0' # Mach 0.5: = 0.5*sqrt(gamma*R*T)
[]
[]
[Materials]
[fluid]
type = Air
block = 1
rho = rho
rhou = rhou
rhov = rhov
rhoE = rhoE
vel_x = vel_x
vel_y = vel_y
temperature = temperature
enthalpy = enthalpy
# This value is not used in the Euler equations, but it *is* used
# by the stabilization parameter computation, which it decreases
# the amount of artificial viscosity added, so it's best to use a
# realistic value.
dynamic_viscosity = 0.0
fluid_properties = ideal_gas
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
dt = 5.e-5
dtmin = 1.e-5
start_time = 0.0
num_steps = 10000
nl_rel_tol = 1e-5
nl_abs_tol = 1e-9
# nl_abs_step_tol = 1e-15
nl_max_its = 5
l_tol = 1e-4 # Relative linear tolerance for each Krylov solve
l_max_its = 100 # Number of linear iterations for each Krylov solve
# Specify the order as FIRST, otherwise you will get warnings in DEBUG mode...
[Quadrature]
type = TRAP
order = FIRST
[]
[]
[Outputs]
file_base = step_out
interval = 1
exodus = true
[]
(modules/fluid_properties/test/tests/fp_interrogator/err.no_params.i)
[FluidPropertiesInterrogator]
fp = fp
[]
[Modules]
[./FluidProperties]
[./fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.02900055737704918
mu = 1.823e-05
k = 0.02568
[../]
[../]
[]
(modules/navier_stokes/test/tests/finite_volume/cns/symmetry_test/2D_symmetry.i)
rho_inside = 1
E_inside = 2.501505578
rho_outside = 0.125
E_outside = 1.999770935
radius = 0.1
angle = 45
[GlobalParams]
fp = fp
[]
[Debug]
show_material_props = true
[]
[Mesh]
[file]
type = GeneratedMeshGenerator
dim = 2
xmin = -0.5
xmax = 0.5
nx = 10
ymin = -0.5
ymax = 0.5
ny = 10
[../]
[rotate]
type = TransformGenerator
vector_value = '${angle} 0 0'
transform = ROTATE
input = file
[]
[]
[Modules]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
allow_imperfect_jacobians = true
[]
[]
[]
[Variables]
[rho]
family = MONOMIAL
order = CONSTANT
fv = true
[../]
[rho_u]
family = MONOMIAL
order = CONSTANT
fv = true
initial_condition = 1e-15
outputs = none
[]
[rho_v]
family = MONOMIAL
order = CONSTANT
fv = true
initial_condition = 1e-15
outputs = none
[]
[rho_E]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[]
[ICs]
[rho_ic]
type = FunctionIC
variable = rho
function = 'if (abs(x) < ${radius} & abs(y) < ${radius}, ${rho_inside}, ${rho_outside})'
[]
[rho_E_ic]
type = FunctionIC
variable = rho_E
function = 'if (abs(x) < ${radius} & abs(y) < ${radius}, ${fparse E_inside * rho_inside}, ${fparse E_outside * rho_outside})'
[]
[]
[FVKernels]
# Mass conservation
[mass_time]
type = FVTimeKernel
variable = rho
[]
[mass_advection]
type = CNSFVMassHLLC
variable = rho
fp = fp
[]
# Momentum x conservation
[momentum_x_time]
type = FVTimeKernel
variable = rho_u
[]
[momentum_x_advection]
type = CNSFVMomentumHLLC
variable = rho_u
momentum_component = x
fp = fp
[]
# Momentum y conservation
[momentum_y_time]
type = FVTimeKernel
variable = rho_v
[]
[./momentum_y_advection]
type = CNSFVMomentumHLLC
variable = rho_v
momentum_component = y
[]
# Fluid energy conservation
[./fluid_energy_time]
type = FVTimeKernel
variable = rho_E
[]
[./fluid_energy_advection]
type = CNSFVFluidEnergyHLLC
variable = rho_E
fp = fp
[]
[]
[FVBCs]
## outflow implicit conditions
[mass_outflow]
type = CNSFVHLLCMassImplicitBC
variable = rho
fp = fp
boundary = 'left right top bottom'
[]
[./momentum_x_outflow]
type = CNSFVHLLCMomentumImplicitBC
variable = rho_u
momentum_component = x
fp = fp
boundary = 'left right top bottom'
[]
[momentum_y_outflow]
type = CNSFVHLLCMomentumImplicitBC
variable = rho_v
momentum_component = y
fp = fp
boundary = 'left right top bottom'
[]
[fluid_energy_outflow]
type = CNSFVHLLCFluidEnergyImplicitBC
variable = rho_E
fp = fp
boundary = 'left right top bottom'
[]
[]
[AuxVariables]
[Ma]
family = MONOMIAL
order = CONSTANT
[]
[p]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[Ma_aux]
type = NSMachAux
variable = Ma
fluid_properties = fp
use_material_properties = true
[]
[p_aux]
type = ADMaterialRealAux
variable = p
property = pressure
[]
[]
[Materials]
[var_mat]
type = ConservedVarValuesMaterial
rho = rho
rhou = rho_u
rhov = rho_v
rho_et = rho_E
[]
[sound_speed]
type = SoundspeedMat
fp = fp
[]
[]
[Postprocessors]
[cfl_dt]
type = ADCFLTimeStepSize
c_names = 'sound_speed'
vel_names = 'speed'
CFL = 0.5
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[]
[Executioner]
type = Transient
end_time = 0.2
[TimeIntegrator]
type = ExplicitSSPRungeKutta
order = 2
[]
l_tol = 1e-8
[TimeStepper]
type = PostprocessorDT
postprocessor = cfl_dt
[]
[]
[Outputs]
exodus = true
[]
(modules/thermal_hydraulics/test/tests/components/deprecated/free_boundary.i)
[GlobalParams]
gravity_vector = '0 0 0'
closures = simple_closures
fp = fp
f = 0.0
initial_T = 300
initial_p = 1e5
initial_vel = 0
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.02897
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[in]
type = FreeBoundary
input = 'pipe:in'
[]
[pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 0'
length = 0.5
n_elems = 2
A = 0.1
[]
[out]
type = FreeBoundary
input = 'pipe:out'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 20
l_tol = 1e-4
start_time = 0.0
end_time = 1.0
dt = 0.01
abort_on_solve_fail = true
[]
(modules/thermal_hydraulics/test/tests/problems/sod_shock_tube/sod_shock_tube.i)
# This test problem is the classic Sod shock tube test problem,
# which is a Riemann problem with the following parameters:
# * domain = (0,1)
# * gravity = 0
# * EoS: Ideal gas EoS with gamma = 1.4, R = 0.71428571428571428571
# * interface: x = 0.5
# * typical end time: 0.2
# Left initial values:
# * rho = 1
# * vel = 0
# * p = 1
# Right initial values:
# * rho = 0.125
# * vel = 0
# * p = 0.1
#
# The output can be viewed by opening Paraview with the state file `plot.pvsm`:
# paraview --state=plot.pvsm
# This will plot the numerical solution against the analytical solution
[GlobalParams]
gravity_vector = '0 0 0'
rdg_slope_reconstruction = minmod
closures = simple_closures
[]
[Functions]
[p_ic_fn]
type = PiecewiseConstant
axis = x
direction = right
x = '0.5 1.0'
y = '1.0 0.1'
[]
[T_ic_fn]
type = PiecewiseConstant
axis = x
direction = right
x = '0.5 1.0'
y = '1.4 1.12'
[]
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 11.64024372
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp
# geometry
position = '0 0 0'
orientation = '1 0 0'
length = 1.0
n_elems = 100
A = 1.0
# IC
initial_T = T_ic_fn
initial_p = p_ic_fn
initial_vel = 0
f = 0
[]
[left_boundary]
type = FreeBoundary1Phase
input = 'pipe:in'
[]
[right_boundary]
type = FreeBoundary1Phase
input = 'pipe:out'
[]
[]
[Executioner]
type = Transient
[TimeIntegrator]
type = ExplicitSSPRungeKutta
[]
solve_type = LINEAR
l_tol = 1e-4
nl_rel_tol = 1e-20
nl_abs_tol = 1e-8
nl_max_its = 60
# run to t = 0.2
start_time = 0.0
dt = 1e-3
num_steps = 200
abort_on_solve_fail = true
[]
[Outputs]
file_base = 'sod_shock_tube'
velocity_as_vector = false
execute_on = 'initial timestep_end'
[out]
type = Exodus
show = 'rho p vel'
[]
[]
(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
[]
[]
[Modules]
[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
value_x = '${u_in}'
[]
[eps]
type = ParsedFunction
value = '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/boussinesq/transient-wcnsfv.i)
mu = 1
rho = 'rho'
k = 1
cp = 1
l = 10
velocity_interp_method = 'rc'
advected_interp_method = 'average'
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 = ${l}
ymin = 0
ymax = ${l}
nx = 16
ny = 16
[]
[]
[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}
[]
[]
[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
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = u
y = v
execute_on = 'initial timestep_end'
[]
[vel_x]
type = ParsedAux
variable = vel_x
function = 'u'
execute_on = 'initial timestep_end'
args = 'u'
[]
[vel_y]
type = ParsedAux
variable = vel_y
function = 'v'
execute_on = 'initial timestep_end'
args = 'v'
[]
[viz_T]
type = ParsedAux
variable = viz_T
function = 'T'
execute_on = 'initial timestep_end'
args = 'T'
[]
[]
[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
[]
[u_gravity]
type = INSFVMomentumGravity
variable = u
gravity = '0 -1 0'
rho = ${rho}
momentum_component = 'x'
[]
[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
[]
[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}
[]
[]
[Modules]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[]
[Materials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyMaterial
temperature = 'T'
rho = ${rho}
[]
[]
[Functions]
[lid_function]
type = ParsedFunction
value = '4*x*(1-x)'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
steady_state_detection = true
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-5
optimal_iterations = 6
[]
nl_abs_tol = 1e-9
normalize_solution_diff_norm_by_dt = false
nl_max_its = 10
[]
[Outputs]
[out]
type = Exodus
[]
[]
(modules/thermal_hydraulics/test/tests/postprocessors/flow_junction_flux_1phase/flow_junction_flux_1phase.i)
# This input file tests mass conservation at steady-state by looking at the
# net mass flux into the domain.
T_in = 523.0
m_dot = 100
p_out = 7e6
[GlobalParams]
initial_p = ${p_out}
initial_vel = 1
initial_T = ${T_in}
gravity_vector = '0 0 0'
closures = simple_closures
n_elems = 3
f = 0
scaling_factor_1phase = '1 1 1e-5'
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[inlet_bc]
type = InletMassFlowRateTemperature1Phase
input = 'inlet:in'
m_dot = ${m_dot}
T = ${T_in}
[]
[inlet]
type = FlowChannel1Phase
fp = fp
position = '0 0 11'
orientation = '0 0 -1'
length = 1
A = 3
[]
[inlet_plenum]
type = VolumeJunction1Phase
position = '0 0 10'
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 1
connections = 'inlet:out channel1:in channel2:in'
volume = 1
scaling_factor_rhoEV = '1e-5'
[]
[channel1]
type = FlowChannel1Phase
fp = fp
position = '0 0 10'
orientation = '0 0 -1'
length = 10
A = 4
D_h = 1
[]
[K_bypass]
type = FormLossFromFunction1Phase
K_prime = 500
flow_channel = channel1
[]
[channel2]
type = FlowChannel1Phase
fp = fp
position = '0 0 10'
orientation = '0 0 -1'
length = 10
A = 1
D_h = 1
[]
[outlet_plenum]
type = VolumeJunction1Phase
position = '0 0 0'
initial_vel_x = 1
initial_vel_y = 0
initial_vel_z = 1
connections = 'channel1:out channel2:out outlet:in'
volume = 1
scaling_factor_rhoEV = '1e-5'
[]
[outlet]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '0 0 -1'
length = 1
A = 1
[]
[outlet_bc]
type = Outlet1Phase
p = ${p_out}
input = 'outlet:out'
[]
[]
[Postprocessors]
[inlet_in_m_dot]
type = ADFlowBoundaryFlux1Phase
boundary = 'inlet_bc'
equation = mass
[]
[inlet_out_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'inlet:out'
connection_index = 0
junction = inlet_plenum
equation = mass
[]
[channel1_in_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'channel1:in'
connection_index = 1
junction = inlet_plenum
equation = mass
[]
[channel1_out_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'channel1:out'
connection_index = 0
junction = outlet_plenum
equation = mass
[]
[channel2_in_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'channel2:in'
connection_index = 2
junction = inlet_plenum
equation = mass
[]
[channel2_out_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'channel2:out'
connection_index = 1
junction = outlet_plenum
equation = mass
[]
[outlet_in_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'outlet:in'
connection_index = 2
junction = outlet_plenum
equation = mass
[]
[outlet_out_m_dot]
type = ADFlowBoundaryFlux1Phase
boundary = 'outlet_bc'
equation = mass
[]
[net_mass_flow_rate_domain]
type = LinearCombinationPostprocessor
pp_names = 'inlet_in_m_dot outlet_out_m_dot'
pp_coefs = '1 -1'
[]
[net_mass_flow_rate_volume_junction]
type = LinearCombinationPostprocessor
pp_names = 'inlet_out_m_dot channel1_in_m_dot channel2_in_m_dot'
pp_coefs = '1 -1 -1'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
start_time = 0
end_time = 10000
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.01
optimal_iterations = 8
iteration_window = 2
[]
timestep_tolerance = 1e-6
abort_on_solve_fail = true
line_search = none
nl_rel_tol = 1e-8
nl_abs_tol = 2e-8
nl_max_its = 25
l_tol = 1e-3
l_max_its = 5
petsc_options = '-snes_converged_reason'
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu '
[]
[Outputs]
[out]
type = CSV
execute_on = 'FINAL'
show = 'net_mass_flow_rate_domain net_mass_flow_rate_volume_junction'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/cns/pressure_outlet/subsonic_nozzle_fixed_inflow_hllc.i)
inlet_vel = 120
rho_in = 0.8719748696
H_in = 4.0138771448e+05
gamma = 1.4
R = 8.3145
molar_mass = 29e-3
R_specific = ${fparse R / molar_mass}
cp = ${fparse gamma * R_specific / (gamma - 1)}
cv = ${fparse cp / gamma}
T_in = ${fparse H_in / gamma / cv}
mass_flux = ${fparse inlet_vel * rho_in}
outlet_pressure = 0.9e5
[GlobalParams]
fp = fp
[]
[Debug]
show_material_props = true
[]
[Mesh]
[file]
type = FileMeshGenerator
file = subsonic_nozzle.e
[]
[]
[Modules]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[]
[Variables]
[rho]
family = MONOMIAL
order = CONSTANT
fv = true
initial_condition = 0.8719748696
[]
[rho_u]
family = MONOMIAL
order = CONSTANT
fv = true
initial_condition = 1e-4
[]
[rho_v]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[rho_E]
family = MONOMIAL
order = CONSTANT
fv = true
initial_condition = 2.5e5
[]
[]
[FVKernels]
# Mass conservation
[mass_time]
type = FVTimeKernel
variable = rho
[]
[mass_advection]
type = CNSFVMassHLLC
variable = rho
[]
# Momentum x conservation
[momentum_x_time]
type = FVTimeKernel
variable = rho_u
[]
[momentum_x_advection]
type = CNSFVMomentumHLLC
variable = rho_u
momentum_component = x
[]
# Momentum y conservation
[momentum_y_time]
type = FVTimeKernel
variable = rho_v
[]
[momentum_y_advection]
type = CNSFVMomentumHLLC
variable = rho_v
momentum_component = y
[]
# Fluid energy conservation
[fluid_energy_time]
type = FVTimeKernel
variable = rho_E
[]
[fluid_energy_advection]
type = CNSFVFluidEnergyHLLC
variable = rho_E
[]
[]
[FVBCs]
## inflow boundaries
[mass_inflow]
type = CNSFVHLLCSpecifiedMassFluxAndTemperatureMassBC
variable = rho
boundary = left
rhou = ${mass_flux}
rhov = 0
temperature = ${T_in}
[]
[momentum_x_inflow]
type = CNSFVHLLCSpecifiedMassFluxAndTemperatureMomentumBC
variable = rho_u
boundary = left
rhou = ${mass_flux}
rhov = 0
temperature = ${T_in}
momentum_component = x
[]
[momentum_y_inflow]
type = CNSFVHLLCSpecifiedMassFluxAndTemperatureMomentumBC
variable = rho_v
boundary = left
rhou = ${mass_flux}
rhov = 0
temperature = ${T_in}
momentum_component = y
[]
[fluid_energy_inflow]
type = CNSFVHLLCSpecifiedMassFluxAndTemperatureFluidEnergyBC
variable = rho_E
boundary = left
rhou = ${mass_flux}
rhov = 0
temperature = ${T_in}
[]
## outflow conditions
[mass_outflow]
type = CNSFVHLLCSpecifiedPressureMassBC
variable = rho
boundary = right
pressure = ${outlet_pressure}
[]
[momentum_x_outflow]
type = CNSFVHLLCSpecifiedPressureMomentumBC
variable = rho_u
boundary = right
momentum_component = x
pressure = ${outlet_pressure}
[]
[momentum_y_outflow]
type = CNSFVHLLCSpecifiedPressureMomentumBC
variable = rho_v
boundary = right
momentum_component = y
pressure = ${outlet_pressure}
[]
[fluid_energy_outflow]
type = CNSFVHLLCSpecifiedPressureFluidEnergyBC
variable = rho_E
boundary = right
pressure = ${outlet_pressure}
[]
# wall conditions
[momentum_x_pressure_wall]
type = CNSFVMomImplicitPressureBC
variable = rho_u
momentum_component = x
boundary = wall
[]
[momentum_y_pressure_wall]
type = CNSFVMomImplicitPressureBC
variable = rho_v
momentum_component = y
boundary = wall
[]
[]
[AuxVariables]
[Ma]
family = MONOMIAL
order = CONSTANT
[]
[p]
family = MONOMIAL
order = CONSTANT
[]
[Ma_layered]
family = MONOMIAL
order = CONSTANT
[]
[]
[UserObjects]
[layered_Ma_UO]
type = LayeredAverage
variable = Ma
num_layers = 10
direction = x
[]
[]
[AuxKernels]
[Ma_aux]
type = NSMachAux
variable = Ma
fluid_properties = fp
use_material_properties = true
[]
[p_aux]
type = ADMaterialRealAux
variable = p
property = pressure
[]
[Ma_layered_aux]
type = SpatialUserObjectAux
variable = Ma_layered
user_object = layered_Ma_UO
[]
[]
[Materials]
[var_mat]
type = ConservedVarValuesMaterial
rho = rho
rhou = rho_u
rhov = rho_v
rho_et = rho_E
[]
[sound_speed]
type = SoundspeedMat
[]
[]
[Postprocessors]
[outflow_Ma]
type = SideAverageValue
variable = Ma
boundary = right
[]
[outflow_pressure]
type = SideAverageValue
variable = p
boundary = right
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[]
[Executioner]
type = Transient
end_time = 10
solve_type = NEWTON
nl_abs_tol = 1e-7
[TimeIntegrator]
type = ImplicitEuler
[]
[TimeStepper]
type = IterationAdaptiveDT
dt = 5e-3
optimal_iterations = 6
growth_factor = 1.5
[]
[]
[VectorPostprocessors]
[Ma_layered]
type = LineValueSampler
variable = Ma_layered
start_point = '0 0 0'
end_point = '3 0 0'
num_points = 100
sort_by = x
warn_discontinuous_face_values = false
[]
[]
[Outputs]
[out]
type = Exodus
execute_on = 'final'
[]
[]
(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
[]
[]
[Modules]
[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
value = '3.48788261470924*cos(x)'
[]
[forcing_rho]
type = ParsedFunction
value = '-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
value = '3.48788261470924*cos(1.1*x)*cos(1.3*x)'
[]
[forcing_rho_ud]
type = ParsedFunction
value = '(-(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
value = '26.7439413073546*cos(1.5*x)'
[]
[forcing_rho_et]
type = ParsedFunction
value = '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
value = '0.0106975765229418*cos(1.5*x)/cos(x) - 0.000697576522941848*cos(1.1*x)^2/cos(x)^2'
[]
[exact_eps_p]
type = ParsedFunction
value = '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
value = '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
value = '1.0*cos(1.1*x)*cos(1.3*x)/cos(x)'
[]
[eps]
type = ParsedFunction
value = 'cos(1.3*x)'
[]
[exact_superficial_velocity]
type = ParsedVectorFunction
value_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/fluid_properties/test/tests/fp_interrogator/1ph.rho_p.i)
[FluidPropertiesInterrogator]
fp = fp
rho = 1
p = 1e5
[]
[Modules]
[./FluidProperties]
[./fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.02900055737704918
mu = 1.823e-05
k = 0.02568
[../]
[../]
[]
(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
[../]
[]
[Modules]
[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/fluid_properties/test/tests/fp_interrogator/2ph_ncg_p_T.i)
[FluidPropertiesInterrogator]
fp = fp_2phase_ncg
p = 1e5
T = 372.7559289
x_ncg = '0.1'
[]
[Modules]
[./FluidProperties]
[./fp_nitrogen]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.02867055103448276
[../]
[./fp_2phase_ncg]
type = TestTwoPhaseNCGFluidProperties
fp_ncgs = 'fp_nitrogen'
[../]
[../]
[]
(modules/thermal_hydraulics/test/tests/components/shaft_connected_turbine_1phase/turbine_startup.i)
# This test tests that the turbine can startup from rest and reach full power.
# The mass flow rate for the inlet component is ramped up over 10s. The dyno
# component and pid_ctrl controler are used to maintain the turbine's rated shaft
# speed. The turbine should supply ~1e6 W of power to the shaft by the end of the test.
omega_rated = 450
mdot = 5.0
T_in = 1000.0
p_out = 1e6
[GlobalParams]
f = 1
scaling_factor_1phase = '0.04 0.04 0.04e-5'
closures = simple_closures
n_elems = 20
initial_T = ${T_in}
initial_p = ${p_out}
initial_vel = 0
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
[]
[Modules/FluidProperties]
[eos]
type = IdealGasFluidProperties
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[ch_in]
type = FlowChannel1Phase
position = '-1 0 0'
orientation = '1 0 0'
length = 1
A = 0.1
D_h = 1
fp = eos
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'ch_in:in'
m_dot = 0
T = ${T_in}
[]
[turbine]
type = ShaftConnectedTurbine1Phase
inlet = 'ch_in:out'
outlet = 'ch_out:in'
position = '0 0 0'
scaling_factor_rhoEV = 1e-5
A_ref = 0.1
volume = 0.0002
inertia_coeff = '1 1 1 1'
inertia_const = 1.61397
speed_cr_I = 1e12
speed_cr_fr = 0
tau_fr_coeff = '0 0 0 0'
tau_fr_const = 0
omega_rated = ${omega_rated}
D_wheel = 0.4
head_coefficient = head
power_coefficient = power
[]
[ch_out]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
A = 0.1
D_h = 1
fp = eos
[]
[outlet]
type = Outlet1Phase
input = 'ch_out:out'
p = ${p_out}
[]
[dyno]
type = ShaftConnectedMotor
inertia = 10
torque = -450
[]
[shaft]
type = Shaft
connected_components = 'turbine dyno'
initial_speed = ${omega_rated}
[]
[]
[Functions]
[head]
type = PiecewiseLinear
x = '0 7e-3 1e-2'
y = '0 15 20'
[]
[power]
type = PiecewiseLinear
x = '0 6e-3 1e-2'
y = '0 0.05 0.18'
[]
[mfr_fn]
type = PiecewiseLinear
x = '0 10'
y = '1e-6 ${mdot}'
[]
[dts]
type = PiecewiseConstant
y = '5e-3 1e-2 5e-2 5e-1'
x = '0 0.5 1 10'
[]
[]
[ControlLogic]
[mfr_cntrl]
type = TimeFunctionComponentControl
component = inlet
parameter = m_dot
function = mfr_fn
[]
[speed_set_point]
type = GetFunctionValueControl
function = ${omega_rated}
[]
[pid_ctrl]
type = PIDControl
input = omega
set_point = speed_set_point:value
K_i = 2
K_p = 5
K_d = 5
initial_value = -450
[]
[set_torque_value]
type = SetComponentRealValueControl
component = dyno
parameter = torque
value = pid_ctrl:output
[]
[]
[Postprocessors]
[omega]
type = ScalarVariable
variable = shaft:omega
execute_on = 'initial timestep_end'
[]
[flow_coefficient]
type = ScalarVariable
variable = turbine:flow_coeff
execute_on = 'initial timestep_end'
[]
[delta_p]
type = ScalarVariable
variable = turbine:delta_p
execute_on = 'initial timestep_end'
[]
[power]
type = ScalarVariable
variable = turbine:power
execute_on = 'initial timestep_end'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'implicit-euler'
start_time = 0
[TimeStepper]
type = FunctionDT
function = dts
[]
end_time = 20
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 1e-6
nl_abs_tol = 1e-4
nl_max_its = 30
l_tol = 1e-4
l_max_its = 20
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Outputs]
[console]
type = Console
max_rows = 1
[]
print_linear_residuals = false
[]
(modules/fluid_properties/test/tests/fp_interrogator/2ph.p_T.i)
[FluidPropertiesInterrogator]
fp = fp
p = 1e5
T = 300
[]
[Modules]
[./FluidProperties]
[./fp_liquid]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.02900055737704918
mu = 1.823e-05
k = 0.02568
[../]
[./fp_vapor]
type = IdealGasFluidProperties
gamma = 1.1
molar_mass = 0.027714866
mu = 1.7e-05
k = 0.05
[../]
[./fp]
type = TestTwoPhaseFluidProperties
fp_liquid = fp_liquid
fp_vapor = fp_vapor
[../]
[../]
[]
(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
[]
[]
[Modules]
[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
[]
(modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_1phase/err.1phase.i)
[GlobalParams]
initial_p = 1e5
initial_vel = 0
initial_T = 300
closures = simple_closures
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[HeatStructureMaterials]
[fuel-mat]
type = SolidMaterialProperties
k = 2.5
cp = 300.
rho = 1.032e4
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
position = '0 0.1 0'
orientation = '0 0 1'
length = 4
n_elems = 2
A = 8.78882e-5
D_h = 0.01179
f = 0.01
fp = fp
[]
[hs]
type = HeatStructureCylindrical
position = '0 0 0'
orientation = '0 0 1'
length = 4
n_elems = 2
names = 'fuel'
widths = '0.1'
n_part_elems = '1'
materials = 'fuel-mat'
initial_T = 300
[]
[hx]
type = HeatTransferFromHeatStructure1Phase
hs = hs
hs_side = outer
flow_channel = pipe
P_hf = 0.029832559676
[]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe:in'
p0 = 1e5
T0 = 300
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 1e5
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
dt = 1.e-5
solve_type = 'NEWTON'
num_steps = 1
abort_on_solve_fail = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/shock_tube_2D_cavity/hllc_sod_shocktube_2D.i)
rho_left = 1
E_left = 2.501505578
u_left = 1e-15
rho_right = 0.125
E_right = 1.999770935
u_right = 1e-15
x_sep = 35
[GlobalParams]
fp = fp
[]
[Mesh]
[./cartesian]
type = CartesianMeshGenerator
dim = 2
dx = '40 20'
ix = '200 100'
dy = '1 20 2 20 1'
iy = '4 100 10 100 4'
subdomain_id = '0 0
0 1
1 1
0 1
0 0'
[../]
[./wall]
type = SideSetsBetweenSubdomainsGenerator
input = cartesian
primary_block = 1
paired_block = 0
new_boundary = 'wall'
[../]
[./delete]
type = BlockDeletionGenerator
input = wall
block = 0
[../]
[]
[Modules]
[./FluidProperties]
[./fp]
type = IdealGasFluidProperties
allow_imperfect_jacobians = true
[../]
[../]
[]
[Variables]
[./rho]
order = CONSTANT
family = MONOMIAL
fv = true
[../]
[./rho_u]
order = CONSTANT
family = MONOMIAL
fv = true
[../]
[./rho_v]
order = CONSTANT
family = MONOMIAL
fv = true
[../]
[./rho_E]
order = CONSTANT
family = MONOMIAL
fv = true
[../]
[]
[AuxVariables]
[./Ma]
order = CONSTANT
family = MONOMIAL
[../]
[./p]
order = CONSTANT
family = MONOMIAL
[../]
[./v_norm]
order = CONSTANT
family = MONOMIAL
[../]
[./temperature]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./Ma_aux]
type = NSMachAux
variable = Ma
fluid_properties = fp
use_material_properties = true
[../]
[./p_aux]
type = ADMaterialRealAux
variable = p
property = pressure
[../]
[./v_norm_aux]
type = ADMaterialRealAux
variable = v_norm
property = speed
[../]
[./temperature_aux]
type = ADMaterialRealAux
variable = temperature
property = T_fluid
[../]
[]
[FVKernels]
[./mass_time]
type = FVTimeKernel
variable = rho
[../]
[./mass_advection]
type = CNSFVMassHLLC
variable = rho
[../]
[./momentum_x_time]
type = FVTimeKernel
variable = rho_u
[../]
[./momentum_x_advection]
type = CNSFVMomentumHLLC
variable = rho_u
momentum_component = x
[../]
[./momentum_y_time]
type = FVTimeKernel
variable = rho_v
[../]
[./momentum_y_advection]
type = CNSFVMomentumHLLC
variable = rho_v
momentum_component = y
[../]
[./fluid_energy_time]
type = FVTimeKernel
variable = rho_E
[../]
[./fluid_energy_advection]
type = CNSFVFluidEnergyHLLC
variable = rho_E
[../]
[]
[FVBCs]
[./mom_x_pressure]
type = CNSFVMomImplicitPressureBC
variable = rho_u
momentum_component = x
boundary = 'left right wall'
[../]
[./mom_y_pressure]
type = CNSFVMomImplicitPressureBC
variable = rho_v
momentum_component = y
boundary = 'wall'
[../]
[]
[ICs]
[./rho_ic]
type = FunctionIC
variable = rho
function = 'if (x < ${x_sep}, ${rho_left}, ${rho_right})'
[../]
[./rho_u_ic]
type = FunctionIC
variable = rho_u
function = 'if (x < ${x_sep}, ${fparse rho_left * u_left}, ${fparse rho_right * u_right})'
[../]
[./rho_E_ic]
type = FunctionIC
variable = rho_E
function = 'if (x < ${x_sep}, ${fparse E_left * rho_left}, ${fparse E_right * rho_right})'
[../]
[]
[Materials]
[./var_mat]
type = ConservedVarValuesMaterial
rho = rho
rhou = rho_u
rhov = rho_v
rho_et = rho_E
fp = fp
[../]
[./sound_speed]
type = SoundspeedMat
fp = fp
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[../]
[]
[Postprocessors]
[./cfl_dt]
type = ADCFLTimeStepSize
c_names = 'sound_speed'
vel_names = 'speed'
[../]
[]
[Executioner]
type = Transient
end_time = 100
[TimeIntegrator]
type = ExplicitSSPRungeKutta
order = 2
[]
l_tol = 1e-8
[./TimeStepper]
type = PostprocessorDT
postprocessor = cfl_dt
[../]
[]
[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
[]
[]
[Modules]
[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
value_x = '0'
value_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/thermal_hydraulics/test/tests/components/junction_one_to_one_1phase/no_junction_1phase.i)
# This input file is used to generate gold values for the junction_one_to_one_1phase.i
# test. Unlike junction_one_to_one_1phase.i, this file has no junction in the
# middle of the domain. In junction_one_to_one_1phase.i, the post-processors are
# side post-processors, but in this input file, side post-processors cannot be
# used to obtain the solution at these positions since there are no sides there.
# Therefore, the solution is sampled at points just to the left and right of
# the middle to obtain the piecewise constant solution values to either side of
# the interface.
[GlobalParams]
gravity_vector = '0 0 0'
closures = simple_closures
[]
[Functions]
[p_ic_fn]
type = PiecewiseConstant
axis = x
direction = right
x = '0.5 1.0'
y = '1.0 0.1'
[]
[T_ic_fn]
type = PiecewiseConstant
axis = x
direction = right
x = '0.5 1.0'
y = '1.4 1.12'
[]
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 11.64024372
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[left_boundary]
type = FreeBoundary1Phase
input = 'channel:in'
[]
[channel]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '1 0 0'
length = 1.0
n_elems = 100
A = 1.0
initial_T = T_ic_fn
initial_p = p_ic_fn
initial_vel = 0
f = 0
[]
[right_boundary]
type = FreeBoundary1Phase
input = 'channel:out'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
nl_rel_tol = 1e-10
nl_abs_tol = 1e-8
nl_max_its = 60
l_tol = 1e-4
start_time = 0.0
dt = 1e-3
num_steps = 5
abort_on_solve_fail = true
[]
[Postprocessors]
[rhoA_left]
type = PointValue
variable = rhoA
point = '0.4999 0 0'
execute_on = 'initial timestep_end'
[]
[rhouA_left]
type = PointValue
variable = rhouA
point = '0.4999 0 0'
execute_on = 'initial timestep_end'
[]
[rhoEA_left]
type = PointValue
variable = rhoEA
point = '0.4999 0 0'
execute_on = 'initial timestep_end'
[]
[rhoA_right]
type = PointValue
variable = rhoA
point = '0.5001 0 0'
execute_on = 'initial timestep_end'
[]
[rhouA_right]
type = PointValue
variable = rhouA
point = '0.5001 0 0'
execute_on = 'initial timestep_end'
[]
[rhoEA_right]
type = PointValue
variable = rhoEA
point = '0.5001 0 0'
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
csv = true
file_base = 'junction_one_to_one_1phase_out'
execute_on = 'initial timestep_end'
[]
(modules/porous_flow/test/tests/newton_cooling/nc08.i)
# Newton cooling from a bar. 1-phase ideal fluid and heat, steady
[Mesh]
type = GeneratedMesh
dim = 2
nx = 100
ny = 1
xmin = 0
xmax = 100
ymin = 0
ymax = 1
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pressure temp'
number_fluid_phases = 1
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
m = 0.8
alpha = 1e-5
[]
[]
[Variables]
[pressure]
[]
[temp]
[]
[]
[ICs]
# have to start these reasonably close to their steady-state values
[pressure]
type = FunctionIC
variable = pressure
function = '200-0.5*x'
[]
[temperature]
type = FunctionIC
variable = temp
function = 180+0.1*x
[]
[]
[Kernels]
[flux]
type = PorousFlowAdvectiveFlux
fluid_component = 0
gravity = '0 0 0'
variable = pressure
[]
[heat_advection]
type = PorousFlowHeatAdvection
gravity = '0 0 0'
variable = temp
[]
[]
[Modules]
[FluidProperties]
[idealgas]
type = IdealGasFluidProperties
molar_mass = 1.4
gamma = 1.2
mu = 1.2
[]
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = temp
[]
[ppss]
type = PorousFlow1PhaseP
porepressure = pressure
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
[]
[dens0]
type = PorousFlowSingleComponentFluid
fp = idealgas
phase = 0
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1.1 0 0 0 1.1 0 0 0 1.1'
[]
[relperm]
type = PorousFlowRelativePermeabilityCorey # irrelevant in this fully-saturated situation
n = 2
phase = 0
[]
[]
[BCs]
[leftp]
type = DirichletBC
variable = pressure
boundary = left
value = 200
[]
[leftt]
type = DirichletBC
variable = temp
boundary = left
value = 180
[]
[newtonp]
type = PorousFlowPiecewiseLinearSink
variable = pressure
boundary = right
pt_vals = '-200 0 200'
multipliers = '-200 0 200'
use_mobility = true
use_relperm = true
fluid_phase = 0
flux_function = 0.005 # 1/2/L
[]
[newtont]
type = PorousFlowPiecewiseLinearSink
variable = temp
boundary = right
pt_vals = '-200 0 200'
multipliers = '-200 0 200'
use_mobility = true
use_relperm = true
use_enthalpy = true
fluid_phase = 0
flux_function = 0.005 # 1/2/L
[]
[]
[VectorPostprocessors]
[porepressure]
type = LineValueSampler
variable = pressure
start_point = '0 0.5 0'
end_point = '100 0.5 0'
sort_by = x
num_points = 11
execute_on = timestep_end
[]
[temperature]
type = LineValueSampler
variable = temp
start_point = '0 0.5 0'
end_point = '100 0.5 0'
sort_by = x
num_points = 11
execute_on = timestep_end
[]
[]
[Preconditioning]
[andy]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = Newton
nl_rel_tol = 1E-10
nl_abs_tol = 1E-15
[]
[Outputs]
file_base = nc08
execute_on = timestep_end
exodus = true
[along_line]
type = CSV
execute_vector_postprocessors_on = timestep_end
[]
[]
(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
[]
[]
[Modules]
[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
value = '3.48788261470924*cos(x)'
[]
[forcing_rho]
type = ParsedFunction
value = '-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
value = '3.48788261470924*cos(1.1*x)*cos(1.3*x)'
[]
[forcing_rho_ud]
type = ParsedFunction
value = '(-(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
value = '26.7439413073546*cos(1.5*x)'
[]
[forcing_rho_et]
type = ParsedFunction
value = '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
value = '0.0106975765229418*cos(1.5*x)/cos(x) - 0.000697576522941848*cos(1.1*x)^2/cos(x)^2'
[]
[exact_eps_p]
type = ParsedFunction
value = '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
value = '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
value = '1.0*cos(1.1*x)*cos(1.3*x)/cos(x)'
[]
[eps]
type = ParsedFunction
value = 'cos(1.3*x)'
[]
[exact_superficial_velocity]
type = ParsedVectorFunction
value_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/thermal_hydraulics/test/tests/components/gate_valve_1phase/gate_valve_1phase.i)
# This input file is used to test the gate valve component.
# This problem consists of a T junction of 3 pipes. The inlet pipe is one of the
# 2 pipes of the "top" of the T. The other 2 pipes each have a gate valve.
# Initially, one of the 2 outlet pipes has an open valve and the other has a
# closed valve. Later in the transient, the valves gradually open/close to switch
# the outlet flow direction.
p = 1.0e5
T = 300.0
rho = 1.161430436 # @ 1e5 Pa, 300 K
D = 0.1
A = ${fparse pi * D^2 / 4.0}
V_junction = ${fparse pi * D^3 / 4.0}
vel_in = 2.0
m_dot = ${fparse rho * vel_in * A}
t_begin = 0.3
delta_t_open = 0.1
[GlobalParams]
gravity_vector = '0 0 0'
closures = simple_closures
fp = fp
f = 0.0
initial_T = ${T}
initial_p = ${p}
initial_vel = 0
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.02897
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Functions]
[pipe3_open_fn]
type = TimeRampFunction
initial_value = 1
final_value = 0
initial_time = ${t_begin}
ramp_duration = ${delta_t_open}
[]
[pipe2_open_fn]
type = ParsedFunction
value = '1 - pipe3_phi'
vars = 'pipe3_phi'
vals = 'pipe3_open_fn'
[]
[]
[Components]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe1:in'
m_dot = ${m_dot}
T = ${T}
[]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1.0
n_elems = 50
A = ${A}
[]
[volume_junction]
type = VolumeJunction1Phase
position = '1 0 0'
connections = 'pipe1:out pipe2A:in pipe3A:in'
volume = ${V_junction}
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
[]
[pipe2A]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '0 1 0'
length = 0.5
n_elems = 25
A = ${A}
[]
[pipe2_valve]
type = GateValve1Phase
connections = 'pipe2A:out pipe2B:in'
open_area_fraction = 0 # (controlled via 'pipe2_valve_control')
[]
[pipe2B]
type = FlowChannel1Phase
position = '1 0.5 0'
orientation = '0 1 0'
length = 0.5
n_elems = 25
A = ${A}
[]
[pipe2_outlet]
type = Outlet1Phase
input = 'pipe2B:out'
p = ${p}
[]
[pipe3A]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '1 0 0'
length = 0.5
n_elems = 25
A = ${A}
[]
[pipe3_valve]
type = GateValve1Phase
connections = 'pipe3A:out pipe3B:in'
open_area_fraction = 0 # (controlled via 'pipe3_valve_control')
[]
[pipe3B]
type = FlowChannel1Phase
position = '1.5 0 0'
orientation = '1 0 0'
length = 0.5
n_elems = 25
A = ${A}
[]
[pipe3_outlet]
type = Outlet1Phase
input = 'pipe3B:out'
p = ${p}
[]
[]
[ControlLogic]
[pipe2_valve_control]
type = TimeFunctionComponentControl
component = pipe2_valve
parameter = open_area_fraction
function = pipe2_open_fn
[]
[pipe3_valve_control]
type = TimeFunctionComponentControl
component = pipe3_valve
parameter = open_area_fraction
function = pipe3_open_fn
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 20
l_tol = 1e-4
start_time = 0.0
end_time = 1.0
dt = 0.01
abort_on_solve_fail = true
[]
[Outputs]
exodus = true
show = 'p T vel'
velocity_as_vector = false
print_linear_residuals = false
[console]
type = Console
max_rows = 1
[]
[]
(modules/thermal_hydraulics/test/tests/problems/mms/mms_1phase.i)
# Method of manufactured solutions (MMS) problem for 1-phase flow model.
#
# The python script mms_derivation.py derives the MMS sources used in this
# input file.
#
# To perform a convergence study, run this input file with different values of
# 'refinement_level', starting with 0. Manually create a CSV file (call it the
# "convergence CSV file") to store the error vs. mesh size data. It should have
# the columns specified in the plot script plot_convergence_1phase.py. Copy the
# CSV output from each run into the convergence CSV file. After all of the runs,
# run the plot script using python.
refinement_level = 0 # 0 is initial
n_elems_coarse = 10
n_elems = ${fparse int(n_elems_coarse * 2^refinement_level)}
dt = 1e-6
t_end = ${fparse dt * 10}
area = 1.0
gamma = 2.0
M = 0.05
A = 1
B = 1
C = 1
aA = ${fparse area}
R_univ = 8.3144598
R = ${fparse R_univ / M}
cp = ${fparse gamma * R / (gamma - 1.0)}
cv = ${fparse cp / gamma}
[GlobalParams]
gravity_vector = '0 0 0'
closures = simple_closures
[]
[Functions]
# solutions
[rho_fn]
type = ParsedFunction
value = 'A * (sin(B*x + C*t) + 2)'
vars = 'A B C'
vals = '${A} ${B} ${C}'
[]
[vel_fn]
type = ParsedFunction
value = 'A * t * sin(pi * x)'
vars = 'A'
vals = '${A}'
[]
[p_fn]
type = ParsedFunction
value = 'A * (cos(B*x + C*t) + 2)'
vars = 'A B C'
vals = '${A} ${B} ${C}'
[]
[T_fn]
type = ParsedFunction
value = '(cos(B*x + C*t) + 2)/(cv*(gamma - 1)*(sin(B*x + C*t) + 2))'
vars = 'B C gamma cv'
vals = '${B} ${C} ${gamma} ${cv}'
[]
# MMS sources
[rho_src_fn]
type = ParsedFunction
value = 'A^2*B*t*sin(pi*x)*cos(B*x + C*t) + pi*A^2*t*(sin(B*x + C*t) + 2)*cos(pi*x) + A*C*cos(B*x + C*t)'
vars = 'A B C'
vals = '${A} ${B} ${C}'
[]
[rhou_src_fn]
type = ParsedFunction
value = 'A^3*B*t^2*sin(pi*x)^2*cos(B*x + C*t) + 2*pi*A^3*t^2*(sin(B*x + C*t) + 2)*sin(pi*x)*cos(pi*x) + A^2*C*t*sin(pi*x)*cos(B*x + C*t) + A^2*(sin(B*x + C*t) + 2)*sin(pi*x) - A*B*sin(B*x + C*t)'
vars = 'A B C'
vals = '${A} ${B} ${C}'
[]
[rhoE_src_fn]
type = ParsedFunction
value = 'A*C*(A^2*t^2*sin(pi*x)^2/2 + (cos(B*x + C*t) + 2)/((gamma - 1)*(sin(B*x + C*t) + 2)))*cos(B*x + C*t) + pi*A*t*(A*(A^2*t^2*sin(pi*x)^2/2 + (cos(B*x + C*t) + 2)/((gamma - 1)*(sin(B*x + C*t) + 2)))*(sin(B*x + C*t) + 2) + A*(cos(B*x + C*t) + 2))*cos(pi*x) + A*t*(A*B*(A^2*t^2*sin(pi*x)^2/2 + (cos(B*x + C*t) + 2)/((gamma - 1)*(sin(B*x + C*t) + 2)))*cos(B*x + C*t) - A*B*sin(B*x + C*t) + A*(sin(B*x + C*t) + 2)*(pi*A^2*t^2*sin(pi*x)*cos(pi*x) - B*sin(B*x + C*t)/((gamma - 1)*(sin(B*x + C*t) + 2)) - B*(cos(B*x + C*t) + 2)*cos(B*x + C*t)/((gamma - 1)*(sin(B*x + C*t) + 2)^2)))*sin(pi*x) + A*(sin(B*x + C*t) + 2)*(A^2*t*sin(pi*x)^2 - C*sin(B*x + C*t)/((gamma - 1)*(sin(B*x + C*t) + 2)) - C*(cos(B*x + C*t) + 2)*cos(B*x + C*t)/((gamma - 1)*(sin(B*x + C*t) + 2)^2))'
vars = 'A B C gamma'
vals = '${A} ${B} ${C} ${gamma}'
[]
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = ${gamma}
molar_mass = ${M}
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp
# geometry
position = '0 0 0'
orientation = '1 0 0'
length = 1.0
n_elems = ${n_elems}
A = ${area}
# IC
initial_p = p_fn
initial_T = T_fn
initial_vel = 0
f = 0
[]
[left_boundary]
type = InletFunction1Phase
input = 'pipe:in'
p = p_fn
rho = rho_fn
vel = vel_fn
[]
[right_boundary]
type = InletFunction1Phase
input = 'pipe:out'
p = p_fn
rho = rho_fn
vel = vel_fn
[]
[]
[Kernels]
[rho_src]
type = BodyForce
variable = rhoA
function = rho_src_fn
value = ${aA}
[]
[rhou_src]
type = BodyForce
variable = rhouA
function = rhou_src_fn
value = ${aA}
[]
[rhoE_src]
type = BodyForce
variable = rhoEA
function = rhoE_src_fn
value = ${aA}
[]
[]
[Postprocessors]
[rho_err]
type = ElementL1Error
variable = rho
function = rho_fn
execute_on = 'INITIAL TIMESTEP_END'
[]
[vel_err]
type = ElementL1Error
variable = vel
function = vel_fn
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_err]
type = ElementL1Error
variable = p
function = p_fn
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
[TimeIntegrator]
type = ExplicitSSPRungeKutta
order = 3
[]
start_time = 0
dt = ${dt}
end_time = ${t_end}
abort_on_solve_fail = true
[Quadrature]
type = GAUSS
order = FIRST
[]
[]
[Outputs]
csv = true
execute_on = 'FINAL'
velocity_as_vector = false
[]
(modules/thermal_hydraulics/test/tests/problems/lax_shock_tube/lax_shock_tube.i)
# This test problem is the Lax shock tube test problem,
# which is a Riemann problem with the following parameters:
# * domain = (0,1)
# * gravity = 0
# * EoS: Ideal gas EoS with gamma = 1.4, R = 0.71428571428571428571
# * interface: x = 0.5
# * typical end time: 0.15
# Left initial values:
# * rho = 0.445
# * vel = 0.692
# * p = 3.52874226
# Right initial values:
# * rho = 0.5
# * vel = 0
# * p = 0.571
[GlobalParams]
gravity_vector = '0 0 0'
rdg_slope_reconstruction = minmod
closures = simple_closures
[]
[Functions]
[p_ic_fn]
type = PiecewiseConstant
axis = x
direction = right
x = '0.5 1.0'
y = '3.52874226 0.571'
[]
[T_ic_fn]
type = PiecewiseConstant
axis = x
direction = right
x = '0.5 1.0'
y = '11.1016610426966 1.5988'
[]
[vel_ic_fn]
type = PiecewiseConstant
axis = x
direction = right
x = '0.5 1.0'
y = '0.692 0.0'
[]
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 11.64024372
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp
# geometry
position = '0 0 0'
orientation = '1 0 0'
length = 1.0
n_elems = 100
A = 1.0
# IC
initial_T = T_ic_fn
initial_p = p_ic_fn
initial_vel = vel_ic_fn
f = 0
[]
[left_boundary]
type = FreeBoundary1Phase
input = 'pipe:in'
[]
[right_boundary]
type = FreeBoundary1Phase
input = 'pipe:out'
[]
[]
[Executioner]
type = Transient
[TimeIntegrator]
type = ExplicitSSPRungeKutta
# add order via 'cli_args' in 'tests'
[]
solve_type = LINEAR
l_tol = 1e-4
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 60
# run to t = 0.15
start_time = 0.0
dt = 1e-3
num_steps = 150
abort_on_solve_fail = true
[]
[Outputs]
file_base = 'lax_shock_tube'
velocity_as_vector = false
execute_on = 'initial timestep_end'
[out]
type = Exodus
show = 'rho p vel'
[]
[]
(modules/thermal_hydraulics/test/tests/components/simple_turbine_1phase/phy.conservation.i)
[GlobalParams]
initial_p = 1e6
initial_T = 517
initial_vel = 4.3
initial_vel_x = 4.3
initial_vel_y = 0
initial_vel_z = 0
fp = fp
closures = simple_closures
f = 0
rdg_slope_reconstruction = minmod
gravity_vector = '0 0 0'
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.01
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe1:in'
m_dot = 10
T = 517
[]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 10
A = 1
[]
[turbine]
type = SimpleTurbine1Phase
connections = 'pipe1:out pipe2:in'
position = '1 0 0'
volume = 1
A_ref = 1.0
K = 0
on = true
power = 1000
[]
[pipe2]
type = FlowChannel1Phase
position = '1. 0 0'
orientation = '1 0 0'
length = 1
n_elems = 10
A = 1
[]
[outlet]
type = Outlet1Phase
input = 'pipe2:out'
p = 1e6
[]
[]
[Postprocessors]
[mass_in]
type = ADFlowBoundaryFlux1Phase
equation = mass
boundary = inlet
[]
[mass_out]
type = ADFlowBoundaryFlux1Phase
equation = mass
boundary = outlet
[]
[mass_diff]
type = LinearCombinationPostprocessor
pp_coefs = '1 -1'
pp_names = 'mass_in mass_out'
[]
[p_in]
type = SideAverageValue
boundary = pipe1:in
variable = p
[]
[vel_in]
type = SideAverageValue
boundary = pipe1:in
variable = vel_x
[]
[momentum_in]
type = ADFlowBoundaryFlux1Phase
equation = momentum
boundary = inlet
[]
[momentum_out]
type = ADFlowBoundaryFlux1Phase
equation = momentum
boundary = outlet
[]
[dP]
type = ParsedPostprocessor
pp_names = 'p_in W_dot'
function = 'p_in * (1 - (1-W_dot/(10*2910.06*517))^(1.4/0.4))'
[]
[momentum_diff]
type = LinearCombinationPostprocessor
pp_coefs = '1 -1 -1'
pp_names = 'momentum_in momentum_out dP' # momentum source = -dP * A and A=1
[]
[energy_in]
type = ADFlowBoundaryFlux1Phase
equation = energy
boundary = inlet
[]
[energy_out]
type = ADFlowBoundaryFlux1Phase
equation = energy
boundary = outlet
[]
[W_dot]
type = ScalarVariable
variable = turbine:W_dot
[]
[energy_diff]
type = LinearCombinationPostprocessor
pp_coefs = '1 -1 -1'
pp_names = 'energy_in energy_out W_dot'
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
start_time = 0
dt = 1
num_steps = 30
abort_on_solve_fail = true
solve_type = 'newton'
line_search = 'basic'
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu'
nl_rel_tol = 1e-7
nl_abs_tol = 2e-6
nl_max_its = 10
l_tol = 1e-3
[]
[Outputs]
[csv]
type = CSV
show = 'mass_diff energy_diff momentum_diff'
execute_on = 'final'
[]
[]
(modules/thermal_hydraulics/test/tests/components/supersonic_inlet/err.i)
[GlobalParams]
gravity_vector = '0 0 0'
closures = simple_closures
fp = fp
f = 0.0
initial_T = 300
initial_p = 1e5
initial_vel = 0
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.02897
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[in]
type = SupersonicInlet
input = 'pipe:in'
vel = 500
T = 300
p = 1e5
[]
[pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 0'
length = 0.5
n_elems = 2
A = 0.1
[]
[out]
type = Outlet1Phase
input = 'pipe:out'
p = 1e5
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 20
l_tol = 1e-4
start_time = 0.0
end_time = 1.0
dt = 0.01
abort_on_solve_fail = true
[]
(modules/thermal_hydraulics/tutorials/single_phase_flow/01_flow_channel.i)
T_in = 300. # K
m_dot_in = 1e-4 # kg/s
press = 1e5 # Pa
[GlobalParams]
initial_p = ${press}
initial_vel = 0
initial_T = ${T_in}
rdg_slope_reconstruction = full
closures = simple_closures
fp = he
[]
[Modules/FluidProperties]
[he]
type = IdealGasFluidProperties
molar_mass = 4e-3
gamma = 1.67
k = 0.2556
mu = 3.22639e-5
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'core_chan:in'
m_dot = ${m_dot_in}
T = ${T_in}
[]
[core_chan]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 1'
length = 1
n_elems = 10
A = 7.2548e-3
D_h = 7.0636e-2
f = 1.6
[]
[outlet]
type = Outlet1Phase
input = 'core_chan:out'
p = ${press}
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 2
dt = 0.1
line_search = basic
solve_type = NEWTON
nl_rel_tol = 1e-5
nl_abs_tol = 1e-5
nl_max_its = 5
[]
[Outputs]
exodus = true
[]
(modules/thermal_hydraulics/test/tests/components/shaft_connected_turbine_1phase/shaft_motor_turbine.i)
area = 0.2359
dt = 1.e-3
[GlobalParams]
initial_p = 2e5
initial_T = 600
initial_vel = 100
initial_vel_x = 100
initial_vel_y = 0
initial_vel_z = 0
A = ${area}
A_ref = ${area}
f = 100
scaling_factor_1phase = '0.04 0.04 0.04e-5'
closures = simple_closures
fp = fp
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[turbine]
type = ShaftConnectedTurbine1Phase
inlet = 'pipe:out'
outlet = 'pipe:in'
position = '0 0 0'
volume = 0.2
inertia_coeff = '1 1 1 1'
inertia_const = 1.61397
speed_cr_I = 1e12
speed_cr_fr = 0
tau_fr_coeff = '0 0 0 0'
tau_fr_const = 0
omega_rated = 100
D_wheel = 0.4
head_coefficient = head
power_coefficient = power
[]
[pipe]
type = FlowChannel1Phase
position = '0.1 0 0'
orientation = '1 0 0'
length = 10
n_elems = 20
initial_p = 2e6
[]
[dyno]
type = ShaftConnectedMotor
inertia = 1e2
torque = -1e3
[]
[shaft]
type = Shaft
connected_components = 'dyno turbine'
initial_speed = 300
[]
[]
[Functions]
[head]
type = PiecewiseLinear
x = '0 7e-3 1e-2'
y = '0 15 20'
[]
[power]
type = PiecewiseLinear
x = '0 6e-3 1e-2'
y = '0 0.05 0.18'
[]
[S_energy_fcn]
type = ParsedFunction
value = '-(tau_driving+tau_fr)*omega'
vars = 'tau_driving tau_fr omega'
vals = 'turbine:driving_torque turbine:friction_torque shaft:omega'
[]
[energy_conservation_fcn]
type = ParsedFunction
value = '(E_change - S_energy * dt) / E_tot'
vars = 'E_change S_energy dt E_tot'
vals = 'E_change S_energy ${dt} E_tot'
[]
[]
[Postprocessors]
# mass conservation
[mass_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoA
block = 'pipe'
execute_on = 'initial timestep_end'
[]
[mass_turbine]
type = ScalarVariable
variable = turbine:rhoV
execute_on = 'initial timestep_end'
[]
[mass_tot]
type = SumPostprocessor
values = 'mass_pipes mass_turbine'
execute_on = 'initial timestep_end'
[]
[mass_conservation]
type = ChangeOverTimePostprocessor
postprocessor = mass_tot
change_with_respect_to_initial = true
compute_relative_change = true
execute_on = 'initial timestep_end'
[]
# energy conservation
[E_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoEA
block = 'pipe'
execute_on = 'initial timestep_end'
[]
[E_turbine]
type = ScalarVariable
variable = turbine:rhoEV
execute_on = 'initial timestep_end'
[]
[E_tot]
type = LinearCombinationPostprocessor
pp_coefs = '1 1'
pp_names = 'E_pipes E_turbine'
execute_on = 'initial timestep_end'
[]
[S_energy]
type = FunctionValuePostprocessor
function = S_energy_fcn
execute_on = 'initial timestep_end'
[]
[E_change]
type = ChangeOverTimePostprocessor
postprocessor = E_tot
execute_on = 'initial timestep_end'
[]
# This should also execute on initial. This value is
# lagged by one timestep as a workaround to moose issue #13262.
[energy_conservation]
type = FunctionValuePostprocessor
function = energy_conservation_fcn
execute_on = 'timestep_end'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'implicit-euler'
dt = ${dt}
num_steps = 6
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-6
nl_max_its = 15
l_tol = 1e-4
l_max_its = 10
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Outputs]
velocity_as_vector = false
[]
(modules/thermal_hydraulics/test/tests/problems/area_constriction/area_constriction_junction.i)
# This test features air flowing through a channel whose cross-sectional area
# shrinks to half its value in the right half. Assuming incompressible flow
# conditions, such as having a low Mach number, the velocity should approximately
# double from inlet to outlet. In this version of the test, the area discontinuity
# is achieved by connecting two flow channels with a junction.
p_outlet = 1e5
[GlobalParams]
gravity_vector = '0 0 0'
initial_T = 300
initial_p = ${p_outlet}
fp = fp
closures = simple_closures
f = 0
scaling_factor_1phase = '1 1 1e-5'
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[inlet]
type = InletDensityVelocity1Phase
input = 'pipe1:in'
rho = 1.16263315948279 # rho @ (p = 1e5 Pa, T = 300 K)
vel = 1
[]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 0.5
n_elems = 50
A = 1
initial_vel = 1
[]
[junction]
type = JunctionOneToOne1Phase
connections = 'pipe1:out pipe2:in'
[]
[pipe2]
type = FlowChannel1Phase
position = '0.5 0 0'
orientation = '1 0 0'
length = 0.5
n_elems = 50
A = 0.5
initial_vel = 2
[]
[outlet]
type = Outlet1Phase
input = 'pipe2:out'
p = ${p_outlet}
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
end_time = 10
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.001
optimal_iterations = 5
iteration_window = 1
growth_factor = 1.2
[]
steady_state_detection = true
solve_type = PJFNK
nl_rel_tol = 1e-10
nl_abs_tol = 1e-8
nl_max_its = 15
l_tol = 1e-3
l_max_its = 10
[]
[Outputs]
exodus = true
velocity_as_vector = false
show = 'A rho vel p'
[]
(modules/thermal_hydraulics/test/tests/components/simple_turbine_1phase/phy.test.i)
[GlobalParams]
initial_p = 1e6
initial_T = 517
initial_vel = 1.0
initial_vel_x = 1
initial_vel_y = 0
initial_vel_z = 0
fp = fp
closures = simple_closures
f = 0
gravity_vector = '0 0 0'
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.01
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe1:in'
m_dot = 10
T = 517
[]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 10
A = 1
[]
[turbine]
type = SimpleTurbine1Phase
connections = 'pipe1:out pipe2:in'
position = '1 0 0'
volume = 1
on = true
power = 1000
[]
[pipe2]
type = FlowChannel1Phase
position = '1. 0 0'
orientation = '1 0 0'
length = 1
n_elems = 10
A = 1
[]
[outlet]
type = Outlet1Phase
input = 'pipe2:out'
p = 1e6
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
start_time = 0
dt = 1
num_steps = 10
abort_on_solve_fail = true
solve_type = 'newton'
line_search = 'basic'
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu'
nl_rel_tol = 1e-6
nl_abs_tol = 1e-5
nl_max_its = 5
l_tol = 1e-4
[]
[Outputs]
exodus = true
show = 'p T vel'
velocity_as_vector = false
interval = 5
[]
(modules/thermal_hydraulics/test/tests/components/shaft_connected_pump_1phase/pump_coastdown.i)
# Pump data used in this test comes from the Semiscale Program, summarized in NUREG/CR-4945
initial_T = 393.15
area = 1e-2
dt = 0.005
[GlobalParams]
initial_p = 1.4E+07
initial_T = ${initial_T}
initial_vel = 0.01
initial_vel_x = 0.01
initial_vel_y = 0
initial_vel_z = 0
A = ${area}
A_ref = ${area}
f = 100
scaling_factor_1phase = '1 1 1e-3'
closures = simple_closures
rdg_slope_reconstruction = minmod
fp = fp
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pump]
type = ShaftConnectedPump1Phase
inlet = 'pipe:out'
outlet = 'pipe:in'
position = '0 0 0'
scaling_factor_rhoEV = 1e-5
volume = 0.3
inertia_coeff = '1 1 1 1'
inertia_const = 0.5
omega_rated = 314
speed_cr_I = 1e12
speed_cr_fr = 0.001
torque_rated = 47.1825
volumetric_rated = 1
head_rated = 58.52
tau_fr_coeff = '4 0 80 0'
tau_fr_const = 8
head = head_fcn
torque_hydraulic = torque_fcn
density_rated = 124.2046
[]
[pipe]
type = FlowChannel1Phase
position = '0.6096 0 0'
orientation = '1 0 0'
length = 10
n_elems = 20
[]
[shaft]
type = Shaft
connected_components = 'pump'
initial_speed = 1
[]
[]
[Functions]
[head_fcn]
type = PiecewiseLinear
data_file = semiscale_head_data.csv
format = columns
[]
[torque_fcn]
type = PiecewiseLinear
data_file = semiscale_torque_data.csv
format = columns
[]
[S_energy_fcn]
type = ParsedFunction
value = '-tau_hyd * omega'
vars = 'tau_hyd omega'
vals = 'pump:hydraulic_torque shaft:omega'
[]
[energy_conservation_fcn]
type = ParsedFunction
value = '(E_change - S_energy * dt) / E_tot'
vars = 'E_change S_energy dt E_tot'
vals = 'E_change S_energy ${dt} E_tot'
[]
[]
[Postprocessors]
# mass conservation
[mass_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoA
block = 'pipe'
execute_on = 'initial timestep_end'
[]
[mass_pump]
type = ScalarVariable
variable = pump:rhoV
execute_on = 'initial timestep_end'
[]
[mass_tot]
type = SumPostprocessor
values = 'mass_pipes mass_pump'
execute_on = 'initial timestep_end'
[]
[mass_conservation]
type = ChangeOverTimePostprocessor
postprocessor = mass_tot
change_with_respect_to_initial = true
compute_relative_change = true
execute_on = 'initial timestep_end'
[]
# energy conservation
[E_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoEA
block = 'pipe'
execute_on = 'initial timestep_end'
[]
[E_pump]
type = ScalarVariable
variable = pump:rhoEV
execute_on = 'initial timestep_end'
[]
[E_tot]
type = LinearCombinationPostprocessor
pp_coefs = '1 1'
pp_names = 'E_pipes E_pump'
execute_on = 'initial timestep_end'
[]
[S_energy]
type = FunctionValuePostprocessor
function = S_energy_fcn
execute_on = 'initial timestep_end'
[]
[E_change]
type = ChangeOverTimePostprocessor
postprocessor = E_tot
execute_on = 'initial timestep_end'
[]
# This should also execute on initial. This value is
# lagged by one timestep as a workaround to moose issue #13262.
[energy_conservation]
type = FunctionValuePostprocessor
function = energy_conservation_fcn
execute_on = 'timestep_end'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
dt = ${dt}
num_steps = 40
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 15
l_tol = 1e-4
l_max_its = 10
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Outputs]
velocity_as_vector = false
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'
[../]
[]
[Modules]
[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/cns/stagnation_inlet/supersonic_nozzle_hllc.i)
stagnation_pressure = 1
stagnation_temperature = 1
[GlobalParams]
fp = fp
[]
[Debug]
show_material_props = true
[]
[Mesh]
[file]
type = FileMeshGenerator
file = supersonic_nozzle.e
[]
[]
[Modules]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[]
[Variables]
[rho]
family = MONOMIAL
order = CONSTANT
fv = true
initial_condition = 0.0034
[]
[rho_u]
family = MONOMIAL
order = CONSTANT
fv = true
initial_condition = 1e-4
outputs = none
[]
[rho_v]
family = MONOMIAL
order = CONSTANT
fv = true
outputs = none
[]
[rho_E]
family = MONOMIAL
order = CONSTANT
fv = true
initial_condition = 2.5
[]
[]
[FVKernels]
# Mass conservation
[mass_time]
type = FVTimeKernel
variable = rho
[]
[mass_advection]
type = CNSFVMassHLLC
variable = rho
[]
# Momentum x conservation
[momentum_x_time]
type = FVTimeKernel
variable = rho_u
[]
[momentum_x_advection]
type = CNSFVMomentumHLLC
variable = rho_u
momentum_component = x
[]
# Momentum y conservation
[momentum_y_time]
type = FVTimeKernel
variable = rho_v
[]
[momentum_y_advection]
type = CNSFVMomentumHLLC
variable = rho_v
momentum_component = y
[]
# Fluid energy conservation
[fluid_energy_time]
type = FVTimeKernel
variable = rho_E
[]
[fluid_energy_advection]
type = CNSFVFluidEnergyHLLC
variable = rho_E
[]
[]
[FVBCs]
## inflow stagnation boundaries
[mass_stagnation_inflow]
type = CNSFVHLLCMassStagnationInletBC
variable = rho
stagnation_pressure = ${stagnation_pressure}
stagnation_temperature = ${stagnation_temperature}
boundary = left
[]
[momentum_x_stagnation_inflow]
type = CNSFVHLLCMomentumStagnationInletBC
variable = rho_u
momentum_component = x
stagnation_pressure = ${stagnation_pressure}
stagnation_temperature = ${stagnation_temperature}
boundary = left
[]
[momentum_y_stagnation_inflow]
type = CNSFVHLLCMomentumStagnationInletBC
variable = rho_v
momentum_component = y
stagnation_pressure = ${stagnation_pressure}
stagnation_temperature = ${stagnation_temperature}
boundary = left
[../]
[fluid_energy_stagnation_inflow]
type = CNSFVHLLCFluidEnergyStagnationInletBC
variable = rho_E
stagnation_pressure = ${stagnation_pressure}
stagnation_temperature = ${stagnation_temperature}
boundary = left
[]
## outflow implicit conditions
[mass_outflow]
type = CNSFVHLLCMassImplicitBC
variable = rho
boundary = right
[]
[momentum_x_outflow]
type = CNSFVHLLCMomentumImplicitBC
variable = rho_u
momentum_component = x
boundary = right
[]
[momentum_y_outflow]
type = CNSFVHLLCMomentumImplicitBC
variable = rho_v
momentum_component = y
boundary = right
[]
[fluid_energy_outflow]
type = CNSFVHLLCFluidEnergyImplicitBC
variable = rho_E
boundary = right
[]
# wall conditions
[momentum_x_pressure_wall]
type = CNSFVMomImplicitPressureBC
variable = rho_u
momentum_component = x
boundary = wall
[]
[momentum_y_pressure_wall]
type = CNSFVMomImplicitPressureBC
variable = rho_v
momentum_component = y
boundary = wall
[]
[]
[AuxVariables]
[Ma]
family = MONOMIAL
order = CONSTANT
[]
[Ma_layered]
family = MONOMIAL
order = CONSTANT
[]
[]
[UserObjects]
[layered_Ma_UO]
type = LayeredAverage
variable = Ma
num_layers = 100
direction = x
[]
[]
[AuxKernels]
[Ma_aux]
type = NSMachAux
variable = Ma
fluid_properties = fp
use_material_properties = true
[]
[Ma_layered_aux]
type = SpatialUserObjectAux
variable = Ma_layered
user_object = layered_Ma_UO
[]
[]
[Materials]
[var_mat]
type = ConservedVarValuesMaterial
rho = rho
rhou = rho_u
rhov = rho_v
rho_et = rho_E
[]
[fluid_props]
type = GeneralFluidProps
porosity = 1
characteristic_length = 1
[]
[sound_speed]
type = SoundspeedMat
fp = fp
[]
[]
[Postprocessors]
[cfl_dt]
type = ADCFLTimeStepSize
c_names = 'sound_speed'
vel_names = 'speed'
CFL = 0.5
[]
[outflow_Ma]
type = SideAverageValue
variable = Ma
boundary = right
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[]
[Executioner]
type = Transient
end_time = 0.1
[TimeIntegrator]
type = ExplicitSSPRungeKutta
order = 2
[]
l_tol = 1e-8
[TimeStepper]
type = PostprocessorDT
postprocessor = cfl_dt
[]
[]
[VectorPostprocessors]
[Ma_layered]
type = LineValueSampler
variable = Ma_layered
start_point = '0 0 0'
end_point = '10 0 0'
num_points = 100
sort_by = x
[]
[]
[Outputs]
exodus = true
[]
(modules/fluid_properties/test/tests/fp_interrogator/2ph.p.i)
[FluidPropertiesInterrogator]
fp = fp
p = 1e5
[]
[Modules]
[./FluidProperties]
[./fp_liquid]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.02900055737704918
mu = 1.823e-05
k = 0.02568
[../]
[./fp_vapor]
type = IdealGasFluidProperties
gamma = 1.1
molar_mass = 0.027714866
mu = 1.7e-05
k = 0.05
[../]
[./fp]
type = TestTwoPhaseFluidProperties
fp_liquid = fp_liquid
fp_vapor = fp_vapor
[../]
[../]
[]
(modules/navier_stokes/test/tests/finite_volume/cns/benchmark_shock_tube_1D/hllc_sod_shocktube.i)
rho_left = 1
E_left = 2.501505578
u_left = 1e-15
rho_right = 0.125
E_right = 1.999770935
u_right = 1e-15
middle = 50
[GlobalParams]
fp = fp
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = 0
xmax = ${fparse 2 * middle}
nx = 1000
[]
[]
[Modules]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[]
[Variables]
[rho]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[rho_u]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[rho_E]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[AuxVariables]
[rho_a]
order = CONSTANT
family = MONOMIAL
[]
[]
[FVKernels]
[mass_time]
type = FVTimeKernel
variable = rho
[]
[mass_advection]
type = CNSFVMassHLLC
variable = rho
[]
[momentum_time]
type = FVTimeKernel
variable = rho_u
[]
[momentum_advection]
type = CNSFVMomentumHLLC
variable = rho_u
momentum_component = x
[]
[fluid_energy_time]
type = FVTimeKernel
variable = rho_E
[../]
[fluid_energy_advection]
type = CNSFVFluidEnergyHLLC
variable = rho_E
[]
[]
[FVBCs]
[mass_implicit]
type = CNSFVHLLCMassImplicitBC
variable = rho
fp = fp
boundary = 'left right'
[]
[mom_implicit]
type = CNSFVHLLCMomentumImplicitBC
variable = rho_u
momentum_component = x
fp = fp
boundary = 'left right'
[]
[fluid_energy_implicit]
type = CNSFVHLLCFluidEnergyImplicitBC
variable = rho_E
fp = fp
boundary = 'left right'
[]
[]
[ICs]
[rho_ic]
type = FunctionIC
variable = rho
function = 'if (x < ${middle}, ${rho_left}, ${rho_right})'
[]
[rho_u_ic]
type = FunctionIC
variable = rho_u
function = 'if (x < ${middle}, ${fparse rho_left * u_left}, ${fparse rho_right * u_right})'
[]
[rho_E_ic]
type = FunctionIC
variable = rho_E
function = 'if (x < ${middle}, ${fparse E_left * rho_left}, ${fparse E_right * rho_right})'
[]
[]
[Materials]
[var_mat]
type = ConservedVarValuesMaterial
rho = rho
rhou = rho_u
rho_et = rho_E
fp = fp
[]
[]
[Preconditioning]
active = ''
[./smp]
type = SMP
full = true
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[../]
[]
[Executioner]
type = Transient
[TimeIntegrator]
type = ExplicitSSPRungeKutta
order = 2
[]
l_tol = 1e-8
start_time = 0.0
dt = 1e-2
end_time = 20
abort_on_solve_fail = true
[]
[Outputs]
exodus = true
perf_graph = true
[]
(modules/fluid_properties/test/tests/fp_interrogator/1ph.rho_rhou_rhoE.i)
[FluidPropertiesInterrogator]
fp = fp
rho = 0.5
rhou = 0.5
rhoE = 2.75
[]
[Modules]
[./FluidProperties]
[./fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 11.640243719999999
[../]
[../]
[]
(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
[]
[]
[Modules]
[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
value = '3.48788261470924*cos(x)'
[]
[forcing_rho]
type = ParsedFunction
value = '-3.45300378856215*sin(1.1*x)'
[]
[exact_rho_ud]
type = ParsedFunction
value = '3.13909435323832*cos(1.1*x)'
[]
[forcing_rho_ud]
type = ParsedFunction
value = '-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
value = '26.7439413073546*cos(1.2*x)'
[]
[forcing_rho_et]
type = ParsedFunction
value = '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
value = '0.0106975765229418*cos(1.2*x)/cos(x) - 0.000697576522941848*cos(1.1*x)^2/cos(x)^2'
[]
[exact_eps_p]
type = ParsedFunction
value = '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
value = '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
value = '0.9*cos(1.1*x)/cos(x)'
[]
[exact_superficial_velocity]
type = ParsedVectorFunction
value_x = '0.9*cos(1.1*x)/cos(x)'
[]
[eps]
type = ParsedFunction
value = '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'
[]
[]
(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
[]
[]
[Modules]
[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
value = '3+3+1e5 - x'
[]
[T_func]
type = ParsedFunction
value = '273.15 + x*y*2'
[]
[vx]
type = ParsedFunction
value = '14'
[]
[vy]
type = ParsedFunction
value = '10 + x'
[]
[vz]
type = ParsedFunction
value = '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/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
[]
[]
[Modules]
[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'
[]
[]
[Materials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp'
prop_values = '${cp}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T_fluid
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyMaterial
temperature = T_fluid
rho = ${rho}
[]
[]
[Functions]
[forcing_rho]
type = ParsedFunction
value = '-3.45300378856215*sin(1.1*x)'
[]
[forcing_rho_ud]
type = ADParsedFunction
value = '-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
value = '0.0106975765229418*cos(1.2*x)/cos(x) - 0.000697576522941848*cos(1.1*x)^2/cos(x)^2'
[]
[exact_p]
type = ParsedFunction
value = '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
value = '0.9*cos(1.1*x)/cos(x)'
[]
[eps]
type = ParsedFunction
value = '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'
[]
[]
(modules/thermal_hydraulics/tutorials/single_phase_flow/03_upper_loop.i)
T_in = 300. # K
m_dot_in = 1e-4 # kg/s
press = 1e5 # Pa
# core parameters
core_length = 1. # m
core_n_elems = 10
core_dia = ${units 2. cm -> m}
core_pitch = ${units 8.7 cm -> m}
# pipe parameters
pipe_dia = ${units 10. cm -> m}
tot_power = 100 # W
[GlobalParams]
initial_p = ${press}
initial_vel = 0
initial_T = ${T_in}
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
rdg_slope_reconstruction = full
closures = simple_closures
fp = he
f = 0.4
[]
[Modules/FluidProperties]
[he]
type = IdealGasFluidProperties
molar_mass = 4e-3
gamma = 1.67
k = 0.2556
mu = 3.22639e-5
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[HeatStructureMaterials]
[steel]
type = SolidMaterialProperties
rho = 8050
k = 45
cp = 466
[]
[]
[Components]
[total_power]
type = TotalPower
power = ${tot_power}
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'core_chan:in'
m_dot = ${m_dot_in}
T = ${T_in}
[]
[core_chan]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
A = ${fparse core_pitch * core_pitch - pi * core_dia * core_dia / 4.}
D_h = ${core_dia}
f = 1.6
[]
[core_hs]
type = HeatStructureCylindrical
position = '0 0 0'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
names = 'block'
widths = '${fparse core_dia / 2.}'
materials = 'steel'
n_part_elems = 3
[]
[core_heating]
type = HeatSourceFromTotalPower
hs = core_hs
regions = block
power = total_power
[]
[core_ht]
type = HeatTransferFromHeatStructure1Phase
flow_channel = core_chan
hs = core_hs
hs_side = outer
P_hf = ${fparse pi * core_dia}
Hw = 1.36
[]
[jct1]
type = JunctionParallelChannels1Phase
position = '0 0 1'
connections = 'core_chan:out up_pipe:in'
volume = 1e-3
[]
[up_pipe]
type = FlowChannel1Phase
position = '0 0 1'
orientation = '0 0 1'
length = 1
n_elems = 10
A = ${fparse pi * pipe_dia * pipe_dia / 4.}
D_h = ${pipe_dia}
[]
[jct2]
type = VolumeJunction1Phase
position = '0 0 2'
connections = 'up_pipe:out top_pipe:in'
volume = 1e-3
[]
[top_pipe]
type = FlowChannel1Phase
position = '0 0 2'
orientation = '1 0 0'
length = 1
n_elems = 10
A = ${fparse pi * pipe_dia * pipe_dia / 4.}
D_h = ${pipe_dia}
[]
[jct3]
type = VolumeJunction1Phase
position = '1 0 2'
connections = 'top_pipe:out cooling_pipe:in'
volume = 1e-3
[]
[cooling_pipe]
type = FlowChannel1Phase
position = '1 0 2'
orientation = '0 0 -1'
length = 1
n_elems = 10
A = ${fparse pi * pipe_dia * pipe_dia / 4.}
D_h = ${pipe_dia}
[]
[cold_wall]
type = HeatTransferFromSpecifiedTemperature1Phase
flow_channel = cooling_pipe
T_wall = 300
Hw = 0.97
[]
[jct4]
type = VolumeJunction1Phase
position = '1 0 1'
connections = 'cooling_pipe:out down_pipe:in'
volume = 1e-3
[]
[down_pipe]
type = FlowChannel1Phase
position = '1 0 1'
orientation = '0 0 -1'
length = 1
n_elems = 10
A = ${fparse pi * pipe_dia * pipe_dia / 4.}
D_h = ${pipe_dia}
[]
[outlet]
type = Outlet1Phase
input = 'down_pipe:out'
p = ${press}
[]
[]
[Postprocessors]
[core_T_out]
type = SideAverageValue
boundary = core_chan:out
variable = T
[]
[hx_pri_T_out]
type = SideAverageValue
boundary = cooling_pipe:out
variable = T
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 1000
dt = 10
line_search = basic
solve_type = NEWTON
nl_rel_tol = 1e-5
nl_abs_tol = 1e-5
nl_max_its = 5
[]
[Outputs]
exodus = true
[console]
type = Console
max_rows = 1
outlier_variable_norms = false
[]
print_linear_residuals = false
[]
(modules/navier_stokes/test/tests/finite_element/cns/bump/bump.i)
# Euler flow of an ideal gas over a Gaussian "bump".
#
# The inlet is a stagnation pressure and temperature BC which
# corresponds to subsonic (M=0.5) flow with a static pressure of 1 atm
# and static temperature of 300K. The outlet consists of a
# weakly-imposed static pressure BC of 1 atm. The top and bottom
# walls of the channel weakly impose the "no normal flow" BC. The
# problem is initialized with freestream flow throughout the domain.
# Although this initial condition is less physically realistic, it
# helps the problem reach steady state more quickly.
#
# There is a sequence of uniformly-refined, geometry-fitted meshes
# from Yidong Xia available for solving this classical subsonic test
# problem (see the Mesh block below). A coarse grid is used for the
# actual regression test, but changing one line in the Mesh block is
# sufficient to run this problem with different meshes. An
# entropy-based error estimate is also provided, and can be used to
# demonstrate convergence of the numerical solution (since the true
# solution should produce zero entropy). The error should converge at
# second-order in this norm.
[Mesh]
# Bi-Linear elements
# file = SmoothBump_quad_ref1_Q1.msh # 84 elems, 65 nodes
# file = SmoothBump_quad_ref2_Q1.msh # 192 elems, 225 nodes
# file = SmoothBump_quad_ref3_Q1.msh # 768 elems, 833 nodes
# file = SmoothBump_quad_ref4_Q1.msh # 3072 elems, 3201 nodes
# file = SmoothBump_quad_ref5_Q1.msh # 12288 elems, 12545 nodes
# Bi-Quadratic elements
# file = SmoothBump_quad_ref0_Q2.msh # 32 elems, 65 nodes
# file = SmoothBump_quad_ref1_Q2.msh # 84 elems, 225 nodes
file = SmoothBump_quad_ref2_Q2.msh # 260 elems, 833 nodes
# file = SmoothBump_quad_ref3_Q2.msh # 900 elems, 3201 nodes
# file = SmoothBump_quad_ref4_Q2.msh # 3332 elems, 12545 nodes
# file = SmoothBump_quad_ref5_Q2.msh # 12804 elems, 49665 nodes
[]
[Modules]
[FluidProperties]
[ideal_gas]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.02897024320557491
[]
[]
[CompressibleNavierStokes]
# steady-state or transient
equation_type = transient
# fluid
fluid_properties = ideal_gas
# boundary conditions
stagnation_boundary = 1
stagnation_pressure = 120192.995549849 # Pa, Mach=0.5 at 1 atm
stagnation_temperature = 315 # K, Mach=0.5 at 1 atm
stagnation_flow_direction = '1 0'
no_penetration_boundary = '3 4'
static_pressure_boundary = 2
static_pressure = 101325 # Pa
# variable types, scalings and initial conditions
family = LAGRANGE
order = FIRST
total_energy_density_scaling = 9.869232667160121e-6
initial_pressure = 101325.
initial_temperature = 300.
initial_velocity = '173.594354746921 0 0' # Mach 0.5: = 0.5*sqrt(gamma*R*T)
pressure_variable_name = "p"
[]
[]
[Materials]
[fluid]
type = Air
block = 0 # 'MeshInterior'
rho = rho
rhou = rhou
rhov = rhov
rho_et = rho_et
vel_x = vel_x
vel_y = vel_y
temperature = temperature
ht = ht
# This value is not used in the Euler equations, but it *is* used
# by the stabilization parameter computation, which it decreases
# the amount of artificial viscosity added, so it's best to use a
# realistic value.
dynamic_viscosity = 0.0
fluid_properties = ideal_gas
[]
[]
[Postprocessors]
[entropy_error]
type = NSEntropyError
execute_on = 'initial timestep_end'
block = 0
rho_infty = 1.1768292682926829
p_infty = 101325
rho = rho
pressure = p
fluid_properties = ideal_gas
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
dt = 5.e-5
dtmin = 1.e-5
start_time = 0.0
num_steps = 10
nl_rel_tol = 1e-9
nl_max_its = 5
l_tol = 1e-4
l_max_its = 100
# We use trapezoidal quadrature. This improves stability by
# mimicking the "group variable" discretization approach.
[Quadrature]
type = TRAP
order = FIRST
[]
[]
[Outputs]
interval = 1
exodus = true
[]
[AuxVariables]
[rhoe][]
[enthalpy][]
[]
[AuxKernels]
[rhoe]
variable = rhoe
type = ParsedAux
function = 'rho_et'
args = 'rho_et'
execute_on = 'initial timestep_end'
[]
[enthalpy]
variable = enthalpy
type = ParsedAux
function = 'ht'
args = 'ht'
execute_on = 'initial timestep_end'
[]
[]
(modules/thermal_hydraulics/test/tests/misc/coupling_mD_flow/thm_non_overlapping.i)
T_in = 523.0
mdot = 10
pout = 7e6
[GlobalParams]
initial_p = ${pout}
initial_vel = 1
initial_T = ${T_in}
gravity_vector = '0 0 0'
closures = simple_closures
n_elems = 5
scaling_factor_1phase = '1 1e-2 1e-5'
f = 1
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.66
molar_mass = 0.004
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[inlet_bc]
type = InletMassFlowRateTemperature1Phase
input = 'inlet:in'
m_dot = ${mdot}
T = ${T_in}
[]
[inlet]
type = FlowChannel1Phase
fp = fp
position = '0 0 11'
orientation = '0 0 -1'
length = 1
A = 1
[]
[inlet_plenum]
type = VolumeJunction1Phase
position = '0 0 10'
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 1
connections = 'inlet:out bypass:in core_top:in'
volume = 1
[]
[bypass]
type = FlowChannel1Phase
fp = fp
position = '2 0 10'
orientation = '0 0 -1'
length = 10
A = 0.01
[]
[core_top]
type = FlowChannel1Phase
fp = fp
position = '0 0 10'
orientation = '0 0 -1'
length = 0.1
A = 9
[]
[core_top_bc]
type = Outlet1Phase
p = ${pout}
input = 'core_top:out'
[]
[core_bottom_bc]
type = InletMassFlowRateTemperature1Phase
input = 'core_bottom:in'
m_dot = ${mdot}
T = ${T_in}
[]
[core_bottom]
type = FlowChannel1Phase
fp = fp
position = '0 0 0.1'
orientation = '0 0 -1'
length = 0.1
A = 9
[]
[outlet_plenum]
type = VolumeJunction1Phase
position = '0 0 0'
initial_vel_x = 1
initial_vel_y = 0
initial_vel_z = 1
connections = 'bypass:out core_bottom:out outlet:in'
volume = 1
[]
[outlet]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '0 0 -1'
length = 1
A = 1
[]
[outlet_bc]
type = Outlet1Phase
p = ${pout}
input = 'outlet:out'
[]
[]
[ControlLogic]
[set_core_inlet_pressure]
type = SetComponentRealValueControl
component = core_top_bc
parameter = p
value = core_inlet_pressure
[]
[set_core_outlet_mdot]
type = SetComponentRealValueControl
component = core_bottom_bc
parameter = m_dot
value = core_outlet_mdot
[]
[set_core_outlet_temperature]
type = SetComponentRealValueControl
component = core_bottom_bc
parameter = T
value = core_outlet_temperature
[]
[]
[Postprocessors]
[core_inlet_pressure]
type = Receiver
default = ${pout}
[]
[core_outlet_mdot]
type = Receiver
default = ${mdot}
[]
[core_outlet_temperature]
type = Receiver
default = ${T_in}
[]
[core_outlet_pressure]
type = SideAverageValue
variable = p
boundary = 'core_bottom:in'
execute_on = 'INITIAL LINEAR TIMESTEP_END'
[]
[core_inlet_mdot]
type = SideAverageValue
variable = rhouA
boundary = 'core_top:out'
execute_on = 'INITIAL LINEAR TIMESTEP_END'
[]
[core_inlet_temperature]
type = SideAverageValue
variable = T
boundary = 'core_top:out'
execute_on = 'INITIAL LINEAR TIMESTEP_END'
[]
[bypass_inlet_pressure]
type = SideAverageValue
variable = p
boundary = 'bypass:in'
[]
[bypass_outlet_pressure]
type = SideAverageValue
variable = p
boundary = 'bypass:out'
[]
[bypass_pressure_drop]
type = DifferencePostprocessor
value1 = bypass_inlet_pressure
value2 = bypass_outlet_pressure
[]
[bypass_mdot]
type = SideAverageValue
variable = rhouA
boundary = 'bypass:out'
execute_on = 'INITIAL LINEAR TIMESTEP_END'
[]
[inlet_mdot]
type = SideAverageValue
variable = rhouA
boundary = 'inlet:in'
execute_on = 'INITIAL LINEAR TIMESTEP_END'
[]
[outlet_mdot]
type = SideAverageValue
variable = rhouA
boundary = 'outlet:out'
execute_on = 'INITIAL LINEAR TIMESTEP_END'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
timestep_tolerance = 1e-6
start_time = 0
end_time = 100
dt = 0.01
line_search = l2
nl_rel_tol = 1e-6
nl_abs_tol = 1e-4
nl_max_its = 25
l_tol = 1e-3
l_max_its = 20
petsc_options = '-snes_converged_reason'
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu '
[]
[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
[]
[]
[Modules]
[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
value_x = '0'
value_y = '${sup_mom_y_in}'
[]
[eps]
type = ParsedFunction
value = '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/navier_stokes/test/include/userobjects/TestConservedVarFluidProperties.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 "IdealGasFluidProperties.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
class TestConservedVarFluidProperties : public IdealGasFluidProperties
{
public:
static InputParameters validParams();
TestConservedVarFluidProperties(const InputParameters & parameters);
ADReal p_from_v_e(const ADReal & v, const ADReal & /*e*/) const override;
ADReal T_from_v_e(const ADReal & /*v*/, const ADReal & /*e*/) const override;
};
#pragma GCC diagnostic pop