- cvConstant volume specific heat
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Constant volume specific heat
- gammaHeat capacity ratio
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Heat capacity ratio
- p_infStiffness parameter
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Stiffness parameter
- qParameter defining zero point of internal energy
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Parameter defining zero point of internal energy
StiffenedGasFluidProperties
Fluid properties for a stiffened gas
A simple fluid class that implements a stiffened equation of state (Métayer et al., 2004) where is the ratio of specific heat capacities, is a constant that defines the zero reference state for internal energy, and is a constant representing the attraction between fluid molecules that makes the fluid stiff in comparison to an ideal gas. This equation of state is typically used to represent water that is under very high pressure.
Input Parameters
- M0Molar mass, kg/mol
Default:0
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Molar mass, kg/mol
- T_c0Critical temperature, K
Default:0
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Critical temperature, K
- allow_nonphysical_statesTrueAllows for non-physical states, e.g., negative density.
Default:True
C++ Type:bool
Unit:(no unit assumed)
Controllable:No
Description:Allows for non-physical states, e.g., negative density.
- e_c0Internal energy at the critical point, J/kg
Default:0
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Internal energy at the critical point, J/kg
- emit_on_nannoneWhether to raise a warning, an exception (usually triggering a retry with a smaller time step) or an error (ending the simulation)
Default:none
C++ Type:MooseEnum
Unit:(no unit assumed)
Options:none, warning, exception, error
Controllable:No
Description:Whether to raise a warning, an exception (usually triggering a retry with a smaller time step) or an error (ending the simulation)
- execute_onTIMESTEP_ENDThe list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
Default:TIMESTEP_END
C++ Type:ExecFlagEnum
Unit:(no unit assumed)
Options:XFEM_MARK, FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR_CONVERGENCE, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM
Controllable:No
Description:The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
- k0.6Thermal conductivity, W/(m-K)
Default:0.6
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Thermal conductivity, W/(m-K)
- mu0.001Dynamic viscosity, Pa.s
Default:0.001
C++ Type:double
Unit:(no unit assumed)
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
Unit:(no unit assumed)
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.
- q_prime0Parameter
Default:0
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Parameter
- rho_c0Critical density, kg/m3
Default:0
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Critical density, kg/m3
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Unit:(no unit assumed)
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Optional Parameters
- T_initial_guess400Temperature initial guess for Newton Method variable set conversion
Default:400
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Temperature initial guess for Newton Method variable set conversion
- p_initial_guess200000Pressure initial guess for Newton Method variable set conversion
Default:200000
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Pressure initial guess for Newton Method variable set conversion
- tolerance1e-08Tolerance for 2D Newton variable set conversion
Default:1e-08
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Tolerance for 2D Newton variable set conversion
Variable Set Conversions Newton Solve 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
Unit:(no unit assumed)
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).
- allow_imperfect_jacobiansFalsetrue to allow unimplemented property derivative terms to be set to zero for the AD API
Default:False
C++ Type:bool
Unit:(no unit assumed)
Controllable:No
Description:true to allow unimplemented property derivative terms to be set to zero for the AD API
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Unit:(no unit assumed)
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
Unit:(no unit assumed)
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- execution_order_group0Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
Default:0
C++ Type:int
Unit:(no unit assumed)
Controllable:No
Description:Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
- force_postauxFalseForces the UserObject to be executed in POSTAUX
Default:False
C++ Type:bool
Unit:(no unit assumed)
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
Unit:(no unit assumed)
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
Unit:(no unit assumed)
Controllable:No
Description:Forces the UserObject to be executed in PREIC during initial setup
- fp_typesingle-phase-fpType of the fluid property object
Default:single-phase-fp
C++ Type:FPType
Unit:(no unit assumed)
Controllable:No
Description:Type of the fluid property object
- 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
Unit:(no unit assumed)
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/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_3d/phy.conservation.i)
- (modules/thermal_hydraulics/test/tests/base/simulation/err.no_smp.i)
- (modules/thermal_hydraulics/test/tests/misc/initial_from_file/heat_transfer_from_heat_structure_3d/test.i)
- (modules/thermal_hydraulics/test/tests/controls/set_bool_value_control/test.i)
- (modules/thermal_hydraulics/test/tests/components/shaft_connected_pump_1phase/jacobian.i)
- (modules/thermal_hydraulics/test/tests/misc/restart_1phase/test.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_specified_temperature_1phase/clg.Hw.i)
- (modules/fluid_properties/test/tests/auxkernels/specific_enthalpy_aux.i)
- (modules/thermal_hydraulics/test/tests/components/pump_1phase/pipe_friction_pump_head_balance.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_3d/jac.1phase.i)
- (modules/thermal_hydraulics/test/tests/components/solid_wall_1phase/phy.3eqn.i)
- (modules/thermal_hydraulics/test/tests/auxkernels/mach_number/1phase.i)
- (modules/thermal_hydraulics/test/tests/problems/water_hammer/3eqn.i)
- (modules/thermal_hydraulics/test/tests/components/flow_channel_1phase/phy.par_fn.i)
- (modules/thermal_hydraulics/test/tests/components/outlet_1phase/phy.solidwall_outlet_3eqn.i)
- (modules/thermal_hydraulics/test/tests/components/flow_channel_1phase/err.free.i)
- (modules/thermal_hydraulics/test/tests/components/junction_parallel_channels_1phase/phy.unequal_area.i)
- (modules/thermal_hydraulics/test/tests/components/pump_1phase/clg.head.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_1phase/fin_enhancement.i)
- (modules/thermal_hydraulics/test/tests/components/flow_channel_1phase/phy.sub_discretization.i)
- (modules/thermal_hydraulics/test/tests/components/shaft_connected_compressor_1phase/jac.test.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_specified_temperature_1phase/clg.T_wall.i)
- (modules/thermal_hydraulics/test/tests/components/pump_1phase/pump_loop.i)
- (modules/thermal_hydraulics/test/tests/misc/surrogate_power_profile/surrogate_power_profile.i)
- (modules/thermal_hydraulics/test/tests/components/inlet_velocity_t_1phase/phy.reversed_flow.i)
- (modules/thermal_hydraulics/test/tests/actions/coupled_heat_transfer_action/sub_2phase.i)
- (modules/thermal_hydraulics/test/tests/components/form_loss_from_external_app_1phase/phy.form_loss_1phase.child.i)
- (modules/thermal_hydraulics/test/tests/components/volume_junction_1phase/equal_area_no_junction.i)
- (modules/thermal_hydraulics/test/tests/components/outlet_1phase/clg.ctrl_p_3eqn.i)
- (modules/thermal_hydraulics/test/tests/misc/uniform_refine/test.i)
- (modules/thermal_hydraulics/test/tests/components/shaft_connected_turbine_1phase/jac.test.i)
- (modules/thermal_hydraulics/test/tests/components/inlet_density_velocity_1phase/clg.densityvelocity_3eqn.i)
- (modules/thermal_hydraulics/test/tests/components/inlet_velocity_t_1phase/phy.velocity_t_3eqn.i)
- (modules/thermal_hydraulics/test/tests/components/inlet_velocity_t_1phase/clg.velocity_t_3eqn.i)
- (modules/thermal_hydraulics/test/tests/misc/initial_from_file/heat_transfer_from_heat_structure/test.i)
- (modules/thermal_hydraulics/test/tests/jacobians/materials/wall_friction_churchill.i)
- (modules/thermal_hydraulics/test/tests/components/heat_source_volumetric_1phase/err.base.i)
- (modules/thermal_hydraulics/test/tests/postprocessors/real_component_parameter_value/non_existent_par_name.i)
- (modules/thermal_hydraulics/test/tests/problems/abrupt_area_change_liquid/base.i)
- (modules/thermal_hydraulics/test/tests/controls/pid_control/test.i)
- (modules/thermal_hydraulics/test/tests/components/heat_source_volumetric_1phase/phy.conservation.1phase.i)
- (modules/thermal_hydraulics/test/tests/components/inlet_stagnation_p_t_1phase/clg.ctrl_T0_3eqn.i)
- (modules/thermal_hydraulics/test/tests/components/inlet_mass_flow_rate_1phase/clg.ctrl_m_dot_3eqn_rdg.i)
- (modules/thermal_hydraulics/test/tests/components/pump_1phase/pump_mass_energy_conservation.i)
- (modules/fluid_properties/test/tests/auxkernels/fluid_density_aux.i)
- (modules/thermal_hydraulics/test/tests/components/inlet_density_velocity_1phase/jacobian.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_3d/err.not_a_3d_hs.i)
- (modules/thermal_hydraulics/test/tests/components/pump_1phase/jacobian.i)
- (modules/thermal_hydraulics/test/tests/postprocessors/flow_boundary_flux_1phase/test.i)
- (modules/thermal_hydraulics/test/tests/components/flow_channel_1phase/phy.f_fn.3eqn.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_flux_1phase/phy.energy_heatflux_ss_1phase.i)
- (modules/thermal_hydraulics/test/tests/components/volume_junction_1phase/t_junction_1phase.i)
- (modules/thermal_hydraulics/test/tests/controls/set_component_real_value_control/test.i)
- (modules/thermal_hydraulics/test/tests/misc/initial_from_file/flow_channel/err.non_existent_block.i)
- (modules/thermal_hydraulics/test/tests/components/inlet_mass_flow_rate_1phase/phy.reversed_flow.i)
- (modules/thermal_hydraulics/test/tests/misc/adapt/single_block.i)
- (modules/thermal_hydraulics/test/tests/auxkernels/reynolds_number/1phase.i)
- (modules/thermal_hydraulics/test/tests/jacobians/kernels/one_d_energy_wall_heating.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_3d/phy.conservation_ss.i)
- (modules/fluid_properties/test/tests/auxkernels/stagnation_temperature_aux.i)
- (modules/thermal_hydraulics/test/tests/components/inlet_density_velocity_1phase/phy.densityvelocity_3eqn.i)
- (modules/thermal_hydraulics/test/tests/components/pump_1phase/pump_pressure_check.i)
- (modules/thermal_hydraulics/test/tests/components/component/err.setup_status.i)
- (modules/thermal_hydraulics/test/tests/components/junction_parallel_channels_1phase/equal_area_with_junction.i)
- (modules/thermal_hydraulics/test/tests/jacobians/constraints/mass_free_constraint.i)
- (modules/thermal_hydraulics/test/tests/components/inlet_stagnation_p_t_1phase/phy.stagnation_p_T_transient_3eqn.i)
- (modules/thermal_hydraulics/test/tests/problems/freefall/freefall.i)
- (modules/thermal_hydraulics/test/tests/problems/three_pipe_shock/three_pipe_shock.i)
- (modules/thermal_hydraulics/test/tests/components/inlet_stagnation_p_t_1phase/phy.p0T0_3eqn.i)
- (modules/thermal_hydraulics/test/tests/components/flow_connection/err.connecting_to_non_existent_component.i)
- (modules/thermal_hydraulics/test/tests/misc/adapt/multiple_blocks.i)
- (modules/thermal_hydraulics/test/tests/controls/delay_control/test.i)
- (modules/thermal_hydraulics/test/tests/components/junction_parallel_channels_1phase/conservation.i)
- (modules/thermal_hydraulics/test/tests/components/inlet_mass_flow_rate_1phase/phy.massflowrate_3eqn.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_external_app_1phase/phy.T_wall_transfer_elem_3eqn.child.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_external_app_1phase/phy.T_wall_transfer_3eqn.child.i)
- (modules/thermal_hydraulics/test/tests/base/component_groups/test.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_1phase/phy.T_wall_transfer_3eqn_z.i)
- (modules/thermal_hydraulics/test/tests/misc/mesh_only/test.i)
- (modules/thermal_hydraulics/test/tests/components/volume_junction_1phase/phy.form_loss.i)
- (modules/thermal_hydraulics/test/tests/components/elbow_pipe_1phase/phy.position.i)
- (modules/thermal_hydraulics/test/tests/components/junction_parallel_channels_1phase/jac.test.i)
- (modules/thermal_hydraulics/test/tests/components/inlet_mass_flow_rate_1phase/clg.ctrl_T_3eqn_rdg.i)
- (modules/thermal_hydraulics/test/tests/auxkernels/sound_speed/1phase.i)
- (modules/thermal_hydraulics/test/tests/jacobians/kernels/one_d_3eqn_momentum_area_gradient.i)
- (modules/fluid_properties/test/tests/ics/specific_enthalpy_from_pressure_temperature/test.i)
- (modules/thermal_hydraulics/test/tests/controls/set_real_value_control/test.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_base/err.mixed_heat_modes.i)
- (modules/thermal_hydraulics/test/tests/components/outlet_1phase/jacobian.i)
- (modules/thermal_hydraulics/test/tests/controls/set_component_bool_value_control/test.i)
- (modules/fluid_properties/test/tests/stiffened_gas/test.i)
- (modules/thermal_hydraulics/test/tests/jacobians/kernels/one_d_3eqn_momentum_flux.i)
- (modules/thermal_hydraulics/test/tests/controls/get_function_value_control/test.i)
- (modules/thermal_hydraulics/test/tests/controls/dependency/test.i)
- (modules/thermal_hydraulics/test/tests/closures/none_1phase/phy.test.i)
- (modules/fluid_properties/test/tests/ics/rho_vapor_mixture_from_pressure_temperature/test.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_1phase/phy.conservation_1phase.i)
- (modules/fluid_properties/test/tests/auxkernels/stagnation_pressure_aux.i)
- (modules/thermal_hydraulics/test/tests/misc/initial_from_file/heat_transfer_from_heat_structure/steady_state.i)
- (modules/thermal_hydraulics/test/tests/closures/simple_1phase/err.missing_f_1phase.i)
- (modules/thermal_hydraulics/test/tests/components/form_loss_from_function_1phase/phy.form_loss_1phase.i)
- (modules/thermal_hydraulics/test/tests/actions/coupled_heat_transfer_action/sub.i)
- (modules/thermal_hydraulics/test/tests/misc/initial_from_file/volume_junction/base.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_specified_temperature_1phase/phy.energy_walltemperature_ss_1phase.i)
- (modules/thermal_hydraulics/test/tests/misc/initial_from_file/heat_transfer_from_heat_structure_3d/steady_state.i)
- (modules/thermal_hydraulics/test/tests/misc/initial_from_file/flow_channel/steady_state.i)
- (modules/thermal_hydraulics/tutorials/single_phase_flow/06_custom_closures.i)
- (modules/thermal_hydraulics/test/tests/components/free_boundary_1phase/phy.conservation_free_boundary_1phase.i)
- (modules/thermal_hydraulics/test/tests/components/volume_junction_1phase/phy.deadend.i)
- (modules/thermal_hydraulics/test/tests/components/volume_junction_1phase/err.missing_ics.i)
- (modules/thermal_hydraulics/tutorials/single_phase_flow/05_secondary_side.i)
- (modules/thermal_hydraulics/test/tests/jacobians/materials/fluid_properties_3eqn.i)
- (modules/thermal_hydraulics/test/tests/components/inlet_stagnation_p_t_1phase/phy.stagnation_p_T_steady_3eqn.i)
- (modules/thermal_hydraulics/test/tests/auxkernels/prandtl_number/1phase.i)
- (modules/thermal_hydraulics/test/tests/components/volume_junction_1phase/equal_area_with_junction.i)
- (modules/thermal_hydraulics/test/tests/components/deprecated/heat_source_volumetric.i)
- (modules/thermal_hydraulics/test/tests/base/simulation/loop_identification.i)
- (modules/thermal_hydraulics/test/tests/components/junction_parallel_channels_1phase/err.missing_ics.i)
- (modules/thermal_hydraulics/test/tests/closures/THM_1phase/thm1phase.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_1phase/phy.T_wall_transfer_3eqn_x.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_flux_1phase/phy.q_wall_multiple_3eqn.i)
- (modules/thermal_hydraulics/test/tests/components/volume_junction_1phase/phy.unequal_area.i)
- (modules/thermal_hydraulics/test/tests/components/flow_channel_1phase/jacobian.i)
- (modules/thermal_hydraulics/test/tests/components/inlet_stagnation_p_t_1phase/clg.ctrl_p0_3eqn.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_1phase/phy.T_wall_transfer_3eqn_y.i)
- (modules/thermal_hydraulics/test/tests/misc/displaced_components/displaced_components.i)
- (modules/thermal_hydraulics/test/tests/components/simple_turbine_1phase/clg.test.i)
- (modules/thermal_hydraulics/test/tests/components/solid_wall_1phase/jacobian.i)
- (modules/thermal_hydraulics/test/tests/controls/copy_postprocessor_value_control/test.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_1phase/err.not_a_hs.i)
- (modules/thermal_hydraulics/test/tests/components/inlet_mass_flow_rate_1phase/jacobian.i)
- (modules/thermal_hydraulics/test/tests/components/simple_turbine_1phase/jacobian.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_1phase/phy.energy_heatstructure_ss_1phase.i)
- (modules/thermal_hydraulics/test/tests/components/volume_junction_1phase/phy.shower.i)
- (modules/thermal_hydraulics/test/tests/misc/initial_from_file/flow_channel/test.i)
- (modules/fluid_properties/test/tests/ics/rho_from_pressure_temperature/test.i)
- (modules/thermal_hydraulics/test/tests/controls/error_checking/non_existent_control_data.i)
- (modules/thermal_hydraulics/test/tests/components/junction_parallel_channels_1phase/equal_area_no_junction.i)
- (modules/thermal_hydraulics/test/tests/components/flow_channel_1phase/err.overspecified.i)
References
- O. L. Métayer, J. Massoni, and R. Saurel.
Elaborating equations of state of a liquid and its vapor for two-phase flow models.
Int. J. Therm. Sci., 43:265–276, 2004.[BibTeX]
@article{metayer2004, author = "M{\'e}tayer, O. L. and Massoni, J. and Saurel, R.", title = "Elaborating equations of state of a liquid and its vapor for two-phase flow models", journal = "Int. J. Therm. Sci.", volume = "43", pages = "265--276", year = "2004" }
(modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_3d/phy.conservation.i)
# Testing energy conservation with fluid at rest
P_hf = ${fparse 0.6 * sin (pi/24)}
[GlobalParams]
gravity_vector = '0 0 0'
[]
[Materials]
[mat]
type = ADGenericConstantMaterial
block = 'blk:0'
prop_names = 'density specific_heat thermal_conductivity'
prop_values = '1000 100 30'
[]
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Functions]
[T_init]
type = ParsedFunction
expression = '1000*y+300+30*z'
[]
[]
[Components]
[in1]
type = SolidWall1Phase
input = 'fch1:in'
[]
[fch1]
type = FlowChannel1Phase
position = '0.15 0 0'
orientation = '0 0 1'
fp = fp
n_elems = 10
length = 1
initial_T = 300
initial_p = 1.01e5
initial_vel = 0
closures = simple_closures
A = 0.00314159
f = 0.0
[]
[out1]
type = SolidWall1Phase
input = 'fch1:out'
[]
[in2]
type = SolidWall1Phase
input = 'fch2:in'
[]
[fch2]
type = FlowChannel1Phase
position = '0 0.15 0'
orientation = '0 0 1'
fp = fp
n_elems = 10
length = 1
initial_T = 350
initial_p = 1.01e5
initial_vel = 0
closures = simple_closures
A = 0.00314159
f = 0.0
[]
[out2]
type = SolidWall1Phase
input = 'fch2:out'
[]
[blk]
type = HeatStructureFromFile3D
file = mesh.e
position = '0 0 0'
initial_T = T_init
[]
[ht]
type = HeatTransferFromHeatStructure3D1Phase
flow_channels = 'fch1 fch2'
hs = blk
boundary = blk:rmin
Hw = 10000
P_hf = ${P_hf}
[]
[]
[Postprocessors]
[energy_hs]
type = ADHeatStructureEnergy3D
block = blk:0
execute_on = 'INITIAL TIMESTEP_END'
[]
[energy_fch1]
type = ElementIntegralVariablePostprocessor
block = fch1
variable = rhoEA
execute_on = 'INITIAL TIMESTEP_END'
[]
[energy_fch2]
type = ElementIntegralVariablePostprocessor
block = fch2
variable = rhoEA
execute_on = 'INITIAL TIMESTEP_END'
[]
[total_energy]
type = SumPostprocessor
values = 'energy_fch1 energy_fch2 energy_hs'
execute_on = 'INITIAL TIMESTEP_END'
[]
[energy_change]
type = ChangeOverTimePostprocessor
change_with_respect_to_initial = true
postprocessor = total_energy
compute_relative_change = true
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
dt = 0.1
num_steps = 10
solve_type = NEWTON
line_search = basic
abort_on_solve_fail = true
nl_abs_tol = 1e-8
[]
[Outputs]
file_base = 'phy.conservation'
[csv]
type = CSV
show = 'energy_change'
execute_on = 'FINAL'
[]
[]
(modules/thermal_hydraulics/test/tests/base/simulation/err.no_smp.i)
[GlobalParams]
gravity_vector = '0 0 9.81'
initial_p = 1e5
initial_T = 300
initial_vel = 0
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
fp = water
closures = simple_closures
f = 0
[]
[FluidProperties]
[water]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[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 = '1 0 0'
length = '1'
A = 1
D_h = 1
n_elems = 2
[]
[jct1]
type = VolumeJunction1Phase
position = '1 0 0'
volume = 1e-3
connections = 'pipe1:out pipe2:in'
use_scalar_variables = false
[]
[pipe2]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '1 0 0'
length = '1'
A = 1
D_h = 1
n_elems = 2
[]
[outlet]
type = Outlet1Phase
input = 'pipe2:out'
p = 101325
[]
[]
[Executioner]
type = Transient
dt = 0.01
num_steps = 2
[]
(modules/thermal_hydraulics/test/tests/misc/initial_from_file/heat_transfer_from_heat_structure_3d/test.i)
[GlobalParams]
scaling_factor_1phase = '1. 1.e-2 1.e-4'
scaling_factor_temperature = 1e-2
initial_from_file = 'steady_state_out.e'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Materials]
[mat]
type = ADGenericConstantMaterial
prop_names = 'density specific_heat thermal_conductivity'
prop_values = '16 356 6.5514e3'
[]
[]
[Functions]
[Ts_bc]
type = ParsedFunction
expression = '2*sin(x*pi/2)+2*sin(pi*y) +507'
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp
# geometry
position = '-1 0 -2.5'
orientation = '1 0 0'
length = 2
n_elems = 2
A = 0.3
D_h = 0.1935483871
f = 0.1
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe:in'
m_dot = 0.1
T = 500
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 6e6
[]
[ht]
type = HeatTransferFromHeatStructure3D1Phase
flow_channels = 'pipe'
hs = blk
boundary = blk:right
P_hf = 3
Hw = 1000
[]
[blk]
type = HeatStructureFromFile3D
file = box.e
position = '0 0 0'
[]
[right_bnd]
type = HSBoundarySpecifiedTemperature
hs = blk
boundary = blk:bottom
T = Ts_bc
[]
[]
[Executioner]
type = Transient
dt = 1
num_steps = 1
abort_on_solve_fail = true
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-7
nl_abs_tol = 1e-8
nl_max_its = 10
l_tol = 1e-3
l_max_its = 100
[]
[Outputs]
exodus = true
execute_on = 'initial'
[]
(modules/thermal_hydraulics/test/tests/controls/set_bool_value_control/test.i)
# This is testing that the values set by SetBoolValueControl are used.
# The values of function T0_fn are compared to a threshold and the boolean
# result is stored into an aux field via `BooleanValueTestAux`.
[GlobalParams]
initial_p = 100.e3
initial_vel = 1.0
initial_T = 350.
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '1 0 0'
length = 15.0
n_elems = 10
A = 0.01
D_h = 0.1
f = 0.01
[]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe1:in'
p0 = 100.e3
T0 = 350.
[]
[outlet]
type = Outlet1Phase
input = 'pipe1:out'
p = 100.0e3
[]
[]
[AuxVariables]
[aux]
[]
[]
[AuxKernels]
[aux_kernel]
type = BooleanValueTestAux
variable = aux
value = 1
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Functions]
[T0_fn]
type = PiecewiseLinear
x = '0 1'
y = '350 345'
[]
[]
[ControlLogic]
[T_inlet_fn]
type = GetFunctionValueControl
function = T0_fn
[]
[threshold_ctrl]
type = UnitTripControl
condition = 'T > 347.5'
symbol_names = 'T'
symbol_values = 'T_inlet_fn:value'
[]
[set_bool_value]
type = SetBoolValueControl
parameter = AuxKernels/aux_kernel/value
value = 'threshold_ctrl:state'
[]
[]
[Postprocessors]
[aux]
type = ElementAverageValue
variable = aux
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
dt = 0.1
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 1e-6
nl_abs_tol = 1e-6
nl_max_its = 20
l_tol = 1e-3
l_max_its = 5
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
start_time = 0.0
end_time = 1
automatic_scaling = true
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/components/shaft_connected_pump_1phase/jacobian.i)
# Pump data used in this test comes from the LOFT Systems Tests, described in NUREG/CR-0247
[GlobalParams]
initial_p = 1e5
initial_T = 300
initial_vel = 0
closures = simple_closures
fp = fp
f = 0
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[fch1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 2
A = 1
[]
[pump]
type = ShaftConnectedPump1Phase
inlet = 'fch1:out'
outlet = 'fch2:in'
position = '1 0 0'
volume = 0.3
A_ref = 1
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
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 = 1
use_scalar_variables = false
[]
[fch2]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '1 0 0'
length = 1
n_elems = 2
A = 1
[]
[shaft]
type = Shaft
connected_components = 'pump'
initial_speed = 1
[]
[]
[Functions]
[head_fcn]
type = PiecewiseLinear
data_file = loft_head_data.csv
format = columns
[]
[torque_fcn]
type = PiecewiseLinear
data_file = loft_torque_data.csv
format = columns
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
num_steps = 1
abort_on_solve_fail = true
solve_type = 'newton'
line_search = 'basic'
petsc_options_iname = '-snes_test_err'
petsc_options_value = '2e-10'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-6
nl_max_its = 15
l_tol = 1e-4
l_max_its = 10
[]
(modules/thermal_hydraulics/test/tests/misc/restart_1phase/test.i)
[GlobalParams]
gravity_vector = '0 0 0'
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[SolidProperties]
[mat1]
type = ThermalFunctionSolidProperties
k = 16
cp = 356.
rho = 6.551400E+03
[]
[]
[Functions]
[Ts_init]
type = ParsedFunction
expression = '2*sin(x*pi)+507'
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
fp = eos
# geometry
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 5
A = 1.907720E-04
D_h = 1.698566E-02
f = 0.1
[]
[jct1]
type = VolumeJunction1Phase
connections = 'pipe1:out pipe2:in'
position = '1 0 0'
volume = 1e-5
use_scalar_variables = false
[]
[pipe2]
type = FlowChannel1Phase
fp = eos
# geometry
position = '1 0 0'
orientation = '1 0 0'
length = 1
n_elems = 5
A = 1.907720E-04
D_h = 1.698566E-02
f = 0.1
[]
[jct2]
type = VolumeJunction1Phase
connections = 'pipe2:out pipe3:in'
position = '2 0 0'
volume = 1e-5
use_scalar_variables = false
[]
[pipe3]
type = FlowChannel1Phase
fp = eos
# geometry
position = '2 0 0'
orientation = '1 0 0'
length = 1
n_elems = 5
A = 1.907720E-04
D_h = 1.698566E-02
f = 0.1
[]
[hs]
type = HeatStructureCylindrical
position = '1 0.01 0'
orientation = '1 0 0'
length = 1
n_elems = 5
names = '0'
n_part_elems = 1
solid_properties = 'mat1'
solid_properties_T_ref = '300'
widths = 0.1
[]
[temp_outside]
type = HSBoundarySpecifiedTemperature
hs = hs
boundary = hs:outer
T = Ts_init
[]
[inlet]
type = InletVelocityTemperature1Phase
input = 'pipe1:in'
T = 507
vel = 1
[]
[outlet]
type = Outlet1Phase
input = 'pipe3:out'
p = 6e6
[]
[hx3ext]
type = HeatTransferFromExternalAppTemperature1Phase
flow_channel = pipe3
P_hf = 0.0449254
Hw = 100000
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
dt = 0.01
num_steps = 5
abort_on_solve_fail = true
solve_type = 'newton'
line_search = 'basic'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 10
l_tol = 1e-3
l_max_its = 100
automatic_scaling = true
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu'
[]
[Outputs]
exodus = true
velocity_as_vector = false
[]
(modules/thermal_hydraulics/test/tests/components/heat_transfer_from_specified_temperature_1phase/clg.Hw.i)
[GlobalParams]
initial_p = 0.1e6
initial_vel = 0
initial_T = 300
scaling_factor_1phase = '1e+0 1e-2 1e-4'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '1 0 0'
length = 1.0
n_elems = 10
A = 3.14e-2
f = 0.1
[]
[ht_pipe1]
type = HeatTransferFromSpecifiedTemperature1Phase
flow_channel = pipe1
T_wall = 310
Hw = 0
[]
[inlet1]
type = InletDensityVelocity1Phase
input = 'pipe1:in'
rho = 996.557482499661660
vel = 1
[]
[outlet]
type = Outlet1Phase
input = 'pipe1:out'
p = 0.1e6
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 0.05
num_steps = 20
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 1e-9
nl_abs_tol = 1e-8
nl_max_its = 10
l_tol = 1e-3
l_max_its = 30
[]
[Outputs]
csv = true
[]
[Functions]
[Hw_fn]
type = PiecewiseLinear
x = '0 1'
y = '10 110'
[]
[]
[ControlLogic]
[pipe_Hw_ctrl]
type = TimeFunctionComponentControl
component = ht_pipe1
parameter = Hw
function = Hw_fn
[]
[]
[Postprocessors]
[Hw]
type = RealComponentParameterValuePostprocessor
component = ht_pipe1
parameter = Hw
[]
[]
(modules/fluid_properties/test/tests/auxkernels/specific_enthalpy_aux.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 2
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./pressure]
[../]
[./temperature]
[../]
[./specific_enthalpy]
[../]
[]
[Kernels]
[./diff_u]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./pressure_ak]
type = ConstantAux
variable = pressure
value = 10e6
[../]
[./temperature_ak]
type = ConstantAux
variable = temperature
value = 400.0
[../]
[./specific_enthalpy_ak]
type = SpecificEnthalpyAux
variable = specific_enthalpy
fp = eos
p = pressure
T = temperature
[../]
[]
[FluidProperties]
[./eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0.0
p_inf = 1e9
cv = 1816.0
[../]
[]
[BCs]
[./left_u]
type = DirichletBC
variable = u
boundary = 0
value = 1
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = 1
value = 2
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
exodus = true
[]
(modules/thermal_hydraulics/test/tests/components/pump_1phase/pipe_friction_pump_head_balance.i)
# This test balances the pipe friction pressure drop with the pump head pressure rise and runs to steady state.
[GlobalParams]
initial_T = 393.15
initial_vel = 0.0
A = 0.567
fp = fp
scaling_factor_1phase = '0.04 0.04 0.04e-5'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 10
initial_p = 1.35e+07
n_elems = 20
f = 5000
gravity_vector = '0 0 0'
[]
[pump]
type = Pump1Phase
connections = 'pipe1:out pipe1:in'
position = '1.02 0 0'
initial_p = 1.3e+07
initial_vel_x = 1
initial_vel_y = 0
initial_vel_z = 0
scaling_factor_rhoV = 1
scaling_factor_rhouV = 1
scaling_factor_rhoEV = 1e-5
head = 8
volume = 0.567
A_ref = 0.567
use_scalar_variables = false
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 1.e-3
num_steps = 38
abort_on_solve_fail = true
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]
[out_x]
type = Exodus
show = 'p T vel'
[]
velocity_as_vector = false
[]
(modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_3d/jac.1phase.i)
[Materials]
[mat]
type = ADGenericConstantMaterial
block = 'blk:0'
prop_names = 'density specific_heat thermal_conductivity'
prop_values = '1000 100 30'
[]
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Functions]
[T_init]
type = ParsedFunction
expression = '1000*y+300+30*z'
[]
[]
[GlobalParams]
scaling_factor_1phase = '1 1 1e-3'
gravity_vector = '0 0 0'
[]
[Components]
[fch]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 1'
fp = fp
n_elems = 6
length = 1
initial_T = T_init
initial_p = 1.01e5
initial_vel = 0
closures = simple_closures
A = 0.00314159
D_h = 0.2
f = 0.01
[]
[in]
type = InletVelocityTemperature1Phase
input = 'fch:in'
vel = 1
T = 300
[]
[out]
type = Outlet1Phase
input = 'fch:out'
p = 1.01e5
[]
[blk]
type = HeatStructureFromFile3D
file = mesh.e
position = '0 0 0'
initial_T = T_init
[]
[ht]
type = HeatTransferFromHeatStructure3D1Phase
flow_channels = 'fch'
hs = blk
boundary = blk:rmin
Hw = 10000
P_hf = 0.1564344650402309
[]
[]
[Postprocessors]
[energy_hs]
type = ADHeatStructureEnergy3D
block = blk:0
execute_on = 'INITIAL TIMESTEP_END'
[]
[energy_fch]
type = ElementIntegralVariablePostprocessor
block = fch
variable = rhoEA
execute_on = 'INITIAL TIMESTEP_END'
[]
[total_energy]
type = SumPostprocessor
values = 'energy_fch energy_hs'
execute_on = 'INITIAL TIMESTEP_END'
[]
[energy_change]
type = ChangeOverTimePostprocessor
change_with_respect_to_initial = true
postprocessor = total_energy
compute_relative_change = true
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
petsc_options_iname = '-snes_test_err'
petsc_options_value = ' 1e-9'
[]
[]
[Executioner]
type = Transient
scheme = bdf2
dt = 0.1
num_steps = 1
solve_type = PJFNK
line_search = basic
abort_on_solve_fail = true
nl_abs_tol = 1e-8
[]
[Outputs]
file_base = 'phy.conservation'
csv = true
show = 'energy_change'
execute_on = 'final'
[]
(modules/thermal_hydraulics/test/tests/components/solid_wall_1phase/phy.3eqn.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = 101325
initial_T = 300
initial_vel = 0
scaling_factor_1phase = '1 1 1e-5'
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 10
A = 1.0000000000e-04
D_h = 1.1283791671e-02
f = 0.0
fp = eos
[]
[inlet]
type = SolidWall1Phase
input = 'pipe:in'
[]
[outlet]
type = SolidWall1Phase
input = 'pipe:out'
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 1e-4
num_steps = 10
abort_on_solve_fail = true
solve_type = 'NEWTON'
nl_rel_tol = 1e-9
nl_abs_tol = 1e-9
nl_max_its = 30
l_tol = 1e-3
l_max_its = 100
[]
[Outputs]
[out]
type = Exodus
[]
velocity_as_vector = false
[]
(modules/thermal_hydraulics/test/tests/auxkernels/mach_number/1phase.i)
[GlobalParams]
family = MONOMIAL
order = CONSTANT
[]
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
allow_renumbering = false
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[AuxVariables]
[mach_no]
[]
[v]
initial_condition = 1e-3
[]
[e]
initial_condition = 1e5
[]
[vel]
initial_condition = 10.
[]
[]
[AuxKernels]
[mach_aux]
type = MachNumberAux
variable = mach_no
vel = vel
v = v
e = e
fp = fp
[]
[]
[Postprocessors]
[mach_no]
type = ElementalVariableValue
variable = mach_no
elementid = 0
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
dt = 1
num_steps = 1
abort_on_solve_fail = true
[]
[Outputs]
csv = true
execute_on = TIMESTEP_END
[]
(modules/thermal_hydraulics/test/tests/problems/water_hammer/3eqn.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_T = 517.252072255516
initial_vel = 0
scaling_factor_1phase = '1.e0 1.e0 1.e-2'
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Functions]
[p_fn]
type = PiecewiseConstant
axis = x
x = '0 0.5 1'
y = '7.5e6 6.5e6 6.5e6'
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
fp = eos
# geometry
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 200
A = 1.907720E-04
D_h = 1.698566E-02
f = 0.
initial_p = p_fn
[]
# BCs
[left]
type = SolidWall1Phase
input = 'pipe1:in'
[]
[right]
type = SolidWall1Phase
input = 'pipe1: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'
line_search = 'basic'
nl_rel_tol = 1e-9
nl_abs_tol = 1e-9
nl_max_its = 10
l_tol = 1e-3
l_max_its = 100
[]
[Outputs]
velocity_as_vector = false
[out]
type = Exodus
[]
[]
(modules/thermal_hydraulics/test/tests/components/flow_channel_1phase/phy.par_fn.i)
#
# Tests the ability to set the hydraulic diameter by function.
#
D_h = 5
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = 1e6
initial_T = 453.1
initial_vel = 0.0
closures = simple_closures
[]
[Functions]
[dh_fn]
type = ConstantFunction
value = ${D_h}
[]
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[left_wall]
type = SolidWall1Phase
input = pipe:in
[]
[pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 1
A = 1.0e-4
D_h = dh_fn
f = 0.0
fp = eos
[]
[right_wall]
type = SolidWall1Phase
input = pipe:out
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0.0
dt = 1
num_steps = 1
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 1e-5
nl_abs_tol = 1e-6
nl_max_its = 30
l_tol = 1e-3
l_max_its = 100
[]
[Postprocessors]
[D_h]
type = ADElementIntegralMaterialProperty
mat_prop = D_h
block = pipe
[]
[]
[Outputs]
csv = true
show = 'D_h'
execute_on = 'timestep_end'
[]
(modules/thermal_hydraulics/test/tests/components/outlet_1phase/phy.solidwall_outlet_3eqn.i)
# This test problem simulates a tube filled with steam that is suddenly opened
# on one end to an environment with a lower pressure.
[GlobalParams]
gravity_vector = '0 0 0'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 1.43
cv = 1040.0
q = 2.03e6
p_inf = 0.0
q_prime = -2.3e4
[]
[]
[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 = 400
initial_p = 1e5
initial_vel = 0
f = 0
[]
[left_wall]
type = SolidWall1Phase
input = 'pipe:in'
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 0.95e5
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 0
nl_abs_tol = 1e-5
nl_max_its = 15
l_tol = 1e-3
l_max_its = 10
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
start_time = 0.0
end_time = 0.2
dt = 0.01
abort_on_solve_fail = true
automatic_scaling = true
[]
[Outputs]
file_base = 'phy.solidwall_outlet_3eqn'
velocity_as_vector = false
[exodus]
type = Exodus
show = 'p T vel'
[]
[]
(modules/thermal_hydraulics/test/tests/components/flow_channel_1phase/err.free.i)
[GlobalParams]
gravity_vector = '0 0 0'
scaling_factor_1phase = '1. 1. 1.'
initial_vel = 0
initial_p = 1e5
initial_T = 300
closures = simple_closures
[]
[FluidProperties]
[water]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = water
# geometry
position = '0 0 0'
orientation = '1 0 0'
A = 1.
D_h = 1.12837916709551
f = 0.01
length = 1
n_elems = 100
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
dt = 1e-4
dtmin = 1.e-7
solve_type = 'PJFNK'
nl_rel_tol = 1e-9
nl_abs_tol = 1e-8
nl_max_its = 10
l_tol = 1e-8
l_max_its = 100
start_time = 0.0
num_steps = 10
[]
[Outputs]
[out]
type = Exodus
[]
[]
(modules/thermal_hydraulics/test/tests/components/junction_parallel_channels_1phase/phy.unequal_area.i)
# Junction between 2 pipes where the second has half the area of the first.
# The momentum density of the second should be twice that of the first.
[GlobalParams]
gravity_vector = '0 0 0'
initial_T = 300
initial_p = 1e5
initial_vel_x = 50
initial_vel_y = 0
initial_vel_z = 0
f = 0
fp = eos
scaling_factor_1phase = '1 1e-2 1e-5'
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 1.4
cv = 725
p_inf = 0
q = 0
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe1:in'
m_dot = 10
T = 250
[]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
A = 1
n_elems = 20
initial_vel = 20
[]
[junction]
type = JunctionParallelChannels1Phase
connections = 'pipe1:out pipe2:in'
scaling_factor_rhouV = 1e-4
scaling_factor_rhoEV = 1e-5
position = '1 0 0'
volume = 1e-8
use_scalar_variables = false
[]
[pipe2]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '1 0 0'
length = 1
A = 0.5
n_elems = 20
initial_vel = 15
[]
[outlet]
type = Outlet1Phase
input = 'pipe2:out'
p = 1e5
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 0
nl_abs_tol = 1e-6
nl_max_its = 15
l_tol = 1e-10
l_max_its = 10
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
start_time = 0
end_time = 3
dt = 0.1
abort_on_solve_fail = true
[]
[Postprocessors]
# These post-processors are used to test that the outlet side of the junction,
# which has half the area of the inlet side, has twice the momentum density
# that the inlet side does.
[rhouA_pipe1]
type = SideAverageValue
variable = rhouA
boundary = pipe1:out
[]
[rhouA_pipe2]
type = SideAverageValue
variable = rhouA
boundary = pipe2:out
[]
[test_rel_err]
type = RelativeDifferencePostprocessor
value1 = rhouA_pipe1
value2 = rhouA_pipe2
[]
[]
[Outputs]
[out]
type = CSV
show = test_rel_err
execute_on = 'final'
[]
[]
[Debug]
show_var_residual_norms = true
[]
(modules/thermal_hydraulics/test/tests/components/pump_1phase/clg.head.i)
[GlobalParams]
initial_T = 393.15
initial_vel = 0.0372
f = 0
fp = fp
scaling_factor_1phase = '1e-2 1e-2 1e-5'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Functions]
[pump_head_fn]
type = PiecewiseLinear
x = '0 0.5'
y = '0 1 '
[]
[]
[Components]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe1:in'
m_dot = 20
T = 393.15
[]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 10
A = 0.567
initial_p = 1.318964e+07
[]
[pump]
type = Pump1Phase
connections = 'pipe1:out pipe2:in'
position = '1.02 0 0'
head = 0
volume = 0.567
A_ref = 0.567
initial_p = 1.318964e+07
initial_vel_x = 0.0372
initial_vel_y = 0
initial_vel_z = 0
scaling_factor_rhoV = 1
scaling_factor_rhouV = 1
scaling_factor_rhoEV = 1e-5
use_scalar_variables = false
[]
[pipe2]
type = FlowChannel1Phase
position = '1.04 0 0'
orientation = '1 0 0'
length = 0.96
n_elems = 10
A = 0.567
initial_p = 1.4072e+07
[]
[outlet]
type = Outlet1Phase
input = 'pipe2:out'
p = 1.4072e+07
[]
[]
[ControlLogic]
[pump_head_ctrl]
type = TimeFunctionComponentControl
component = pump
parameter = head
function = pump_head_fn
[]
[]
[Postprocessors]
[pump_head]
type = RealComponentParameterValuePostprocessor
component = pump
parameter = head
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 0.1
num_steps = 10
abort_on_solve_fail = true
solve_type = 'PJFNK'
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]
[out]
type = CSV
show = 'pump_head'
[]
print_linear_residuals = false
[]
(modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_1phase/fin_enhancement.i)
# This test has 2 pipes, each surrounded by a cylindrical HS:
#
# - pipe1: no fin heat transfer enhancement
# - pipe2: fin heat transfer enhancement
diam = 0.01
area = ${fparse 0.25 * pi * diam^2}
length = 1.0
n_elems = 10
t_hs = 0.02
n_elems_radial = 5
rho_inlet = 1359.792245 # @ T = 300 K, p = 1e5 Pa
vel_inlet = 1.0
T_inlet = 300
p_outlet = 1e5
T_initial_hs = 800
mfr_inlet = ${fparse rho_inlet * vel_inlet * area}
htc = 100
# Suppose that there are 20 rectangular, 1-mm-thick fins of height 1 mm over the length
# of the cooled section.
n_fin = 20
h_fin = 0.001
t_fin = 0.001
A_fin_single = ${fparse (2 * h_fin + t_fin ) * length}
A_fin = ${fparse n_fin * A_fin_single}
A_cooled = ${fparse pi * diam * length}
A_total = ${fparse A_fin + A_cooled - n_fin * t_fin * length}
fin_area_fraction = ${fparse A_fin / A_total}
area_increase_factor = ${fparse A_total / A_cooled}
fin_perimeter_area_ratio = ${fparse (2 * length + 2 * t_fin) / (length * t_fin)}
k_fin = 15.0
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[SolidProperties]
[sp_ss316]
type = ThermalSS316Properties
[]
[]
[FunctorMaterials]
[fin_efficiency_fmat]
type = FinEfficiencyFunctorMaterial
fin_height = ${h_fin}
fin_perimeter_area_ratio = ${fparse fin_perimeter_area_ratio}
heat_transfer_coefficient = ${htc}
thermal_conductivity = ${k_fin}
fin_efficiency_name = fin_efficiency
[]
[fin_enhancement_fmat]
type = FinEnhancementFactorFunctorMaterial
fin_efficiency = fin_efficiency
fin_area_fraction = ${fin_area_fraction}
area_increase_factor = ${area_increase_factor}
fin_enhancement_factor_name = fin_enhancement
[]
[]
[Components]
# pipe1
[pipe1_inlet]
type = InletMassFlowRateTemperature1Phase
m_dot = ${mfr_inlet}
T = ${T_inlet}
input = 'pipe1:in'
[]
[pipe1]
type = FlowChannel1Phase
gravity_vector = '0 0 0'
position = '0 0 0'
orientation = '0 0 1'
length = ${length}
n_elems = ${n_elems}
A = ${area}
initial_T = ${T_inlet}
initial_p = ${p_outlet}
initial_vel = ${vel_inlet}
fp = fp
closures = simple_closures
f = 0
scaling_factor_1phase = '1 1 1e-5'
[]
[pipe1_outlet]
type = Outlet1Phase
p = ${p_outlet}
input = 'pipe1:out'
[]
[ht1]
type = HeatTransferFromHeatStructure1Phase
flow_channel = pipe1
hs = hs1
hs_side = inner
Hw = ${htc}
[]
[hs1]
type = HeatStructureCylindrical
position = '0 0 0'
orientation = '0 0 1'
length = ${length}
n_elems = ${n_elems}
inner_radius = ${fparse 0.5 * diam}
names = 'main'
solid_properties = 'sp_ss316'
solid_properties_T_ref = '300'
widths = '${t_hs}'
n_part_elems = '${n_elems_radial}'
initial_T = ${T_initial_hs}
scaling_factor_temperature = 1e-5
[]
# pipe 2
[pipe2_inlet]
type = InletMassFlowRateTemperature1Phase
m_dot = ${mfr_inlet}
T = ${T_inlet}
input = 'pipe2:in'
[]
[pipe2]
type = FlowChannel1Phase
gravity_vector = '0 0 0'
position = '0 0.5 0'
orientation = '0 0 1'
length = ${length}
n_elems = ${n_elems}
A = ${area}
initial_T = ${T_inlet}
initial_p = ${p_outlet}
initial_vel = ${vel_inlet}
fp = fp
closures = simple_closures
f = 0
scaling_factor_1phase = '1 1 1e-5'
[]
[pipe2_outlet]
type = Outlet1Phase
p = ${p_outlet}
input = 'pipe2:out'
[]
[ht2]
type = HeatTransferFromHeatStructure1Phase
flow_channel = pipe2
hs = hs2
hs_side = inner
Hw = ${htc}
scale = fin_enhancement
[]
[hs2]
type = HeatStructureCylindrical
position = '0 0.5 0'
orientation = '0 0 1'
length = ${length}
n_elems = ${n_elems}
inner_radius = ${fparse 0.5 * diam}
names = 'main'
solid_properties = 'sp_ss316'
solid_properties_T_ref = '300'
widths = '${t_hs}'
n_part_elems = '${n_elems_radial}'
initial_T = ${T_initial_hs}
scaling_factor_temperature = 1e-5
[]
[]
[Postprocessors]
[pipe1_T_avg]
type = ElementAverageValue
variable = T
block = 'pipe1'
execute_on = 'INITIAL TIMESTEP_END'
[]
[pipe2_T_avg]
type = ElementAverageValue
variable = T
block = 'pipe2'
execute_on = 'INITIAL TIMESTEP_END'
[]
[hs1_T_avg]
type = SideAverageValue
variable = T_solid
boundary = 'hs1:inner'
execute_on = 'INITIAL TIMESTEP_END'
[]
[hs2_T_avg]
type = SideAverageValue
variable = T_solid
boundary = 'hs2:inner'
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
end_time = 10.0
dt = 1.0
solve_type = NEWTON
nl_rel_tol = 0
nl_abs_tol = 1e-6
nl_max_its = 15
l_tol = 1e-3
l_max_its = 10
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/components/flow_channel_1phase/phy.sub_discretization.i)
#
# Testing the ability to discretize the Pipe by dividing it into
# subsections
#
[GlobalParams]
initial_p = 1e5
initial_T = 300
initial_vel = 0
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
axial_region_names = 'r1 r2'
length = '1 1'
n_elems = '1 2'
A = 1
f = 0
fp = eos
[]
[inlet]
type = SolidWall1Phase
input = 'pipe:in'
[]
[outlet]
type = SolidWall1Phase
input = 'pipe:out'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
num_steps = 0
[]
[Outputs]
[out]
type = Exodus
show = 'A'
[]
[]
(modules/thermal_hydraulics/test/tests/components/shaft_connected_compressor_1phase/jac.test.i)
[GlobalParams]
initial_p = 1e5
initial_T = 300
initial_vel = 0
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
length = 1
n_elems = 1
A = 0.1
A_ref = 0.1
closures = simple_closures
fp = fp
f = 0
scaling_factor_1phase = '1e-2 1e-2 1e-5'
scaling_factor_rhoEV = 1e-5
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 1.4
cv = 725
p_inf = 0
q = 0
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[sw1]
type = SolidWall1Phase
input = fch1:in
[]
[fch1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
[]
[compressor]
type = ShaftConnectedCompressor1Phase
inlet = 'fch1:out'
outlet = 'fch2:in'
position = '1 0 0'
volume = 0.3
inertia_coeff = '1 1 1 1'
inertia_const = 1.61397
speed_cr_I = 1e12
speed_cr_fr = 0
tau_fr_coeff = '0 0 9.084 0'
tau_fr_const = 0
omega_rated = 1476.6
mdot_rated = 2
rho0_rated = 1.3
c0_rated = 350
speeds = '-1.0 0.0 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.5'
Rp_functions = 'Rp00 Rp00 Rp04 Rp05 Rp06 Rp07 Rp08 Rp09 Rp10 Rp11 Rp11'
eff_functions = 'eff00 eff00 eff04 eff05 eff06 eff07 eff08 eff09 eff10 eff11 eff11'
use_scalar_variables = false
[]
[fch2]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '1 0 0'
[]
[sw2]
type = SolidWall1Phase
input = fch2:out
[]
[shaft]
type = Shaft
connected_components = 'compressor'
initial_speed = 1476.6
[]
[]
[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'
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 0.001
num_steps = 1
abort_on_solve_fail = true
solve_type = 'newton'
line_search = 'basic'
petsc_options_iname = '-snes_test_err'
petsc_options_value = '1e-10'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-6
nl_max_its = 15
l_tol = 1e-4
l_max_its = 10
[]
(modules/thermal_hydraulics/test/tests/components/heat_transfer_from_specified_temperature_1phase/clg.T_wall.i)
[GlobalParams]
initial_p = 0.1e6
initial_vel = 0
initial_T = 300
scaling_factor_1phase = '1e+0 1e-2 1e-4'
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
fp = eos
position = '0 0 0'
orientation = '1 0 0'
length = 1.0
n_elems = 50
A = 3.14e-2
f = 0.1
[]
[ht_pipe1]
type = HeatTransferFromSpecifiedTemperature1Phase
flow_channel = pipe1
T_wall = 300
Hw = 0
[]
[inlet1]
type = InletDensityVelocity1Phase
input = 'pipe1:in'
rho = 996.557482499661660
vel = 1
[]
[outlet]
type = Outlet1Phase
input = 'pipe1:out'
p = 0.1e6
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 0.05
num_steps = 20
abort_on_solve_fail = true
solve_type = 'newton'
line_search = 'basic'
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu'
nl_rel_tol = 1e-9
nl_abs_tol = 1e-8
nl_max_its = 10
l_tol = 1e-3
l_max_its = 30
[]
[Outputs]
csv = true
[]
[Functions]
[T_wall_fn]
type = PiecewiseLinear
x = '0 1'
y = '310 320'
[]
[]
[ControlLogic]
[pipe_T_wall_ctrl]
type = TimeFunctionComponentControl
component = ht_pipe1
parameter = T_wall
function = T_wall_fn
[]
[]
[Postprocessors]
[T_wall]
type = RealComponentParameterValuePostprocessor
component = ht_pipe1
parameter = T_wall
[]
[]
(modules/thermal_hydraulics/test/tests/components/pump_1phase/pump_loop.i)
[GlobalParams]
initial_T = 300
initial_p = 1e5
initial_vel = 0
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
scaling_factor_1phase = '1 1 1'
scaling_factor_rhoV = 1
scaling_factor_rhouV = 1
scaling_factor_rhovV = 1
scaling_factor_rhowV = 1
scaling_factor_rhoEV = 1
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1a]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '1 0 0'
A = 0.785398163e-4 #1.0 cm (0.01 m) in diameter, A = 1/4 * PI * d^2
D_h = 0.01
f = 0.01
length = 0.5
n_elems = 2
[]
[pipe1b]
type = FlowChannel1Phase
fp = fp
position = '0.5 0 0'
orientation = '1 0 0'
A = 0.785398163e-4 #1.0 cm (0.01 m) in diameter, A = 1/4 * PI * d^2
D_h = 0.01
f = 0.01
length = 0.5
n_elems = 2
[]
[pipe2]
type = FlowChannel1Phase
fp = fp
position = '1 0 0'
orientation = '0 1 0'
A = 0.785398163e-4 #1.0 cm (0.01 m) in diameter, A = 1/4 * PI * d^2
D_h = 0.01
f = 0.01
length = 1
n_elems = 3
[]
[pipe3]
type = FlowChannel1Phase
fp = fp
position = '1 1 0'
orientation = '-1 0 0'
A = 0.785398163e-4 #1.0 cm (0.01 m) in diameter, A = 1/4 * PI * d^2
D_h = 0.01
f = 0.01
length = 1
n_elems = 3
[]
[pipe4]
type = FlowChannel1Phase
fp = fp
position = '0 1 0'
orientation = '0 -1 0'
A = 0.785398163e-4 #1.0 cm (0.01 m) in diameter, A = 1/4 * PI * d^2
D_h = 0.01
f = 0.01
length = 1
n_elems = 3
[]
[pipe5]
type = FlowChannel1Phase
fp = fp
position = '1 1 0'
orientation = '0 1 0'
A = 0.785398163e-4 #1.0 cm (0.01 m) in diameter, A = 1/4 * PI * d^2
D_h = 0.01
f = 0.01
length = 0.5
n_elems = 3
[]
[pump]
type = Pump1Phase
connections = 'pipe1a:out pipe1b:in'
head = 1.0
position = '0.5 0 0'
volume = 0.785398163e-3
A_ref = 0.785398163e-4
use_scalar_variables = false
[]
[junction1]
type = VolumeJunction1Phase
connections = 'pipe1b:out pipe2:in'
volume = 0.785398163e-3
position = '1 0 0'
use_scalar_variables = false
[]
[junction2]
type = VolumeJunction1Phase
connections = 'pipe2:out pipe3:in pipe5:in'
volume = 0.785398163e-3
position = '1 1 0'
use_scalar_variables = false
[]
[junction3]
type = VolumeJunction1Phase
connections = 'pipe3:out pipe4:in'
volume = 0.785398163e-3
position = '0 1 0'
use_scalar_variables = false
[]
[junction4]
type = VolumeJunction1Phase
connections = 'pipe4:out pipe1a:in'
volume = 0.785398163e-3
position = '0 0 0'
use_scalar_variables = false
[]
[outlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe5:out'
p0 = 1.e5
T0 = 300
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
num_steps = 10
dt = 1
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 1e-6
nl_abs_tol = 1e-7
nl_max_its = 10
l_tol = 1e-3
l_max_its = 100
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[Quadrature]
type = gauss
order = second
[]
[]
[Outputs]
[out]
type = Exodus
show = 'rhouA p'
execute_on = 'initial final'
[]
[]
(modules/thermal_hydraulics/test/tests/misc/surrogate_power_profile/surrogate_power_profile.i)
# This takes an exodus file with a power profile and uses that in a heat structure
# of a core channel as power density. This tests the capability of taking a
# rattlesnake generated power profile and using it in RELAP-7.
[GlobalParams]
initial_p = 15.5e6
initial_vel = 0.
initial_T = 559.15
gravity_vector = '0 -9.8 0'
scaling_factor_1phase = '1 1 1e-4'
scaling_factor_temperature = 1e-2
closures = simple_closures
[]
[FluidProperties]
[water]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[SolidProperties]
[fuel-mat]
type = ThermalFunctionSolidProperties
k = 2.5
cp = 300.
rho = 1.032e4
[]
[gap-mat]
type = ThermalFunctionSolidProperties
k = 0.6
cp = 1.
rho = 1.
[]
[clad-mat]
type = ThermalFunctionSolidProperties
k = 21.5
cp = 350.
rho = 6.55e3
[]
[]
[Components]
[CCH1:pipe]
type = FlowChannel1Phase
position = '0.02 0 0'
orientation = '0 1 0'
length = 3.865
n_elems = 20
A = 8.78882e-5
D_h = 0.01179
f = 0.01
fp = water
[]
[CCH1:solid]
type = HeatStructureCylindrical
position = '0.024748 0 0'
orientation = '0 1 0'
length = 3.865
n_elems = 20
initial_T = 559.15
names = 'fuel gap clad'
widths = '0.004096 0.0001 0.000552'
n_part_elems = '5 1 2'
solid_properties = 'fuel-mat gap-mat clad-mat'
solid_properties_T_ref = '300 300 300'
[]
[CCH1:hx]
type = HeatTransferFromHeatStructure1Phase
flow_channel = CCH1:pipe
hs = CCH1:solid
hs_side = outer
Hw = 5.33e4
P_hf = 2.9832563838489e-2
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'CCH1:pipe:in'
m_dot = 0.1
T = 559.15
[]
[outlet]
type = Outlet1Phase
input = 'CCH1:pipe:out'
p = 15.5e6
[]
[]
[UserObjects]
[reactor_power_density_uo]
type = SolutionUserObject
mesh = 'power_profile.e'
system_variables = power_density
translation = '0. 0. 0.'
[]
[]
[Functions]
[power_density_fn]
type = SolutionFunction
from_variable = power_density
solution = reactor_power_density_uo
[]
[]
[AuxVariables]
[power_density]
family = MONOMIAL
order = CONSTANT
block = 'CCH1:solid:fuel'
[]
[]
[AuxKernels]
[power_density_aux]
type = FunctionAux
variable = power_density
function = power_density_fn
block = 'CCH1:solid:fuel'
execute_on = 'timestep_begin'
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0.0
num_steps = 10
dt = 1e-2
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 1e-12
nl_abs_tol = 1e-9
nl_max_its = 10
l_tol = 1e-3
l_max_its = 100
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Outputs]
[out]
type = Exodus
[]
velocity_as_vector = false
[]
(modules/thermal_hydraulics/test/tests/components/inlet_velocity_t_1phase/phy.reversed_flow.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_T = 444.447
initial_p = 7e6
initial_vel = 0
scaling_factor_1phase = '1 1 1e-5'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp
# geometry
position = '0 0 0'
orientation = '1 0 0'
A = 1.0000000000e-04
f = 0.0
length = 1
n_elems = 100
[]
[in]
type = InletVelocityTemperature1Phase
input = 'pipe:in'
vel = -1.0
T = 444.447
[]
[out]
type = InletStagnationPressureTemperature1Phase
input = 'pipe:out'
p0 = 7e6
T0 = 444.447
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
dt = 0.1
start_time = 0.0
end_time = 5
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 0
nl_abs_tol = 1e-6
nl_max_its = 10
l_tol = 1e-3
l_max_its = 100
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
abort_on_solve_fail = true
[]
[Outputs]
[exodus]
type = Exodus
file_base = phy.reversed_flow
show = 'vel T p'
[]
velocity_as_vector = false
[]
(modules/thermal_hydraulics/test/tests/actions/coupled_heat_transfer_action/sub_2phase.i)
# This is the 2-phase version of sub.i: it just adds the variable 'kappa'.
# Unfortunately, multi-parameter application of cli_args is not supported for
# sub-app input files, so sub.i cannot be re-used for the test.
[GlobalParams]
initial_p = 1.e5
initial_vel = 0.
initial_T = 300.
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[AuxVariables]
[Hw]
family = monomial
order = constant
block = pipe1
[]
[kappa]
family = monomial
order = constant
block = pipe1
[]
[]
[AuxKernels]
[Hw_ak]
type = ADMaterialRealAux
variable = Hw
property = 'Hw'
[]
[kappa_ak]
type = ConstantAux
variable = kappa
value = 0.5
[]
[]
[UserObjects]
[T_uo]
type = LayeredAverage
direction = y
variable = T
num_layers = 10
block = pipe1
[]
[Hw_uo]
type = LayeredAverage
direction = y
variable = Hw
num_layers = 10
block = pipe1
[]
[kappa_uo]
type = LayeredAverage
direction = y
variable = kappa
num_layers = 10
block = pipe1
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 1 0'
length = 1
n_elems = 10
A = 1.28584e-01
D_h = 8.18592e-01
f = 0.01
fp = eos
[]
[hxconn]
type = HeatTransferFromExternalAppTemperature1Phase
flow_channel = pipe1
Hw = 10000
P_hf = 6.28319e-01
initial_T_wall = 300.
var_type = elemental
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe1:in'
m_dot = 10
T = 400
[]
[outlet]
type = Outlet1Phase
input = 'pipe1:out'
p = 1e5
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Postprocessors]
[T_wall_avg]
type = ElementAverageValue
variable = T_wall
execute_on = 'INITIAL TIMESTEP_END'
[]
[htc_avg]
type = ElementAverageValue
variable = Hw
execute_on = 'INITIAL TIMESTEP_END'
[]
[T_avg]
type = ElementAverageValue
variable = T
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
dt = 0.1
dtmin = 1e-7
abort_on_solve_fail = true
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-7
nl_abs_tol = 1e-4
nl_max_its = 20
l_tol = 1e-3
l_max_its = 300
start_time = 0.0
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu'
[]
[Outputs]
[out]
type = Exodus
show = 'T_wall T Hw'
[]
[]
(modules/thermal_hydraulics/test/tests/components/form_loss_from_external_app_1phase/phy.form_loss_1phase.child.i)
[GlobalParams]
initial_p = 1e5
initial_vel = 0.5
initial_T = 300.0
gravity_vector = '0 0 0'
scaling_factor_1phase = '1 1e-2 1e-4'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '1 0 0'
length = 2
A = 1
n_elems = 10
f = 0
[]
[form_loss]
type = FormLossFromExternalApp1Phase
flow_channel = pipe
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe:in'
m_dot = 680
T = 300
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 1e5
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
dt = 0.1
abort_on_solve_fail = true
timestep_tolerance = 5e-14
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-8
nl_abs_tol = 5e-8
nl_max_its = 10
l_tol = 1e-3
l_max_its = 20
start_time = 0.0
end_time = 4.0
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Outputs]
exodus = true
show = 'K_prime p'
[]
(modules/thermal_hydraulics/test/tests/components/volume_junction_1phase/equal_area_no_junction.i)
# Tests a junction between 2 flow channels of equal area and orientation. A
# sinusoidal density shape is advected to the right and should not be affected
# by the junction; the solution should be identical to the equivalent
# no-junction solution.
#
# This input file has no junction and is used for comparison to the results with
# a junction.
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = 1e5
initial_vel = 1
A = 25
f = 0
fp = fp
scaling_factor_1phase = '0.04 0.04 0.04e-5'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 1.4
cv = 725
p_inf = 0
q = 0
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Functions]
[T0]
type = CosineHumpFunction
axis = x
hump_center_position = 1
hump_width = 0.5
hump_begin_value = 250
hump_center_value = 300
[]
[]
[Components]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe1:in'
# Stagnation property with p = 1e5 Pa, T = 250 K, vel = 1 m/s
p0 = 100000.68965687
T0 = 250.00049261084
[]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 2
initial_T = T0
n_elems = 50
[]
[outlet]
type = Outlet1Phase
input = 'pipe1:out'
p = 1e5
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 0.01
num_steps = 5
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 0
nl_abs_tol = 1e-6
nl_max_its = 10
l_tol = 1e-3
l_max_its = 10
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Postprocessors]
[junction_rhoA]
type = PointValue
variable = rhoA
point = '1.02 0 0'
execute_on = 'initial timestep_end'
[]
[junction_rhouA]
type = PointValue
variable = rhouA
point = '1.02 0 0'
execute_on = 'initial timestep_end'
[]
[junction_rhoEA]
type = PointValue
variable = rhoEA
point = '1.02 0 0'
execute_on = 'initial timestep_end'
[]
[junction_rho]
type = ScalePostprocessor
value = junction_rhoA
scaling_factor = 0.04
execute_on = 'initial timestep_end'
[]
[junction_rhou]
type = ScalePostprocessor
value = junction_rhouA
scaling_factor = 0.04
execute_on = 'initial timestep_end'
[]
[junction_rhoE]
type = ScalePostprocessor
value = junction_rhoEA
scaling_factor = 0.04
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
[out]
type = CSV
show = 'junction_rho junction_rhou junction_rhoE'
execute_scalars_on = 'none'
execute_on = 'initial timestep_end'
[]
[]
(modules/thermal_hydraulics/test/tests/components/outlet_1phase/clg.ctrl_p_3eqn.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = 1e5
initial_T = 300
initial_vel = 0.0
scaling_factor_1phase = '1 1 1e-5'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 50
A = 1.0000000000e-04
D_h = 1.1283791671e-02
f = 0.0
fp = fp
[]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe:in'
p0 = 1e5
T0 = 300
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 1e5
[]
[]
[Functions]
[outlet_p_fn]
type = PiecewiseLinear
x = '0 1'
y = '1e5 1.001e5'
[]
[]
[ControlLogic]
[set_outlet_value]
type = TimeFunctionComponentControl
component = outlet
parameter = p
function = outlet_p_fn
[]
[]
[Postprocessors]
[outlet_p]
type = RealComponentParameterValuePostprocessor
component = outlet
parameter = p
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0.0
dt = 0.25
num_steps = 5
abort_on_solve_fail = true
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-5
nl_abs_tol = 1e-6
nl_max_its = 30
l_tol = 1e-3
l_max_its = 100
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/misc/uniform_refine/test.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = 1e5
initial_T = 300
initial_vel = 0
closures = simple_closures
rdg_slope_reconstruction = FULL
f = 0
fp = eos
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[SolidProperties]
[mat1]
type = ThermalFunctionSolidProperties
rho = 10
cp = 1
k = 1
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 2
A = 1
[]
[pipe2]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '1 0 0'
length = 1
n_elems = 3
A = 1
[]
[junction]
type = VolumeJunction1Phase
connections = 'pipe1:out pipe2:in'
volume = 1e-5
position = '1 0 0'
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
use_scalar_variables = false
[]
[inlet]
type = SolidWall1Phase
input = 'pipe1:in'
[]
[outlet]
type = SolidWall1Phase
input = 'pipe2:out'
[]
[hs]
type = HeatStructureCylindrical
position = '0 1 0'
orientation = '1 0 0'
length = '1'
n_elems = '2'
names = '0'
widths = 0.5
n_part_elems = '1'
solid_properties = 'mat1'
solid_properties_T_ref = '300'
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 0
dt = 1e-4
num_steps = 1
abort_on_solve_fail = true
solve_type = 'NEWTON'
nl_rel_tol = 1e-5
nl_abs_tol = 1e-7
nl_max_its = 10
l_tol = 1e-3
l_max_its = 10
automatic_scaling = true
[]
[Outputs]
exodus = true
show = 'A'
[]
[Debug]
show_actions = true
[]
(modules/thermal_hydraulics/test/tests/components/shaft_connected_turbine_1phase/jac.test.i)
[GlobalParams]
initial_p = 2e5
initial_T = 500
initial_vel = 100
initial_vel_x = 100
initial_vel_y = 0
initial_vel_z = 0
length = 1
n_elems = 2
A = 0.1
A_ref = 0.1
closures = simple_closures
fp = fp
f = 0.01
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 1.4
cv = 725
p_inf = 0
q = 0
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[sw1]
type = SolidWall1Phase
input = fch1:in
[]
[fch1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
initial_p = 2e6
[]
[turbine]
type = ShaftConnectedTurbine1Phase
inlet = 'fch1:out'
outlet = 'fch2:in'
position = '1 0 0'
volume = 0.3
inertia_coeff = '1 1 1 1'
inertia_const = 1.61397
speed_cr_I = 1e12
speed_cr_fr = 0
tau_fr_coeff = '0 0 12 0'
tau_fr_const = 0
omega_rated = 295
D_wheel = 0.4
head_coefficient = head
power_coefficient = power
use_scalar_variables = false
[]
[fch2]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '1 0 0'
[]
[sw2]
type = SolidWall1Phase
input = fch2:out
[]
[shaft]
type = Shaft
connected_components = 'turbine'
initial_speed = 300
[]
[]
[Functions]
[head]
type = PiecewiseLinear
x = '0 0.1 1'
y = '0 15 20'
[]
[power]
type = PiecewiseLinear
x = '0 0.1 1'
y = '0 0.05 0.18'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 0.001
num_steps = 1
abort_on_solve_fail = true
solve_type = 'newton'
line_search = 'basic'
petsc_options_iname = '-snes_test_err'
petsc_options_value = '1e-9'
automatic_scaling = true
nl_rel_tol = 1e-8
nl_abs_tol = 1e-6
nl_max_its = 15
l_tol = 1e-4
l_max_its = 10
[]
(modules/thermal_hydraulics/test/tests/components/inlet_density_velocity_1phase/clg.densityvelocity_3eqn.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = 0.1e6
initial_vel = 0
initial_T = 300
scaling_factor_1phase = '1. 1. 1.'
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
# geometry
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 10
A = 1.907720E-04
f = 0.0
fp = eos
[]
[inlet]
type = InletDensityVelocity1Phase
input = 'pipe:in'
rho = 996.556340388366266
vel = 2
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 0.1e6
[]
[]
[Functions]
[inlet_rho_fn]
type = PiecewiseLinear
x = '0 1 '
y = '996 997'
[]
[inlet_vel_fn]
type = PiecewiseLinear
x = '1 2'
y = '1 2'
[]
[]
[ControlLogic]
[inlet_rho_ctrl]
type = TimeFunctionComponentControl
component = inlet
parameter = rho
function = inlet_rho_fn
[]
[inlet_vel_ctrl]
type = TimeFunctionComponentControl
component = inlet
parameter = vel
function = inlet_vel_fn
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 0.1
num_steps = 20
abort_on_solve_fail = true
solve_type = NEWTON
nl_rel_tol = 1e-9
nl_abs_tol = 1e-8
nl_max_its = 30
l_tol = 1e-3
l_max_its = 100
[]
[Postprocessors]
[rho_inlet]
type = RealComponentParameterValuePostprocessor
component = inlet
parameter = rho
[]
[vel_inlet]
type = RealComponentParameterValuePostprocessor
component = inlet
parameter = vel
[]
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/components/inlet_velocity_t_1phase/phy.velocity_t_3eqn.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_T = 444.447
initial_p = 7e6
initial_vel = 0
scaling_factor_1phase = '1 1 1e-5'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp
# geometry
position = '0 0 0'
orientation = '1 0 0'
A = 1.0000000000e-04
f = 0.0
length = 1
n_elems = 100
[]
[inlet]
type = InletVelocityTemperature1Phase
input = 'pipe:in'
vel = 1.0
T = 444.447
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 7e6
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
dt = 0.1
start_time = 0.0
end_time = 5.5
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 0
nl_abs_tol = 1e-6
nl_max_its = 10
l_tol = 1e-3
l_max_its = 100
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
abort_on_solve_fail = true
[]
[Outputs]
file_base = 'phy.velocity_t_3eqn'
[exodus]
type = Exodus
show = 'vel T p'
[]
velocity_as_vector = false
[]
(modules/thermal_hydraulics/test/tests/components/inlet_velocity_t_1phase/clg.velocity_t_3eqn.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_T = 444.447
initial_p = 7e6
initial_vel = 0
scaling_factor_1phase = '1 1 1e-5'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp
# geometry
position = '0 0 0'
orientation = '1 0 0'
A = 1.0000000000e-04
f = 0.0
length = 1
n_elems = 100
[]
[inlet]
type = InletVelocityTemperature1Phase
input = 'pipe:in'
vel = 1.0
T = 444.447
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 7e6
[]
[]
[Functions]
[inlet_vel_fn]
type = PiecewiseLinear
x = '0 1 2'
y = '0 0.1 1'
[]
[inlet_T_fn]
type = PiecewiseLinear
x = '0 1 2'
y = '300 400 440'
[]
[]
[ControlLogic]
[inlet_vel_ctrl]
type = TimeFunctionComponentControl
component = inlet
parameter = vel
function = inlet_vel_fn
[]
[inlet_T_ctrl]
type = TimeFunctionComponentControl
component = inlet
parameter = T
function = inlet_T_fn
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
dt = 0.1
start_time = 0.0
num_steps = 20
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 0
nl_abs_tol = 1e-6
nl_max_its = 10
l_tol = 1e-3
l_max_its = 100
abort_on_solve_fail = true
[]
[Postprocessors]
[vel_inlet]
type = RealComponentParameterValuePostprocessor
component = inlet
parameter = vel
[]
[T_inlet]
type = RealComponentParameterValuePostprocessor
component = inlet
parameter = T
[]
[]
[Outputs]
[out]
type = CSV
[]
[]
(modules/thermal_hydraulics/test/tests/misc/initial_from_file/heat_transfer_from_heat_structure/test.i)
# Test that the initial conditions read from the exodus file are correct
[GlobalParams]
scaling_factor_1phase = '1. 1.e-2 1.e-4'
scaling_factor_temperature = 1e-2
closures = simple_closures
initial_from_file = 'steady_state_out.e'
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[SolidProperties]
[mat1]
type = ThermalFunctionSolidProperties
k = 16
cp = 356.
rho = 6.551400E+03
[]
[]
[Functions]
[Ts_bc]
type = ParsedFunction
expression = '2*sin(x*pi)+507'
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp
# geometry
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 3
A = 1.907720E-04
D_h = 1.698566E-02
f = 0.1
[]
[hs]
type = HeatStructureCylindrical
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 3
names = 'wall'
n_part_elems = 1
solid_properties = 'mat1'
solid_properties_T_ref = '300'
inner_radius = 0.01
widths = 0.1
[]
[ht]
type = HeatTransferFromHeatStructure1Phase
flow_channel = pipe
hs = hs
hs_side = INNER
Hw = 10000
[]
[temp_outside]
type = HSBoundarySpecifiedTemperature
hs = hs
boundary = hs:outer
T = Ts_bc
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe:in'
m_dot = 0.1
T = 500
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 6e6
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 1
num_steps = 1
abort_on_solve_fail = true
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-7
nl_abs_tol = 1e-8
nl_max_its = 10
l_tol = 1e-3
l_max_its = 100
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu'
[]
[Outputs]
exodus = true
execute_on = 'initial'
velocity_as_vector = false
[]
(modules/thermal_hydraulics/test/tests/jacobians/materials/wall_friction_churchill.i)
# Tests the derivatives of WallFrictionChurchillMaterial
[JacobianTest1Phase]
A = 10
p = 1e5
T = 300
vel = 2
D_h = 3.57
fp_1phase = fp_1phase
[]
[FluidProperties]
[fp_1phase]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Materials]
[f_wall_mat]
type = WallFrictionChurchillMaterial
f_D = f_D
rhoA = rhoA
rhouA = rhouA
rhoEA = rhoEA
mu = mu
rho = rho
vel = vel
D_h = D_h
roughness = 1
[]
[]
[Kernels]
[test_kernel]
type = MaterialDerivativeTestKernel
variable = rhoA
material_property = f_D
coupled_variables = 'rhoA rhouA rhoEA'
[]
[]
(modules/thermal_hydraulics/test/tests/components/heat_source_volumetric_1phase/err.base.i)
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[total_power]
type = TotalPower
power = 1
[]
[fch1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 1'
length = 1
n_elems = 2
A = 1
f = 0.1
fp = fp
closures = simple_closures
initial_T = 300
initial_p = 1e05
initial_vel = 0
[]
[hs]
type = HeatSourceVolumetric1Phase
flow_channel = fch1
q = 1
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = fch1:in
m_dot = 1
T = 300
[]
[outlet]
type = Outlet1Phase
input = fch1:out
p = 1e-5
[]
[]
[Executioner]
type = Transient
dt = 1.e-2
[]
(modules/thermal_hydraulics/test/tests/postprocessors/real_component_parameter_value/non_existent_par_name.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = 1e5
initial_T = 300
initial_vel = 0.0
scaling_factor_1phase = '1 1 1e-5'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 50
A = 1.0000000000e-04
D_h = 1.1283791671e-02
f = 0.0
fp = fp
[]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe:in'
p0 = 1e5
T0 = 300
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 1e5
[]
[]
[Functions]
[p_fn]
type = PiecewiseLinear
x = '0 1'
y = '1e5 1.001e5'
[]
[]
[ControlLogic]
[outlet_p_fn]
type = GetFunctionValueControl
function = p_fn
[]
[set_outlet_value]
type = SetComponentRealValueControl
component = outlet
parameter = p
value = outlet_p_fn:value
[]
[]
[Postprocessors]
[outlet_p]
type = RealComponentParameterValuePostprocessor
component = inlet
parameter = p
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0.0
dt = 0.25
num_steps = 5
abort_on_solve_fail = true
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-5
nl_abs_tol = 1e-6
nl_max_its = 30
l_tol = 1e-3
l_max_its = 100
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
(modules/thermal_hydraulics/test/tests/problems/abrupt_area_change_liquid/base.i)
# Test 5 from the following reference:
#
# F. Daude, P. Galon. A Finite-Volume approach for compressible single- and
# two-phase flows in flexible pipelines with fluid-structure interaction.
# Journal of Computational Physics 362 (2018) 375-408.
#
# Also, Test 5 from the following reference:
#
# F. Daude, R.A. Berry, P. Galon. A Finite-Volume method for compressible
# non-equilibrium two-phase flows in networks of elastic pipelines using the
# Baer-Nunziato model.
# Computational Methods in Applied Mechanical Engineering 354 (2019) 820-849.
[GlobalParams]
gravity_vector = '0 0 0'
rdg_slope_reconstruction = none
fp = fp
closures = simple_closures
f = 0
initial_T = T_ic_fn
initial_p = p_ic_fn
initial_vel = 0
[]
[Functions]
[p_ic_fn]
type = PiecewiseConstant
axis = x
x = '0 ${x_disc}'
y = '${pL} ${pR}'
[]
[T_ic_fn]
type = PiecewiseConstant
axis = x
x = '0 ${x_disc}'
y = '${TL} ${TR}'
[]
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = ${gamma}
p_inf = ${p_inf}
q = ${q}
cv = ${cv}
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Postprocessors]
[dt_cfl]
type = ADCFLTimeStepSize
CFL = ${CFL}
vel_names = 'vel'
c_names = 'c'
[]
[]
[Executioner]
type = Transient
end_time = ${t_end}
[TimeStepper]
type = PostprocessorDT
postprocessor = dt_cfl
[]
[TimeIntegrator]
type = ExplicitSSPRungeKutta
order = 1
[]
solve_type = LINEAR
l_tol = 1e-4
nl_rel_tol = 1e-20
nl_abs_tol = 1e-8
nl_max_its = 60
[]
[Outputs]
[csv]
type = CSV
execute_postprocessors_on = 'NONE'
execute_vector_postprocessors_on = 'FINAL'
create_final_symlink = true
[]
[]
(modules/thermal_hydraulics/test/tests/controls/pid_control/test.i)
# This test "measures" the liquid temperature at location (10, 0, 0) on a 15 meters
# long pipe and adjusts the inlet stagnation temperature using a PID controller with
# set point at 340 K. The pipe is filled with water at T = 350 K. The purpose is to
# make sure that the channel fills with colder liquid and levels at the set point
# value. In steady state there should be a flat temperature profile at ~340 K.
[GlobalParams]
initial_p = 100.e3
initial_vel = 1.0
initial_T = 350.
scaling_factor_1phase = '1 1e-2 1e-4'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '1 0 0'
length = 15.0
n_elems = 10
A = 0.01
D_h = 0.1
f = 0.01
[]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe1:in'
p0 = 105.e3
T0 = 300.
[]
[outlet]
type = Outlet1Phase
input = 'pipe1:out'
p = 100.0e3
[]
[]
[ControlLogic]
[T_set_point]
type = GetFunctionValueControl
function = 340
[]
[pid_ctrl]
type = PIDControl
input = T_reading
set_point = T_set_point:value
K_i = 0.05
K_p = 0.2
K_d = 0.1
initial_value = 340
[]
[set_inlet_value]
type = SetComponentRealValueControl
component = inlet
parameter = T0
value = pid_ctrl:output
[]
[]
[Postprocessors]
[T_reading]
type = PointValue
point = '10 0 0'
variable = T
execute_on = timestep_begin
[]
[T_inlet]
type = PointValue
point = '0 0 0'
variable = T
execute_on = timestep_begin
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
dt = 5
abort_on_solve_fail = true
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-6
nl_abs_tol = 1e-6
nl_max_its = 20
l_tol = 1e-3
l_max_its = 5
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
start_time = 0.0
end_time = 300.0
[]
[Outputs]
[out]
type = CSV
execute_on = 'final'
[]
[console]
type = Console
max_rows = 1
[]
[]
(modules/thermal_hydraulics/test/tests/components/heat_source_volumetric_1phase/phy.conservation.1phase.i)
# Tests energy conservation for HeatSourceVolumetric component with 1-phase flow
[GlobalParams]
scaling_factor_1phase = '1 1e-2 1e-4'
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[flow_channel]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 10
A = 1
f = 0
fp = fp
closures = simple_closures
initial_T = 310
initial_p = 1e5
initial_vel = 0
[]
[wall1]
type = SolidWall1Phase
input = flow_channel:in
[]
[wall2]
type = SolidWall1Phase
input = flow_channel:out
[]
[heat_source]
type = HeatSourceVolumetric1Phase
flow_channel = flow_channel
q = 1e3
[]
[]
[Postprocessors]
[E_tot]
type = ElementIntegralVariablePostprocessor
variable = rhoEA
execute_on = 'initial timestep_end'
[]
[E_tot_change]
type = ChangeOverTimePostprocessor
change_with_respect_to_initial = true
postprocessor = E_tot
execute_on = 'initial timestep_end'
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
solve_type = 'NEWTON'
line_search = 'basic'
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.1
end_time = 1
abort_on_solve_fail = true
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
csv = true
show = 'E_tot_change'
execute_on = 'final'
[]
(modules/thermal_hydraulics/test/tests/components/inlet_stagnation_p_t_1phase/clg.ctrl_T0_3eqn.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = 1e5
initial_T = 300
initial_vel = 0.0
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 50
A = 1.0000000000e-04
D_h = 1.1283791671e-02
f = 0.0
fp = fp
[]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe:in'
p0 = 1.01e5
T0 = 300
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 1e5
[]
[]
[Functions]
[inlet_T0_fn]
type = PiecewiseLinear
x = '0 1'
y = '300 350'
[]
[]
[ControlLogic]
[set_inlet_value]
type = TimeFunctionComponentControl
component = inlet
parameter = T0
function = inlet_T0_fn
[]
[]
[Postprocessors]
[inlet_T0]
type = RealComponentParameterValuePostprocessor
component = inlet
parameter = T0
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0.0
dt = 0.25
num_steps = 5
abort_on_solve_fail = true
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-5
nl_abs_tol = 1e-6
nl_max_its = 30
l_tol = 1e-3
l_max_its = 100
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
automatic_scaling = true
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/components/inlet_mass_flow_rate_1phase/clg.ctrl_m_dot_3eqn_rdg.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = 1e5
initial_T = 300
initial_vel = 0.0
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 50
A = 1.0000000000e-04
D_h = 1.1283791671e-02
f = 0.0
fp = fp
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe:in'
m_dot = 0
T = 300
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 1e5
[]
[]
[Functions]
[inlet_m_dot_fn]
type = PiecewiseLinear
x = '0 1'
y = '0 0.5'
[]
[]
[ControlLogic]
[set_inlet_value]
type = TimeFunctionComponentControl
component = inlet
parameter = m_dot
function = inlet_m_dot_fn
[]
[]
[Postprocessors]
[inlet_m_dot]
type = RealComponentParameterValuePostprocessor
component = inlet
parameter = m_dot
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0.0
dt = 0.25
num_steps = 5
abort_on_solve_fail = true
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-10
nl_abs_tol = 1e-6
nl_max_its = 30
l_tol = 1e-3
l_max_its = 100
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/components/pump_1phase/pump_mass_energy_conservation.i)
# This test tests that mass and energy are conserved.
dt = 1.e-2
head = 95.
volume = 1.
A = 1.
g = 9.81
[GlobalParams]
initial_T = 393.15
initial_vel = 0
f = 0
fp = fp
scaling_factor_1phase = '0.04 0.04 0.04e-5'
closures = simple_closures
A = ${A}
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[wall_in]
type = SolidWall1Phase
input = 'pipe1:in'
[]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
initial_p = 1.7E+07
n_elems = 10
gravity_vector = '0 0 0'
[]
[pump]
type = Pump1Phase
connections = 'pipe1:out pipe2:in'
position = '1.02 0 0'
initial_p = 1.3e+07
scaling_factor_rhoEV = 1e-5
head = ${head}
A_ref = ${A}
volume = ${volume}
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
use_scalar_variables = false
[]
[pipe2]
type = FlowChannel1Phase
position = '1.04 0 0'
orientation = '1 0 0'
length = 1
initial_p = 1.3e+07
n_elems = 10
gravity_vector = '0 0 0'
[]
[wall_out]
type = SolidWall1Phase
input = 'pipe2:out'
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'implicit-euler'
start_time = 0
dt = ${dt}
num_steps = 6
abort_on_solve_fail = true
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
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Postprocessors]
# mass conservation
[mass_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoA
block = 'pipe1 pipe2'
execute_on = 'initial timestep_end'
[]
[mass_pump]
type = ElementAverageValue
variable = rhoV
block = 'pump'
execute_on = 'initial timestep_end'
[]
[mass_tot]
type = SumPostprocessor
values = 'mass_pipes mass_pump'
execute_on = 'initial timestep_end'
[]
[mass_tot_change]
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 = 'pipe1 pipe2'
execute_on = 'initial timestep_end'
[]
[E_pump]
type = ElementAverageValue
variable = rhoEV
block = 'pump'
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
indirect_dependencies = 'pump_rhouV'
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
[E_conservation]
type = FunctionValuePostprocessor
function = E_conservation_fcn
execute_on = 'timestep_end'
[]
[pump_rhouV]
type = ElementAverageValue
variable = rhouV
block = 'pump'
execute_on = 'initial timestep_end'
[]
[]
[Functions]
[S_energy_fcn]
type = ParsedFunction
expression = 'rhouV * g * head * A / volume'
symbol_names = 'rhouV g head A volume'
symbol_values = 'pump_rhouV ${g} ${head} ${A} ${volume}'
[]
[E_conservation_fcn]
type = ParsedFunction
expression = '(E_change - S_energy * dt) / E_tot'
symbol_names = 'E_change S_energy dt E_tot'
symbol_values = 'E_change S_energy ${dt} E_tot'
[]
[]
[Outputs]
[out]
type = CSV
execute_on = 'FINAL'
show = 'mass_tot_change E_conservation'
[]
[]
(modules/fluid_properties/test/tests/auxkernels/fluid_density_aux.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 2
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./pressure]
[../]
[./temperature]
[../]
[./density]
[../]
[]
[Kernels]
[./diff_u]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./pressure_ak]
type = ConstantAux
variable = pressure
value = 10e6
[../]
[./temperature_ak]
type = ConstantAux
variable = temperature
value = 400.0
[../]
[./density]
type = FluidDensityAux
variable = density
fp = eos
p = pressure
T = temperature
[../]
[]
[FluidProperties]
[./eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0.0
p_inf = 1e9
cv = 1816.0
[../]
[]
[BCs]
[./left_u]
type = DirichletBC
variable = u
boundary = 0
value = 1
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = 1
value = 2
[../]
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
[]
(modules/thermal_hydraulics/test/tests/components/inlet_density_velocity_1phase/jacobian.i)
[GlobalParams]
initial_p = 1e5
initial_T = 300
initial_vel = 2
scaling_factor_1phase = '1. 1. 1'
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[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.12837916709551
f = 0
length = 1
n_elems = 2
[]
[inlet]
type = InletDensityVelocity1Phase
input = 'pipe:in'
rho = 805
vel = 1
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 0
dt = 1e-2
num_steps = 1
abort_on_solve_fail = true
solve_type = 'NEWTON'
petsc_options_iname = '-snes_type -snes_test_err'
petsc_options_value = 'test 1e-11'
[]
(modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_3d/err.not_a_3d_hs.i)
[GlobalParams]
scaling_factor_1phase = '1 1 1e-3'
[]
[SolidProperties]
[mat]
type = ThermalFunctionSolidProperties
rho = 1000
cp = 100
k = 30
[]
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Functions]
[T_init]
type = ParsedFunction
expression = '1000*y+300+30*z'
[]
[]
[Components]
[fch]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 1'
fp = fp
n_elems = 6
length = 1
initial_T = 300
initial_p = 1.01e5
initial_vel = 1
closures = simple_closures
A = 0.00314159
D_h = 0.2
f = 0.01
[]
[in]
type = InletVelocityTemperature1Phase
input = 'fch:in'
vel = 1
T = 300
[]
[out]
type = Outlet1Phase
input = 'fch:out'
p = 1.01e5
[]
[blk]
type = HeatStructureCylindrical
position = '0 0 0'
orientation = '0 0 1'
widths = 0.1
inner_radius = 0.1
length = 1
n_elems = 6
n_part_elems = 1
initial_T = T_init
solid_properties = 'mat'
solid_properties_T_ref = '300'
names = blk
[]
[ht]
type = HeatTransferFromHeatStructure3D1Phase
flow_channels = 'fch'
hs = blk
boundary = blk:inner
Hw = 10000
P_hf = 0.156434465
[]
[]
[Postprocessors]
[energy_hs]
type = HeatStructureEnergy3D
block = blk:0
execute_on = 'INITIAL TIMESTEP_END'
[]
[energy_fch]
type = ElementIntegralVariablePostprocessor
block = fch
variable = rhoEA
execute_on = 'INITIAL TIMESTEP_END'
[]
[total_energy]
type = SumPostprocessor
values = 'energy_fch energy_hs'
execute_on = 'INITIAL TIMESTEP_END'
[]
[energy_change]
type = ChangeOverTimePostprocessor
change_with_respect_to_initial = true
postprocessor = total_energy
compute_relative_change = false
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
dt = 1
solve_type = PJFNK
line_search = basic
num_steps = 1000
steady_state_detection = true
steady_state_tolerance = 1e-08
nl_abs_tol = 1e-8
[]
(modules/thermal_hydraulics/test/tests/components/pump_1phase/jacobian.i)
[GlobalParams]
initial_T = 393.15
initial_vel = 0
initial_p = 17e+06
f = 0
fp = fp
closures = simple_closures
A = 1
gravity_vector = '0 0 0'
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 2
gravity_vector = '0 0 0'
[]
[pump]
type = Pump1Phase
connections = 'pipe1:out pipe2:in'
position = '1.02 0 0'
head = 95
A_ref = 1
volume = 1
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
use_scalar_variables = false
[]
[pipe2]
type = FlowChannel1Phase
position = '1.04 0 0'
orientation = '1 0 0'
length = 1
n_elems = 2
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 1e-2
num_steps = 1
abort_on_solve_fail = true
solve_type = 'NEWTON'
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
petsc_options_iname = '-snes_test_err'
petsc_options_value = '1e-9'
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
(modules/thermal_hydraulics/test/tests/postprocessors/flow_boundary_flux_1phase/test.i)
T_in = 300
p_out = 1e5
[GlobalParams]
initial_p = ${p_out}
initial_T = ${T_in}
initial_vel = 0
gravity_vector = '0 0 0'
closures = simple_closures
n_elems = 50
f = 0
scaling_factor_1phase = '1 1e-2 1e-4'
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'channel:in'
m_dot = 0.1
T = ${T_in}
[]
[channel]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '1 0 0'
length = 1
A = 3
[]
[outlet]
type = Outlet1Phase
p = ${p_out}
input = 'channel:out'
[]
[]
[Postprocessors]
[m_dot_in]
type = ADFlowBoundaryFlux1Phase
boundary = 'inlet'
equation = mass
[]
[m_dot_out]
type = ADFlowBoundaryFlux1Phase
boundary = 'outlet'
equation = mass
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
start_time = 0
num_steps = 10
dt = 0.1
solve_type = NEWTON
nl_rel_tol = 1e-6
nl_abs_tol = 1e-6
nl_max_its = 25
l_tol = 1e-3
l_max_its = 5
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
[out]
type = CSV
show = 'm_dot_in m_dot_out'
execute_on = 'final'
[]
[]
(modules/thermal_hydraulics/test/tests/components/flow_channel_1phase/phy.f_fn.3eqn.i)
# Tests that friction factor can be provided for 1-phase flow
f = 5
[GlobalParams]
gravity_vector = '0 0 0'
initial_T = 558
initial_p = 7.0e6
initial_vel = 0
scaling_factor_1phase = '1e0 1e-2 1e-4'
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Functions]
[f_func]
type = ConstantFunction
value = ${f}
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
# geometry
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 1
A = 1.907720E-04
D_h = 1.698566E-02
f = f_func
fp = eos
[]
[ht_pipe]
type = HeatTransferFromSpecifiedTemperature1Phase
flow_channel = pipe
T_wall = 559
P_hf = 0.0489623493599167
Hw = 50000
[]
[inlet]
type = InletDensityVelocity1Phase
input = 'pipe:in'
rho = 741.707129779398883
vel = 2
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 7.0e6
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 1
num_steps = 1
abort_on_solve_fail = true
solve_type = 'PJFNK'
nl_rel_tol = 1e-10
nl_abs_tol = 1e-8
nl_max_its = 30
l_tol = 1e-2
l_max_its = 30
[]
[Postprocessors]
[f]
type = ADElementIntegralMaterialProperty
mat_prop = f_D
block = pipe
[]
[]
[Outputs]
csv = true
show = 'f'
execute_on = 'timestep_end'
[]
(modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_flux_1phase/phy.energy_heatflux_ss_1phase.i)
# This test tests conservation of energy at steady state for 1-phase flow when a
# heat flux is specified. Conservation is checked by comparing the integral of
# the heat flux against the difference of the boundary fluxes.
[GlobalParams]
initial_p = 7.0e6
initial_vel = 0
initial_T = 513
gravity_vector = '0.0 0.0 0.0'
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 1'
length = 3.66
n_elems = 10
A = 1.907720E-04
D_h = 1.698566E-02
f = 0.0
fp = eos
[]
[ht_pipe]
type = HeatTransferFromHeatFlux1Phase
flow_channel = pipe
q_wall = 1.0e5
Hw = 1.0e4
P_hf = 4.4925e-2
[]
[inlet]
type = SolidWall1Phase
input = 'pipe:in'
[]
[outlet]
type = SolidWall1Phase
input = 'pipe:out'
[]
[]
[Postprocessors]
[E]
type = ElementIntegralVariablePostprocessor
variable = rhoEA
execute_on = 'initial timestep_end'
[]
[E_change]
type = ChangeOverTimePostprocessor
postprocessor = E
execute_on = 'initial timestep_end'
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
abort_on_solve_fail = true
dt = 1
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-10
nl_abs_tol = 1e-7
nl_max_its = 50
l_tol = 1e-3
l_max_its = 60
start_time = 0
num_steps = 10
[]
[Outputs]
[out]
type = CSV
show = 'E_change'
[]
[console]
type = Console
show = 'E_change'
[]
[]
(modules/thermal_hydraulics/test/tests/components/volume_junction_1phase/t_junction_1phase.i)
# Junction between 3 pipes, 1 of which goes to a dead-end. All ends are walls,
# and 1 of the pipes is pressurized higher than the others.
A_big = 1
A_small = 0.5
[GlobalParams]
gravity_vector = '0 0 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
initial_T = 300
initial_vel = 0
n_elems = 20
length = 1
f = 0
fp = fp
rdg_slope_reconstruction = minmod
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 1.4
cv = 725
q = 0
q_prime = 0
p_inf = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
A = ${A_big}
# This pipe is pressurized higher than the others.
initial_p = 1.05e5
[]
[pipe2]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '1 0 0'
A = ${A_big}
initial_p = 1e5
[]
[pipe3]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '0 1 0'
# This pipe is smaller than the others.
A = ${A_small}
initial_p = 1e5
[]
[junction]
type = VolumeJunction1Phase
connections = 'pipe1:out pipe2:in pipe3:in'
position = '1 0 0'
volume = 0.37
initial_p = 1e5
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
use_scalar_variables = false
[]
[pipe1_wall]
type = SolidWall1Phase
input = 'pipe1:in'
[]
[pipe2_wall]
type = SolidWall1Phase
input = 'pipe2:out'
[]
[pipe3_wall]
type = SolidWall1Phase
input = 'pipe3:out'
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
end_time = 5
dt = 0.05
num_steps = 5
abort_on_solve_fail = true
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 10
l_tol = 1e-3
l_max_its = 10
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Postprocessors]
# mass conservation
[mass_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoA
block = 'pipe1 pipe2 pipe3'
execute_on = 'initial timestep_end'
[]
[mass_junction]
type = ElementAverageValue
variable = rhoV
block = 'junction'
execute_on = 'initial timestep_end'
[]
[mass_tot]
type = SumPostprocessor
values = 'mass_pipes mass_junction'
execute_on = 'initial timestep_end'
[]
[mass_tot_change]
type = ChangeOverTimePostprocessor
change_with_respect_to_initial = true
postprocessor = mass_tot
compute_relative_change = true
execute_on = 'initial timestep_end'
[]
# energy conservation
[E_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoEA
block = 'pipe1 pipe2 pipe3'
execute_on = 'initial timestep_end'
[]
[E_junction]
type = ElementAverageValue
variable = rhoEV
block = 'junction'
execute_on = 'initial timestep_end'
[]
[E_tot]
type = SumPostprocessor
values = 'E_pipes E_junction'
execute_on = 'initial timestep_end'
[]
[E_tot_change]
type = ChangeOverTimePostprocessor
change_with_respect_to_initial = true
postprocessor = E_tot
compute_relative_change = true
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
[out]
type = CSV
show = 'mass_tot_change E_tot_change'
[]
[]
(modules/thermal_hydraulics/test/tests/controls/set_component_real_value_control/test.i)
# This is testing that the values set by SetComponentRealValueControl are used.
# Function T0_fn prescribes values for T0 at inlet. We output the function
# values via a postprocessor `T_fn` and the inlet values via another
# postprocessor `T_ctrl`. Those two values have to be equal.
[GlobalParams]
initial_p = 100.e3
initial_vel = 1.0
initial_T = 350.
scaling_factor_1phase = '1 1e-2 1e-4'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '1 0 0'
length = 15.0
n_elems = 10
A = 0.01
D_h = 0.1
f = 0.01
[]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe1:in'
p0 = 100.e3
T0 = 350.
[]
[outlet]
type = Outlet1Phase
input = 'pipe1:out'
p = 100.0e3
[]
[]
[Functions]
[T0_fn]
type = PiecewiseLinear
x = '0 1'
y = '350 345'
[]
[]
[ControlLogic]
[T_inlet_fn]
type = GetFunctionValueControl
function = T0_fn
[]
[set_inlet_value]
type = SetComponentRealValueControl
component = inlet
parameter = T0
value = T_inlet_fn:value
[]
[]
[Postprocessors]
[T_fn]
type = FunctionValuePostprocessor
function = T0_fn
[]
[T_ctrl]
type = RealComponentParameterValuePostprocessor
component = inlet
parameter = T0
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
dt = 0.1
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 1e-6
nl_abs_tol = 1e-6
nl_max_its = 20
l_tol = 1e-3
l_max_its = 5
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
start_time = 0.0
end_time = 1
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/misc/initial_from_file/flow_channel/err.non_existent_block.i)
[GlobalParams]
closures = simple_closures
initial_from_file = 'steady_state_out.e'
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[asdf]
type = FlowChannel1Phase
fp = fp
# geometry
position = '1 0 0'
orientation = '1 0 0'
length = 1
n_elems = 3
A = 1.907720E-04
D_h = 1.698566E-02
f = 0.1
[]
[inlet]
type = SolidWall1Phase
input = 'asdf:in'
[]
[outlet]
type = SolidWall1Phase
input = 'asdf:out'
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
[]
(modules/thermal_hydraulics/test/tests/components/inlet_mass_flow_rate_1phase/phy.reversed_flow.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_T = 444.447
initial_p = 7e6
initial_vel = 0
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp
# geometry
position = '0 0 0'
orientation = '1 0 0'
A = 1.0000000000e-04
D_h = 1.1283791671e-02
f = 0.1
length = 1
n_elems = 20
[]
[in]
type = InletMassFlowRateTemperature1Phase
input = 'pipe:in'
m_dot = -0.18
T = 444.447
[]
[out]
type = InletStagnationPressureTemperature1Phase
input = 'pipe:out'
p0 = 7e6
T0 = 444.447
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
dt = 0.1
start_time = 0.0
num_steps = 30
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
abort_on_solve_fail = true
[]
[Outputs]
[exodus]
type = Exodus
file_base = phy.reversed_flow
show = 'rhouA T p'
[]
[]
(modules/thermal_hydraulics/test/tests/misc/adapt/single_block.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = 1e5
initial_T = 300
initial_vel = 0
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
# geometry
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 20
A = 1.0000000000e-04
D_h = 1.1283791671e-02
f = 0.
fp = eos
[]
[inlet]
type = InletDensityVelocity1Phase
input = 'pipe1:in'
rho = 996.561962436227759
vel = 1
[]
[outlet]
type = Outlet1Phase
input = 'pipe1:out'
p = 1e5
[]
[]
[Outputs]
exodus = true
show = 'rhoA rhouA rhoEA'
[console]
type = Console
print_mesh_changed_info = true
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 0.0
dt = 1e-5
num_steps = 5
abort_on_solve_fail = true
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-9
nl_abs_tol = 1e-8
nl_max_its = 10
l_tol = 1e-3
l_max_its = 100
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu'
[Adaptivity]
initial_adaptivity = 0 # There seems to be a bug with non-zero initial adaptivity
refine_fraction = 0.60
coarsen_fraction = 0.30
max_h_level = 4
[]
[]
(modules/thermal_hydraulics/test/tests/auxkernels/reynolds_number/1phase.i)
# Use ReynoldsNumberAux to compute Reynolds number
[GlobalParams]
family = MONOMIAL
order = CONSTANT
[]
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
allow_renumbering = false
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[AuxVariables]
[reynolds_no]
[]
[rho]
initial_condition = 1000
[]
[vel]
initial_condition = 1
[]
[D_h]
initial_condition = 1.1283791671e-02
[]
[v]
initial_condition = 1e-3
[]
[e]
initial_condition = 1e5
[]
[]
[AuxKernels]
[rn_aux]
type = ReynoldsNumberAux
variable = reynolds_no
rho = rho
vel = vel
D_h = D_h
v = v
e = e
fp = fp
[]
[]
[Problem]
solve = false
[]
[Postprocessors]
[reynolds_no]
type = ElementalVariableValue
variable = reynolds_no
elementid = 0
[]
[]
[Executioner]
type = Transient
dt = 1
num_steps = 1
abort_on_solve_fail = true
[]
[Outputs]
csv = true
execute_on = TIMESTEP_END
[]
(modules/thermal_hydraulics/test/tests/jacobians/kernels/one_d_energy_wall_heating.i)
[JacobianTest1Phase]
A = 1
p = 1e6
T = 300
vel = 2
aux_variable_names = 'tw phf'
aux_variable_values = '310 1'
snes_test_err = 1e-9
fp_1phase = fp_1phase
[]
[FluidProperties]
[fp_1phase]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Materials]
[const_mat_props]
type = GenericConstantMaterial
prop_names = 'htc'
prop_values = '1e4'
[]
[]
[Kernels]
[mom_flux]
type = OneDEnergyWallHeating
variable = rhoEA
rhoA = rhoA
rhouA = rhouA
rhoEA = rhoEA
T_wall = tw
Hw = htc
P_hf = phf
T = T
[]
[]
(modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_3d/phy.conservation_ss.i)
# Testing energy conservation at steady state
P_hf = ${fparse 0.6 * sin (pi/24)}
[GlobalParams]
scaling_factor_1phase = '1 1 1e-3'
gravity_vector = '0 0 0'
[]
[Materials]
[mat]
type = ADGenericConstantMaterial
block = 'blk:0'
prop_names = 'density specific_heat thermal_conductivity'
prop_values = '1000 10 30'
[]
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[in1]
type = InletVelocityTemperature1Phase
input = 'fch1:in'
vel = 1
T = 300
[]
[fch1]
type = FlowChannel1Phase
position = '0.15 0 0'
orientation = '0 0 1'
fp = fp
n_elems = 10
length = 1
initial_T = 300
initial_p = 1.01e5
initial_vel = 1
closures = simple_closures
A = 0.00314159
f = 0.0
[]
[out1]
type = Outlet1Phase
input = 'fch1:out'
p = 1.01e5
[]
[in2]
type = InletVelocityTemperature1Phase
input = 'fch2:in'
vel = 1
T = 350
[]
[fch2]
type = FlowChannel1Phase
position = '0 0.15 0'
orientation = '0 0 1'
fp = fp
n_elems = 10
length = 1
initial_T = 350
initial_p = 1.01e5
initial_vel = 1
closures = simple_closures
A = 0.00314159
f = 0
[]
[out2]
type = Outlet1Phase
input = 'fch2:out'
p = 1.01e5
[]
[blk]
type = HeatStructureFromFile3D
file = mesh.e
position = '0 0 0'
initial_T = 325
[]
[ht]
type = HeatTransferFromHeatStructure3D1Phase
flow_channels = 'fch1 fch2'
hs = blk
boundary = blk:rmin
Hw = 10000
P_hf = ${P_hf}
[]
[]
[Postprocessors]
[E_in1]
type = ADFlowBoundaryFlux1Phase
boundary = in1
equation = energy
execute_on = 'initial timestep_end'
[]
[E_out1]
type = ADFlowBoundaryFlux1Phase
boundary = out1
equation = energy
execute_on = 'initial timestep_end'
[]
[hf_pipe1]
type = ADHeatRateConvection1Phase
block = fch1
T_wall = T_wall
T = T
Hw = Hw
P_hf = ${P_hf}
execute_on = 'initial timestep_end'
[]
[E_diff1]
type = DifferencePostprocessor
value1 = E_in1
value2 = E_out1
execute_on = 'initial timestep_end'
[]
[E_conservation1]
type = SumPostprocessor
values = 'E_diff1 hf_pipe1'
[]
[E_in2]
type = ADFlowBoundaryFlux1Phase
boundary = in2
equation = energy
execute_on = 'initial timestep_end'
[]
[E_out2]
type = ADFlowBoundaryFlux1Phase
boundary = out2
equation = energy
execute_on = 'initial timestep_end'
[]
[hf_pipe2]
type = ADHeatRateConvection1Phase
block = fch2
T_wall = T_wall
T = T
Hw = Hw
P_hf = ${P_hf}
execute_on = 'initial timestep_end'
[]
[E_diff2]
type = DifferencePostprocessor
value1 = E_in2
value2 = E_out2
execute_on = 'initial timestep_end'
[]
[E_conservation2]
type = SumPostprocessor
values = 'E_diff2 hf_pipe2'
[]
[E_conservation_hs]
type = SumPostprocessor
values = 'hf_pipe1 hf_pipe2'
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
dt = 5
end_time = 100
solve_type = NEWTON
line_search = basic
abort_on_solve_fail = true
nl_abs_tol = 1e-8
[]
[Outputs]
file_base = 'phy.conservation_ss'
[csv]
type = CSV
show = 'E_conservation1 E_conservation2 E_conservation_hs'
execute_on = 'FINAL'
[]
[]
(modules/fluid_properties/test/tests/auxkernels/stagnation_temperature_aux.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 2
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./specific_internal_energy]
[../]
[./specific_volume]
[../]
[./velocity]
[../]
[./stagnation_temperature]
[../]
[]
[Kernels]
[./diff_u]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./specific_internal_energy_ak]
type = ConstantAux
variable = specific_internal_energy
value = 1026.2e3
[../]
[./specific_volume_ak]
type = ConstantAux
variable = specific_volume
value = 0.0012192
[../]
[./velocity_ak]
type = ConstantAux
variable = velocity
value = 10.0
[../]
[./stagnation_temperature_ak]
type = StagnationTemperatureAux
variable = stagnation_temperature
e = specific_internal_energy
v = specific_volume
vel = velocity
fp = eos
[../]
[]
[FluidProperties]
[./eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0.0
p_inf = 1e9
cv = 1816.0
[../]
[]
[BCs]
[./left_u]
type = DirichletBC
variable = u
boundary = 0
value = 1
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = 1
value = 2
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
exodus = true
[]
(modules/thermal_hydraulics/test/tests/components/inlet_density_velocity_1phase/phy.densityvelocity_3eqn.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_T = 510
initial_p = 7e6
initial_vel = 0
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp
# geometry
position = '0 0 0'
orientation = '1 0 0'
A = 3.1415926536e-06
D_h = 2.0000000000e-03
f = 0.1
length = 1
n_elems = 10
[]
[inlet]
type = InletDensityVelocity1Phase
input = 'pipe:in'
rho = 805
vel = 1
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 7e6
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
dt = 1e-1
start_time = 0.0
num_steps = 50
abort_on_solve_fail = true
solve_type = 'NEWTON'
nl_rel_tol = 1e-6
nl_abs_tol = 1e-7
nl_max_its = 5
l_tol = 1e-3
l_max_its = 100
[]
[Outputs]
exodus = true
execute_on = 'final'
velocity_as_vector = false
show = 'rho vel'
[]
(modules/thermal_hydraulics/test/tests/components/pump_1phase/pump_pressure_check.i)
# This test checks that the expected pressure rise due to the user supplied
# pump head matches the actual pressure rise across the pump.
# The orientation of flow channels in this test have no components in the z-direction
# due to the expected_pressure_rise_fcn not accounting for hydrostatic pressure.
head = 95.
dt = 0.1
g = 9.81
volume = 0.567
[GlobalParams]
initial_T = 393.15
initial_vel = 0.0372
A = 0.567
f = 0
fp = fp
scaling_factor_1phase = '1 1 1e-5'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Functions]
[expected_pressure_rise_fcn]
type = ParsedFunction
expression = 'rhoV * g * head / volume'
symbol_names = 'rhoV g head volume'
symbol_values = 'pump_rhoV ${g} ${head} ${volume}'
[]
[]
[Components]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe1:in'
m_dot = 20
T = 393.15
[]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
initial_p = 1.318964e+07
n_elems = 10
[]
[pump]
type = Pump1Phase
connections = 'pipe1:out pipe2:in'
position = '1.02 0 0'
initial_p = 1.318964e+07
scaling_factor_rhoEV = 1e-5
head = ${head}
volume = ${volume}
A_ref = 0.567
initial_vel_x = 1
initial_vel_y = 1
initial_vel_z = 0
use_scalar_variables = false
[]
[pipe2]
type = FlowChannel1Phase
position = '1.04 0 0'
orientation = '0 2 0'
length = 0.96
initial_p = 1.4072E+07
n_elems = 10
[]
[outlet]
type = Outlet1Phase
input = 'pipe2:out'
p = 1.4072E+07
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'implicit-euler'
start_time = 0
dt = ${dt}
num_steps = 4
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-6
nl_max_its = 15
l_tol = 1e-4
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Postprocessors]
[pump_rhoV]
type = ElementAverageValue
variable = rhoV
block = 'pump'
execute_on = 'initial timestep_end'
[]
[expected_pressure_rise]
type = FunctionValuePostprocessor
function = expected_pressure_rise_fcn
indirect_dependencies = 'pump_rhoV'
execute_on = 'initial timestep_end'
[]
[p_inlet]
type = SideAverageValue
variable = p
boundary = 'pipe1:out'
execute_on = 'initial timestep_end'
[]
[p_outlet]
type = SideAverageValue
variable = p
boundary = 'pipe2:in'
execute_on = 'initial timestep_end'
[]
[actual_pressure_rise]
type = DifferencePostprocessor
value1 = p_outlet
value2 = p_inlet
execute_on = 'timestep_end'
[]
[pressure_rise_diff]
type = RelativeDifferencePostprocessor
value1 = actual_pressure_rise
value2 = expected_pressure_rise
execute_on = 'timestep_end'
[]
[]
[Outputs]
[out]
type = CSV
execute_on = 'FINAL'
show = 'pressure_rise_diff'
[]
[]
(modules/thermal_hydraulics/test/tests/components/component/err.setup_status.i)
# This test tests the setup-status-checking capability of Component. In this
# test, a Pipe component is coupled to a test component, which tries to call
# a Pipe function that retrieves data that has not been set yet. This function
# has the call that is being tested, which should produce an error because it
# is being called before Pipe's init() function was called, due to the test
# component being added before the Pipe.
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[a_test_component]
type = TestSetupStatusComponent
flow_channel = pipe
[]
[pipe]
type = FlowChannel1Phase
fp = fp
closures = simple_closures
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 1
A = 1
initial_T = 300
initial_p = 1e5
initial_vel = 0
f = 0
[]
[left_boundary]
type = FreeBoundary
input = 'pipe:in'
[]
[right_boundary]
type = FreeBoundary
input = 'pipe:out'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
[]
(modules/thermal_hydraulics/test/tests/components/junction_parallel_channels_1phase/equal_area_with_junction.i)
# Tests a junction between 2 flow channels of equal area and orientation. A
# sinusoidal density shape is advected to the right and should not be affected
# by the junction; the solution should be identical to the equivalent
# no-junction solution.
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = 1e5
initial_vel = 1
A = 25
f = 0
fp = fp
scaling_factor_1phase = '0.04 0.04 0.04e-5'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 1.4
cv = 725
p_inf = 0
q = 0
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Functions]
[T0]
type = CosineHumpFunction
axis = x
hump_center_position = 1
hump_width = 0.5
hump_begin_value = 250
hump_center_value = 300
[]
[]
[Components]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe1:in'
# Stagnation property with p = 1e5 Pa, T = 250 K, vel = 1 m/s
p0 = 100000.68965687
T0 = 250.00049261084
[]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
initial_T = T0
n_elems = 25
[]
[junction]
type = JunctionParallelChannels1Phase
connections = 'pipe1:out pipe2:in'
position = '1.02 0 0'
volume = 1.0
initial_T = T0
initial_vel_x = 1
initial_vel_y = 0
initial_vel_z = 0
scaling_factor_rhoV = 1
scaling_factor_rhouV = 1
scaling_factor_rhovV = 1
scaling_factor_rhowV = 1
scaling_factor_rhoEV = 1e-5
use_scalar_variables = false
[]
[pipe2]
type = FlowChannel1Phase
position = '1.04 0 0'
orientation = '1 0 0'
length = 0.96
initial_T = T0
n_elems = 24
[]
[outlet]
type = Outlet1Phase
input = 'pipe2:out'
p = 1e5
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 0.01
num_steps = 5
abort_on_solve_fail = true
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu'
line_search = 'basic'
nl_rel_tol = 0
nl_abs_tol = 1e-6
nl_max_its = 10
l_tol = 1e-3
l_max_its = 10
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Postprocessors]
[junction_rho]
type = ElementAverageValue
variable = rhoV
block = 'junction'
execute_on = 'initial timestep_end'
[]
[junction_rhou]
type = ElementAverageValue
variable = rhouV
block = 'junction'
execute_on = 'initial timestep_end'
[]
[junction_rhoE]
type = ElementAverageValue
variable = rhoEV
block = 'junction'
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
[out]
type = CSV
execute_scalars_on = 'none'
execute_on = 'initial timestep_end'
[]
[]
(modules/thermal_hydraulics/test/tests/jacobians/constraints/mass_free_constraint.i)
[JacobianTest1Phase]
A = 1e2
p = 1e6
T = 300
vel = -2
snes_test_err = 1e-6
generate_mesh = false
fp_1phase = fp_1phase
[]
[FluidProperties]
[fp_1phase]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Mesh]
file = ../meshes/2pipes.e
construct_side_list_from_node_list = true
[]
[Constraints]
[mass]
type = MassFreeConstraint
variable = rhoA
nodes = '1 2'
normals = '1 -1'
rhouA = rhouA
[]
[]
(modules/thermal_hydraulics/test/tests/components/inlet_stagnation_p_t_1phase/phy.stagnation_p_T_transient_3eqn.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = 101325
initial_T = 300
initial_vel = 0
scaling_factor_1phase = '1 1 1e-4'
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = eos
# geometry
position = '0 0 0'
orientation = '1 0 0'
A = 1.
f = 0.0
length = 1
n_elems = 10
[]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe:in'
p0 = 102041.128
T0 = 300.615
reversible = false
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 101325
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 1e-4
num_steps = 10
abort_on_solve_fail = true
solve_type = 'NEWTON'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-7
nl_max_its = 30
l_tol = 1e-3
l_max_its = 100
[]
[Outputs]
[out]
type = Exodus
[]
velocity_as_vector = false
[]
(modules/thermal_hydraulics/test/tests/problems/freefall/freefall.i)
# Tests acceleration of a fluid due to gravity. The flow exiting the bottom
# of the flow channel enters the top, so the flow should uniformly accelerate
# at the rate of acceleration due to gravity.
acceleration = -10.0
dt = 0.1
num_steps = 5
time = ${fparse num_steps * dt}
# The expected velocity is the following:
# u = a * t
# = -10 * 0.5
# = -5
[GlobalParams]
gravity_vector = '0 0 ${acceleration}'
initial_p = 1e5
initial_T = 300
initial_vel = 0
scaling_factor_1phase = '1 1 1e-5'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816
q = -1.167e6
q_prime = 0
p_inf = 1e9
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 1'
length = 1
n_elems = 100
A = 1
f = 0
fp = fp
[]
[junction]
type = JunctionOneToOne1Phase
connections = 'pipe:in pipe:out'
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
end_time = ${time}
dt = ${dt}
num_steps = ${num_steps}
abort_on_solve_fail = true
solve_type = NEWTON
nl_abs_tol = 1e-8
nl_rel_tol = 1e-8
nl_max_its = 10
l_tol = 1e-3
l_max_its = 10
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Postprocessors]
[vel_avg]
type = ElementAverageValue
variable = 'vel'
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Outputs]
velocity_as_vector = false
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/thermal_hydraulics/test/tests/problems/three_pipe_shock/three_pipe_shock.i)
# Test 8 from the following reference:
#
# F. Daude, P. Galon. A Finite-Volume approach for compressible single- and
# two-phase flows in flexible pipelines with fluid-structure interaction.
# Journal of Computational Physics 362 (2018) 375-408.
L1 = 10
L2 = 3
L3 = 5
xJ = ${L1}
x_p1 = ${fparse xJ - 1.05}
x_p2 = ${fparse xJ + 0.15}
x_p3 = ${fparse xJ + 0.95}
N1 = 1000
N2 = 300
N3 = 500
D1 = 0.35682482
D2 = 0.19544100
D3 = 0.35682482
A1 = ${fparse 0.25 * pi * D1^2}
A2 = ${fparse 0.25 * pi * D2^2}
A3 = ${fparse 0.25 * pi * D3^2}
AJ = ${fparse A1 + A2 + A3}
RJ = ${fparse sqrt(AJ / (4 * pi))} # A = 4 pi R^2
VJ = ${fparse 4/3 * pi * RJ^3}
y2 = 1
y3 = -1
gamma = 2.23
p_inf = 1e9 # denoted by "pi" in reference
q = 0
cv = 2500 # arbitrary value; not given in reference
CFL = 0.8
t_end = 0.01
p_out = 80e5
initial_p = ${p_out}
initial_T = 327.1864956 # reference has rho = 1001.89 kg/m^3
initial_vel1 = 1
initial_vel2 = 0.769
initial_vel3 = 0.769
[GlobalParams]
gravity_vector = '0 0 0'
initial_T = ${initial_T}
initial_p = ${initial_p}
fp = fp
closures = closures
f = 0
rdg_slope_reconstruction = none
scaling_factor_1phase = '1 1 1e-5'
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = ${gamma}
p_inf = ${p_inf}
q = ${q}
cv = ${cv}
[]
[]
[Closures]
[closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = ${L1}
n_elems = ${N1}
A = ${A1}
initial_vel = ${initial_vel1}
[]
[pipe2]
type = FlowChannel1Phase
position = '${xJ} ${y2} 0'
orientation = '1 0 0'
length = ${L2}
n_elems = ${N2}
A = ${A2}
initial_vel = ${initial_vel2}
[]
[pipe3]
type = FlowChannel1Phase
position = '${xJ} ${y3} 0'
orientation = '1 0 0'
length = ${L3}
n_elems = ${N3}
A = ${A3}
initial_vel = ${initial_vel3}
[]
[junction]
type = VolumeJunction1Phase
connections = 'pipe1:out pipe2:in pipe3:in'
position = '${xJ} 0 0'
volume = ${VJ}
initial_vel_x = ${initial_vel2} # ?
initial_vel_y = 0
initial_vel_z = 0
scaling_factor_rhoEV = 1e-5
apply_velocity_scaling = true
[]
[outlet1]
type = Outlet1Phase
input = 'pipe1:in'
p = ${p_out}
[]
[outlet2]
type = Outlet1Phase
input = 'pipe2:out'
p = ${p_out}
[]
[wall3]
type = SolidWall1Phase
input = 'pipe3:out'
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Postprocessors]
[dt_cfl]
type = ADCFLTimeStepSize
CFL = ${CFL}
vel_names = 'vel'
c_names = 'c'
[]
[p1]
type = PointValue
variable = p
point = '${x_p1} 0 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p2]
type = PointValue
variable = p
point = '${x_p2} ${y2} 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p3]
type = PointValue
variable = p
point = '${x_p3} ${y3} 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = ${t_end}
[TimeStepper]
type = PostprocessorDT
postprocessor = dt_cfl
[]
[TimeIntegrator]
type = ActuallyExplicitEuler
[]
solve_type = LINEAR
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu '
l_tol = 1e-4
l_max_its = 10
[]
[Times]
[output_times]
type = TimeIntervalTimes
time_interval = 1e-4
[]
[]
[Outputs]
file_base = 'three_pipe_shock'
[csv]
type = CSV
show = 'p1 p2 p3'
sync_only = true
sync_times_object = output_times
[]
[]
(modules/thermal_hydraulics/test/tests/components/inlet_stagnation_p_t_1phase/phy.p0T0_3eqn.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = 1e6
initial_T = 453.1
initial_vel = 0.0
scaling_factor_1phase = '1 1 1e-5'
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 50
A = 1.0000000000e-04
D_h = 1.1283791671e-02
f = 0.0
fp = eos
[]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe:in'
p0 = 1e6
T0 = 453.1
reversible = false
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 0.5e6
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
dt = 1.e-2
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 1e-5
nl_abs_tol = 1e-6
nl_max_its = 30
l_tol = 1e-3
l_max_its = 100
start_time = 0.0
end_time = 0.6
[]
[Outputs]
file_base = 'phy.p0T0_3eqn'
[out]
type = Exodus
[]
velocity_as_vector = false
[]
(modules/thermal_hydraulics/test/tests/components/flow_connection/err.connecting_to_non_existent_component.i)
# Tests that we report an error if users try to connect to a non-existent component
[GlobalParams]
initial_p = 1e5
initial_T = 300
initial_vel = 0
closures = simple_closures
[]
[FluidProperties]
[water]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
fp = water
position = '0 0 0'
orientation = '0 1 0'
length = 1
n_elems = 2
A = 1e-4
f = 0
[]
[inlet_1p]
type = InletMassFlowRateTemperature1Phase
input = 'pipe:in'
m_dot = 1
T = 300
[]
[outlet_1p]
type = Outlet1Phase
input = 'pipe1:out'
p = 1e5
[]
[]
[Executioner]
type = Transient
dt = 0.01
[]
(modules/thermal_hydraulics/test/tests/misc/adapt/multiple_blocks.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = 1e5
initial_T = 300
initial_vel = 0
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[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 = 1
f = 0
[]
[pipe2]
type = FlowChannel1Phase
fp = eos
position = '1 0 0'
orientation = '1 0 0'
length = 1
n_elems = 10
A = 1
f = 0
[]
[junction]
type = VolumeJunction1Phase
connections = 'pipe1:out pipe2:in'
volume = 1e-5
position = '1 0 0'
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
use_scalar_variables = false
[]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe1:in'
# (p0, T0) for p = 1e5, T = 300, vel = 1
p0 = 1.0049827846e+05
T0 = 300.0000099
[]
[outlet]
type = Outlet1Phase
input = 'pipe2:out'
p = 1e5
[]
[]
[Preconditioning]
[prec]
type = SMP
full = true
petsc_options = '-pc_factor_shift_nonzero'
petsc_options_iname = '-mat_fd_coloring_err'
petsc_options_value = '1.e-10'
[]
[]
[Executioner]
type = Transient
start_time = 0
dt = 1e-4
num_steps = 5
abort_on_solve_fail = true
solve_type = 'PJFNK'
nl_rel_tol = 0
nl_abs_tol = 1e-5
nl_max_its = 10
l_tol = 1e-3
l_max_its = 10
[Adaptivity]
initial_adaptivity = 0
refine_fraction = 0.60
coarsen_fraction = 0.10
max_h_level = 3
[]
automatic_scaling = true
[]
[Outputs]
exodus = true
[]
(modules/thermal_hydraulics/test/tests/controls/delay_control/test.i)
[GlobalParams]
initial_p = 100.e3
initial_vel = 0
initial_T = 300.
closures = simple_closures
[]
[Functions]
[p0_fn]
type = PiecewiseLinear
x = '0 0.2 0.4 0.6 0.8'
y = '1e5 1.002e5 1.002e5 1.001e5 1.001e5'
[]
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '1 0 0'
length = 1.0
n_elems = 5
A = 0.01
D_h = 0.1
f = 0
[]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe1:in'
p0 = 100.e3
T0 = 300.
[]
[outlet]
type = Outlet1Phase
input = 'pipe1:out'
p = 100.0e3
[]
[]
[ControlLogic]
[p0_fn_ctrl]
type = TimeFunctionComponentControl
component = inlet
parameter = p0
function = p0_fn
[]
[delay_ctrl]
type = DelayControl
input = p0_inlet
tau = 0.3
initial_value = 1e5
[]
[]
[Postprocessors]
[p0_inlet_delayed]
type = RealControlDataValuePostprocessor
control_data_name = delay_ctrl:value
execute_on = 'initial timestep_end'
[]
[p0_inlet]
type = FunctionValuePostprocessor
function = p0_fn
execute_on = 'initial timestep_begin'
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
dt = 0.1
start_time = 0.0
end_time = 1.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 = 20
l_tol = 1e-3
l_max_its = 5
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
automatic_scaling = true
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/components/junction_parallel_channels_1phase/conservation.i)
# Junction between 2 pipes where the second has half the area of the first.
# The momentum density of the second should be twice that of the first.
[GlobalParams]
gravity_vector = '0 0 0'
initial_T = 300
initial_p = 1e5
initial_vel = 20
initial_vel_x = 20
initial_vel_y = 0
initial_vel_z = 0
f = 0
fp = eos
scaling_factor_1phase = '1 1e-2 1e-5'
scaling_factor_rhoEV = 1e-5
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 1.4
cv = 725
p_inf = 0
q = 0
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Functions]
[K_loss_fn]
type = PiecewiseLinear
x = '0 0.2'
y = '0 1'
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
A = 1
n_elems = 20
[]
[junction1]
type = JunctionParallelChannels1Phase
connections = 'pipe1:out pipe2:in'
position = '1 0 0'
volume = 1e-2
K = 0
use_scalar_variables = false
[]
[pipe2]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '1 0 0'
length = 1
A = 0.5
n_elems = 20
[]
[junction2]
type = JunctionParallelChannels1Phase
connections = 'pipe2:out pipe1:in'
position = '1 0 0'
volume = 1e-2
use_scalar_variables = false
[]
[]
[ControlLogic]
active = ''
[K_crtl]
type = TimeFunctionComponentControl
component = junction1
parameter = K
function = K_loss_fn
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 0.05
num_steps = 5
abort_on_solve_fail = true
solve_type = 'NEWTON'
line_search = basic
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu'
nl_rel_tol = 0
nl_abs_tol = 1e-8
nl_max_its = 20
l_tol = 1e-3
l_max_its = 20
[]
[Postprocessors]
# mass conservation
[mass_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoA
block = 'pipe1 pipe2'
execute_on = 'initial timestep_end'
[]
[mass_junction1]
type = ElementAverageValue
variable = rhoV
block = 'junction1'
execute_on = 'initial timestep_end'
[]
[mass_junction2]
type = ElementAverageValue
variable = rhoV
block = 'junction2'
execute_on = 'initial timestep_end'
[]
[mass_tot]
type = SumPostprocessor
values = 'mass_pipes mass_junction1 mass_junction2'
execute_on = 'initial timestep_end'
[]
[mass_tot_change]
type = ChangeOverTimePostprocessor
change_with_respect_to_initial = true
postprocessor = mass_tot
compute_relative_change = true
execute_on = 'initial timestep_end'
[]
# energy conservation
[E_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoEA
block = 'pipe1 pipe2'
execute_on = 'initial timestep_end'
[]
[E_junction1]
type = ElementAverageValue
variable = rhoEV
block = 'junction1'
execute_on = 'initial timestep_end'
[]
[E_junction2]
type = ElementAverageValue
variable = rhoEV
block = 'junction2'
execute_on = 'initial timestep_end'
[]
[E_tot]
type = SumPostprocessor
values = 'E_pipes E_junction1 E_junction2'
execute_on = 'initial timestep_end'
[]
[E_tot_change]
type = ChangeOverTimePostprocessor
change_with_respect_to_initial = true
postprocessor = E_tot
compute_relative_change = true
execute_on = 'initial timestep_end'
[]
[p_pipe1_out]
type = SideAverageValue
boundary = pipe1:out
variable = p
[]
[p_pipe2_in]
type = SideAverageValue
boundary = pipe2:in
variable = p
[]
[dp_junction]
type = DifferencePostprocessor
value1 = p_pipe1_out
value2 = p_pipe2_in
[]
[]
[Outputs]
[out]
type = CSV
show = 'mass_tot_change E_tot_change'
[]
[]
(modules/thermal_hydraulics/test/tests/components/inlet_mass_flow_rate_1phase/phy.massflowrate_3eqn.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_T = 444.447
initial_p = 7e6
initial_vel = 0
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp
# geometry
position = '0 0 0'
orientation = '1 0 0'
A = 1.0000000000e-04
D_h = 1.1283791671e-02
f = 0.1
length = 1
n_elems = 20
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe:in'
m_dot = 0.18
T = 444.447
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 7e6
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
dt = 0.1
start_time = 0.0
num_steps = 30
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 0
nl_abs_tol = 1e-6
nl_max_its = 20
l_tol = 1e-3
l_max_its = 100
abort_on_solve_fail = true
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Outputs]
file_base = 'phy.massflowrate_3eqn'
[exodus]
type = Exodus
show = 'rhouA T p'
[]
[]
(modules/thermal_hydraulics/test/tests/components/heat_transfer_from_external_app_1phase/phy.T_wall_transfer_elem_3eqn.child.i)
# This is a part of phy.T_wall_transfer_elem_3eqn test. See the master file for details.
[GlobalParams]
initial_p = 1.e5
initial_vel = 0.
initial_T = 300.
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[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 = HeatTransferFromExternalAppTemperature1Phase
flow_channel = pipe1
Hw = 3000
P_hf = 6.2831853072e-01
initial_T_wall = 300.
var_type = elemental
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe1:in'
m_dot = 1
T = 300
[]
[outlet]
type = Outlet1Phase
input = 'pipe1:out'
p = 1e5
[]
[]
[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 = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-7
nl_abs_tol = 1e-4
nl_max_its = 20
l_tol = 1e-3
l_max_its = 300
start_time = 0.0
end_time = 5
[]
[Outputs]
[out]
type = Exodus
show = 'T_wall'
[]
[]
(modules/thermal_hydraulics/test/tests/components/heat_transfer_from_external_app_1phase/phy.T_wall_transfer_3eqn.child.i)
# This is a part of phy.T_wall_transfer_3eqn test. See the master file for details.
[GlobalParams]
initial_p = 1.e5
initial_vel = 0.
initial_T = 300.
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[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 = HeatTransferFromExternalAppTemperature1Phase
flow_channel = pipe1
Hw = 3000
P_hf = 6.2831853072e-01
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe1:in'
m_dot = 1
T = 300
[]
[outlet]
type = Outlet1Phase
input = 'pipe1:out'
p = 1e5
[]
[]
[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 = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-7
nl_abs_tol = 1e-4
nl_max_its = 20
l_tol = 1e-3
l_max_its = 300
start_time = 0.0
end_time = 5
[]
[Outputs]
[out]
type = Exodus
show = 'T_wall'
[]
[]
(modules/thermal_hydraulics/test/tests/base/component_groups/test.i)
[GlobalParams]
closures = simple_closures
initial_p = 1e6
initial_T = 300
initial_vel = 0
[]
[FluidProperties]
[fp_liquid]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[SolidProperties]
[hx:wall]
type = ThermalFunctionSolidProperties
k = 1
cp = 1
rho = 1
[]
[]
[Components]
[pri_inlet]
type = SolidWall1Phase
input = 'hx/primary:out'
[]
[pri_outlet]
type = SolidWall1Phase
input = 'hx/primary:in'
[]
# heat exchanger
[hx]
n_elems = 2
length = 1
[primary]
type = FlowChannel1Phase
position = '0 1 0'
orientation = '1 0 0'
n_elems = ${n_elems}
length = ${length}
A = 1
f = 1
fp = fp_liquid
[]
[wall]
type = HeatStructurePlate
position = '0 0 0'
orientation = '1 0 0'
solid_properties = 'hx:wall'
solid_properties_T_ref = '300'
n_elems = ${n_elems}
length = ${length}
n_part_elems = 1
names = 0
widths = 1
depth = 1
initial_T = 300
[]
[ht_primary]
type = HeatTransferFromHeatStructure1Phase
hs = hx/wall
flow_channel = hx/primary
hs_side = outer
Hw = 0
[]
[ht_secondary]
type = HeatTransferFromHeatStructure1Phase
hs = hx/wall
flow_channel = hx/secondary
hs_side = inner
Hw = 0
[]
[secondary]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
n_elems = ${n_elems}
length = ${length}
A = 1
f = 1
fp = fp_liquid
[]
[]
[sec_inlet]
type = SolidWall1Phase
input = 'hx/secondary:out'
[]
[sec_outlet]
type = SolidWall1Phase
input = 'hx/secondary:in'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
[console]
type = Console
system_info = ''
enable = false
[]
[]
[Debug]
print_component_loops = true
[]
(modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_1phase/phy.T_wall_transfer_3eqn_z.i)
# Testing that T_solid gets properly projected onto a pipe
# That's why Hw in pipe1 is set to 0, so we do not have any heat exchange
# Note that the pipe and the heat structure have an opposite orientation, which
# is crucial for this test.
[GlobalParams]
initial_p = 1.e5
initial_vel = 0.
initial_T = 300.
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[SolidProperties]
[wall-mat]
type = ThermalFunctionSolidProperties
k = 100.0
rho = 100.0
cp = 100.0
[]
[]
[Functions]
[T_init]
type = ParsedFunction
expression = '290 + sin((1 - z) * pi * 1.4)'
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
position = '0.2 0 0'
orientation = '0 0 1'
length = 1
n_elems = 50
A = 9.6858407346e-01
D_h = 6.1661977237e+00
f = 0.01
fp = eos
[]
[hs]
type = HeatStructureCylindrical
position = '0.1 0 1'
orientation = '0 0 -1'
length = 1
n_elems = 50
rotation = 90
solid_properties = 'wall-mat'
solid_properties_T_ref = '300'
n_part_elems = 2
widths = '0.1'
names = 'wall'
initial_T = T_init
[]
[hxconn]
type = HeatTransferFromHeatStructure1Phase
hs = hs
hs_side = outer
flow_channel = pipe1
Hw = 0
P_hf = 6.2831853072e-01
[]
[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 = 1
abort_on_solve_fail = true
solve_type = 'NEWTON'
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
num_steps = 1
[]
[Outputs]
[out]
type = Exodus
show = 'T_wall T_solid'
[]
print_linear_residuals = false
[]
(modules/thermal_hydraulics/test/tests/misc/mesh_only/test.i)
[GlobalParams]
initial_T = 300
initial_p = 1e5
initial_vel = 0
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
gravity_vector = '0 0 0'
scaling_factor_1phase = '1.e0 1.e-4 1.e-6'
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[SolidProperties]
[hs_mat]
type = ThermalFunctionSolidProperties
rho = 1
cp = 1
k = 1
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
fp = eos
position = '0 0 0'
orientation = '1 0 0'
A = 1.
D_h = 1.12837916709551
f = 0
length = 1
n_elems = 10
[]
[hs1]
type = HeatStructurePlate
fp = eos
position = '0 0 0'
orientation = '1 0 0'
n_elems = 10
length = 1
depth = 0.1
names = 'blk'
solid_properties = 'hs_mat'
solid_properties_T_ref = '300'
n_part_elems = 1
widths = '0.1'
[]
[pipe2]
type = FlowChannel1Phase
fp = eos
position = '0 0 0'
orientation = '0 1 0'
A = 1.
D_h = 1.12837916709551
f = 0
length = 1
n_elems = 10
[]
[hs2]
type = HeatStructurePlate
fp = eos
position = '0 0 0'
orientation = '0 1 0'
n_elems = 10
length = 1
depth = 0.1
names = 'blk'
solid_properties = 'hs_mat'
solid_properties_T_ref = '300'
n_part_elems = 1
widths = '0.1'
[]
[pipe3]
type = FlowChannel1Phase
fp = eos
position = '0 0 0'
orientation = '0 0 1'
A = 1.
D_h = 1.12837916709551
f = 0
length = 1
n_elems = 10
[]
[hs3]
type = HeatStructurePlate
fp = eos
position = '0 0 0'
orientation = '0 0 1'
n_elems = 10
length = 1
depth = 0.1
names = 'blk'
solid_properties = 'hs_mat'
solid_properties_T_ref = '300'
n_part_elems = 1
widths = '0.1'
[]
[junction]
type = VolumeJunction1Phase
connections = 'pipe1:in pipe2:in pipe3:in'
position = '0 0 0'
volume = 1e-5
use_scalar_variables = false
[]
[in1]
type = SolidWall
input = 'pipe1:out'
[]
[in2]
type = SolidWall
input = 'pipe2:out'
[]
[in3]
type = SolidWall
input = 'pipe3:out'
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 1e-5
num_steps = 1
abort_on_solve_fail = true
[]
(modules/thermal_hydraulics/test/tests/components/volume_junction_1phase/phy.form_loss.i)
# This test measures the pressure drop across the volume junction with K=1.
A = 0.1
[GlobalParams]
gravity_vector = '0 0 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
initial_T = 300
initial_p = 1e5
initial_vel = 1
n_elems = 20
length = 1
f = 0
fp = fp
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 1.4
cv = 725
q = 0
q_prime = 0
p_inf = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Functions]
[K_fn]
type = TimeRampFunction
initial_value = 0
initial_time = 2
ramp_duration = 5
final_value = 1
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
A = ${A}
[]
[pipe2]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '1 0 0'
A = ${A}
initial_p = 1e5
[]
[junction]
type = VolumeJunction1Phase
connections = 'pipe1:out pipe2:in'
position = '1 0 0'
volume = 0.005
initial_p = 1e5
initial_vel_x = 1
initial_vel_y = 0
initial_vel_z = 0
use_scalar_variables = false
[]
[pipe1_in]
type = InletVelocityTemperature1Phase
input = 'pipe1:in'
vel = 1
T = 300
[]
[pipe2_out]
type = Outlet1Phase
input = 'pipe2:out'
p = 1e5
[]
[]
[ControlLogic]
active = ''
[K_crtl]
type = TimeFunctionComponentControl
component = junction
parameter = K
function = K_fn
[]
[]
[Postprocessors]
[pJ_in]
type = SideAverageValue
variable = p
boundary = pipe1:out
[]
[pJ_out]
type = SideAverageValue
variable = p
boundary = pipe2:in
[]
[dpJ]
type = DifferencePostprocessor
value1 = pJ_in
value2 = pJ_out
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
end_time = 20
dt = 0.5
abort_on_solve_fail = true
solve_type = 'NEWTON'
nl_rel_tol = 0
nl_abs_tol = 1e-8
nl_max_its = 15
l_tol = 1e-3
l_max_its = 10
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
csv = true
execute_on = 'final'
show = 'dpJ'
[]
(modules/thermal_hydraulics/test/tests/components/elbow_pipe_1phase/phy.position.i)
[GlobalParams]
gravity_vector = '0 -9.81 0'
initial_T = 310
initial_p = 1e5
initial_vel = 0
scaling_factor_1phase = '1e0 1e-2 1e-4'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = ElbowPipe1Phase
# geometry
position = '0 0 0'
orientation = '1 0 0'
start_angle = 270
end_angle = 360
radius = 0.25
n_elems = 50
# d = 0.1 m
A = 7.8539816340e-03
D_h = 1.0000000000e-01
f = 0.1
fp = fp
[]
[inlet]
type = SolidWall1Phase
input = 'pipe:in'
[]
[outlet]
type = SolidWall1Phase
input = 'pipe:out'
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 1e-2
num_steps = 1
abort_on_solve_fail = true
solve_type = 'PJFNK'
nl_rel_tol = 1e-10
nl_abs_tol = 1e-8
nl_max_its = 30
l_tol = 1e-2
l_max_its = 30
[]
[Outputs]
exodus = true
show = 'A'
[]
(modules/thermal_hydraulics/test/tests/components/junction_parallel_channels_1phase/jac.test.i)
# Pump data used in this test comes from the LOFT Systems Tests, described in NUREG/CR-0247
[GlobalParams]
initial_p = 1e5
initial_T = 300
initial_vel = 1
closures = simple_closures
fp = fp
f = 0
scaling_factor_1phase = '1e-2 1e-2 1e-5'
scaling_factor_rhoEV = 1e-5
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[in]
type = InletStagnationPressureTemperature1Phase
input = fch1:in
p0 = 1.1e5
T0 = 300
[]
[fch1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 1
A = 1
[]
[junction]
type = JunctionParallelChannels1Phase
connections = 'fch1:out fch2:in'
position = '1 0 0'
volume = 0.3
initial_vel_x = 1
initial_vel_y = 0
initial_vel_z = 0
use_scalar_variables = false
[]
[fch2]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '1 0 0'
length = 1
n_elems = 1
A = 1.5
[]
[out]
type = Outlet1Phase
input = fch2:out
p = 1e5
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
num_steps = 1
abort_on_solve_fail = true
dt = 0.1
solve_type = 'newton'
line_search = 'basic'
petsc_options_iname = '-snes_test_err'
petsc_options_value = '1e-9'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-6
nl_max_its = 15
l_tol = 1e-4
l_max_its = 10
[]
(modules/thermal_hydraulics/test/tests/components/inlet_mass_flow_rate_1phase/clg.ctrl_T_3eqn_rdg.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = 1e5
initial_T = 300
initial_vel = 0.0
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 50
A = 1.0000000000e-04
D_h = 1.1283791671e-02
f = 0.0
fp = fp
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe:in'
m_dot = 0.1
T = 300
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 1e5
[]
[]
[Functions]
[inlet_T_fn]
type = PiecewiseLinear
x = '0 1'
y = '300 350'
[]
[]
[ControlLogic]
[set_inlet_value]
type = TimeFunctionComponentControl
component = inlet
parameter = T
function = inlet_T_fn
[]
[]
[Postprocessors]
[inlet_T]
type = RealComponentParameterValuePostprocessor
component = inlet
parameter = T
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0.0
dt = 0.25
num_steps = 5
abort_on_solve_fail = true
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-10
nl_abs_tol = 1e-6
nl_max_its = 30
l_tol = 1e-3
l_max_its = 100
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/auxkernels/sound_speed/1phase.i)
# Use SoundSpeedAux to compute sound speed.
[GlobalParams]
family = MONOMIAL
order = CONSTANT
[]
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
allow_renumbering = false
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[AuxVariables]
[sound_speed]
[]
[e]
initial_condition = 1e5
[]
[v]
initial_condition = 1e-3
[]
[]
[AuxKernels]
[sound_speed_aux]
type = SoundSpeedAux
variable = sound_speed
e = e
v = v
fp = fp
[]
[]
[Problem]
solve = false
[]
[Postprocessors]
[c]
type = ElementalVariableValue
variable = sound_speed
elementid = 0
[]
[]
[Executioner]
type = Transient
dt = 1
num_steps = 1
abort_on_solve_fail = true
[]
[Outputs]
csv = true
execute_on = TIMESTEP_END
[]
(modules/thermal_hydraulics/test/tests/jacobians/kernels/one_d_3eqn_momentum_area_gradient.i)
[JacobianTest1Phase]
A = area_fn
p = 1e6
T = 300
vel = 2
snes_test_err = 1e-8
generate_mesh = false
fp_1phase = fp_1phase
[]
[FluidProperties]
[fp_1phase]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Mesh]
file = ../meshes/skew_1elem.e
construct_side_list_from_node_list = true
[]
[Functions]
[area_fn]
type = PiecewiseLinear
axis = x
x = '-1 2'
y = ' 2 1'
[]
[]
[Kernels]
[test]
type = OneD3EqnMomentumAreaGradient
variable = rhouA
arhoA = rhoA
arhouA = rhouA
arhoEA = rhoEA
A = A
direction = direction
p = p
[]
[]
(modules/fluid_properties/test/tests/ics/specific_enthalpy_from_pressure_temperature/test.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
allow_renumbering = false
[]
[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
[]
[]
[AuxVariables]
[h]
[]
[p]
[]
[T]
[]
[]
[ICs]
[h_ic]
type = SpecificEnthalpyFromPressureTemperatureIC
variable = h
p = p
T = T
fp = fp_steam
[]
[p_ic]
type = ConstantIC
variable = p
value = 100e3
[]
[T_ic]
type = ConstantIC
variable = T
value = 500
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[h_test]
type = ElementalVariableValue
elementid = 0
variable = h
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Outputs]
csv = true
execute_on = 'INITIAL'
[]
[Problem]
solve = false
[]
(modules/thermal_hydraulics/test/tests/controls/set_real_value_control/test.i)
# This is testing that the values set by SetRealValueControl are used.
# The values of function T0_fn are set into an aux-field `aux`. Then,
# we compute the average value of this field in a postprocessor. It
# should be equal to the value of T0_fn.
[GlobalParams]
initial_p = 100.e3
initial_vel = 1.0
initial_T = 350.
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '1 0 0'
length = 15.0
n_elems = 10
A = 0.01
D_h = 0.1
f = 0.01
[]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe1:in'
p0 = 100.e3
T0 = 350.
[]
[outlet]
type = Outlet1Phase
input = 'pipe1:out'
p = 100.0e3
[]
[]
[AuxVariables]
[aux]
[]
[]
[AuxKernels]
[aux_kernel]
type = ConstantAux
variable = aux
value = 350
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Functions]
[T0_fn]
type = PiecewiseLinear
x = '0 1'
y = '350 345'
[]
[]
[ControlLogic]
[T_inlet_fn]
type = GetFunctionValueControl
function = T0_fn
[]
[set_inlet_value]
type = SetRealValueControl
parameter = AuxKernels/aux_kernel/value
value = T_inlet_fn:value
[]
[]
[Postprocessors]
[aux]
type = ElementAverageValue
variable = aux
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
dt = 0.1
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 1e-6
nl_abs_tol = 1e-6
nl_max_its = 20
l_tol = 1e-3
l_max_its = 5
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
start_time = 0.0
end_time = 1
automatic_scaling = true
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/components/heat_transfer_base/err.mixed_heat_modes.i)
# Tests that an error is thrown if the user specifies a mixture of heat source
# types (temperature and heat flux).
[GlobalParams]
initial_T = 300
initial_p = 100e3
initial_vel = 0
closures = simple_closures
[]
[FluidProperties]
[fp_water]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp_water
position = '0 0 0'
orientation = '1 0 0'
A = 1
f = 0
length = 1
n_elems = 1
[]
[ht1]
type = HeatTransferFromHeatFlux1Phase
flow_channel = pipe
q_wall = 1
P_hf = 1
Hw = 1
[]
[ht2]
type = HeatTransferFromSpecifiedTemperature1Phase
flow_channel = pipe
T_wall = 300
P_hf = 1
Hw = 1
[]
[left]
type = SolidWall
input = 'pipe:in'
[]
[right]
type = SolidWall
input = 'pipe:out'
[]
[]
[Preconditioning]
[preconditioner]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu mumps'
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 1
num_steps = 1
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 0
nl_abs_tol = 1e-6
nl_max_its = 5
l_tol = 1e-10
l_max_its = 10
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
(modules/thermal_hydraulics/test/tests/components/outlet_1phase/jacobian.i)
[GlobalParams]
initial_p = 1e5
initial_T = 300
initial_vel = 2
gravity_vector = '9.81 0 0'
scaling_factor_1phase = '1. 1. 1'
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[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.12837916709551
f = 0.1
length = 1
n_elems = 2
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 1e5
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 0
dt = 1e-2
num_steps = 1
abort_on_solve_fail = true
solve_type = 'NEWTON'
nl_rel_tol = 1e-9
nl_abs_tol = 1e-7
nl_max_its = 5
l_tol = 1e-3
l_max_its = 100
petsc_options_iname = '-snes_type -snes_test_err'
petsc_options_value = 'test 1e-11'
[]
(modules/thermal_hydraulics/test/tests/controls/set_component_bool_value_control/test.i)
# This is testing that the values set by SetComponentBoolValueControl are used.
# The `trip_ctrl` component produces a boolean value that is set in the
# `turbine` component to switch it on/off.
[GlobalParams]
initial_p = 100.e3
initial_vel = 1.0
initial_T = 350.
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
scaling_factor_1phase = '1 1e-2 1e-4'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'fch1:in'
p0 = 100.e3
T0 = 350.
[]
[fch1]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '1 0 0'
length = 1.0
n_elems = 10
A = 0.01
D_h = 0.1
f = 0.01
[]
[turbine]
type = SimpleTurbine1Phase
position = '1 0 0'
connections = 'fch1:out fch2:in'
volume = 1
on = false
power = 1
use_scalar_variables = false
[]
[fch2]
type = FlowChannel1Phase
fp = fp
position = '1 0 0'
orientation = '1 0 0'
length = 1.0
n_elems = 10
A = 0.01
D_h = 0.1
f = 0.01
[]
[outlet]
type = Outlet1Phase
input = 'fch2:out'
p = 100.0e3
[]
[]
[Functions]
[trip_fn]
type = PiecewiseLinear
xy_data = '
0 1
1 2'
[]
[]
[ControlLogic]
[trip_ctrl]
type = UnitTripControl
condition = 'val > 1.5'
symbol_names = 'val'
symbol_values = 'trip_fn'
[]
[set_comp_value]
type = SetComponentBoolValueControl
component = turbine
parameter = on
value = trip_ctrl:state
[]
[]
[Postprocessors]
[on_ctrl]
type = BoolComponentParameterValuePostprocessor
component = turbine
parameter = on
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
dt = 0.1
abort_on_solve_fail = true
solve_type = NEWTON
line_search = 'basic'
nl_rel_tol = 1e-6
nl_abs_tol = 1e-5
nl_max_its = 20
l_tol = 1e-3
l_max_its = 5
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
start_time = 0.0
end_time = 1
[]
[Outputs]
[out]
type = CSV
show = 'on_ctrl'
[]
[]
(modules/fluid_properties/test/tests/stiffened_gas/test.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
elem_type = QUAD4
[]
[Functions]
[./f_fn]
type = ParsedFunction
expression = -4
[../]
[./bc_fn]
type = ParsedFunction
expression = 'x*x+y*y'
[../]
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./e]
initial_condition = 113206.45935406466
[../]
[./v]
initial_condition = 0.0007354064593540647
[../]
[./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
[../]
[]
[FluidProperties]
[./sg]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
mu = 0.9
k = 0.6
[../]
[]
[Materials]
[./fp_mat]
type = FluidPropertiesMaterialVE
e = e
v = v
fp = sg
[../]
[]
[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/jacobians/kernels/one_d_3eqn_momentum_flux.i)
[JacobianTest1Phase]
A = 1
p = 1e6
T = 300
vel = 2
snes_test_err = 1e-9
generate_mesh = false
fp_1phase = fp_1phase
[]
[Mesh]
file = ../meshes/skew_1elem.e
construct_side_list_from_node_list = true
[]
[FluidProperties]
[fp_1phase]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Kernels]
[mom_flux]
type = OneD3EqnMomentumFlux
variable = rhouA
A = A
arhoA = rhoA
arhouA = rhouA
arhoEA = rhoEA
direction = direction
rho = rho
vel = vel
p = p
[]
[]
(modules/thermal_hydraulics/test/tests/controls/get_function_value_control/test.i)
# This is testing that the values obtained by GetFunctionValueControl are used.
# Function T0_fn prescribes values for T_inlet_fn control. We output the function
# values via a postprocessor `T_fn` and the control data values via another
# postprocessor `T_ctrl`. Those two values have to be equal.
[GlobalParams]
initial_p = 100.e3
initial_vel = 1.0
initial_T = 350.
scaling_factor_1phase = '1 1e-2 1e-4'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '1 0 0'
length = 15.0
n_elems = 10
A = 0.01
D_h = 0.1
f = 0.01
[]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe1:in'
p0 = 100.e3
T0 = 350.
[]
[outlet]
type = Outlet1Phase
input = 'pipe1:out'
p = 100.0e3
[]
[]
[Functions]
[T0_fn]
type = PiecewiseLinear
x = '0 1'
y = '350 345'
[]
[]
[ControlLogic]
[T_inlet_fn]
type = GetFunctionValueControl
function = T0_fn
[]
[]
[Postprocessors]
[T_fn]
type = FunctionValuePostprocessor
function = T0_fn
[]
[T_ctrl]
type = RealControlDataValuePostprocessor
control_data_name = T_inlet_fn:value
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
dt = 0.1
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 1e-6
nl_abs_tol = 1e-6
nl_max_its = 20
l_tol = 1e-3
l_max_its = 5
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
start_time = 0.0
end_time = 1
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/controls/dependency/test.i)
# This is testing that controls are executed in the correct order
#
# If controls are executed in the right order, then T_inlet_ctrl
# reads the value of temperature (T = 345 K) from a function. Then
# this value is set into the BC and then is it sampled by a
# postprocessor whose value is then written into a CSV file.
#
# If controls were executed in the wrong order, we would sample the
# stagnation temperature function at time t = 0, which would give
# T = 360 K back, and we would see this value in the CSV file instead.
[GlobalParams]
initial_p = 100.e3
initial_vel = 1.0
initial_T = 350.
scaling_factor_1phase = '1 1e-2 1e-4'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '1 0 0'
length = 15.0
n_elems = 10
A = 0.01
D_h = 0.1
f = 0.01
[]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe1:in'
p0 = 100.e3
T0 = 355.
[]
[outlet]
type = Outlet1Phase
input = 'pipe1:out'
p = 100.0e3
[]
[]
[Functions]
# Stagnation temperature in time
[T0_fn]
type = PiecewiseLinear
x = '0 1e-5'
y = '360 345'
[]
[]
[ControlLogic]
[set_inlet_value_ctrl]
type = SetComponentRealValueControl
component = inlet
parameter = T0
value = T_inlet_ctrl:value
[]
[T_inlet_ctrl]
type = GetFunctionValueControl
function = T0_fn
[]
[]
[Postprocessors]
[T_ctrl]
type = RealComponentParameterValuePostprocessor
component = inlet
parameter = T0
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 0
dt = 1e-5
num_steps = 1
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 1e-6
nl_abs_tol = 1e-6
nl_max_its = 20
l_tol = 1e-3
l_max_its = 5
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/closures/none_1phase/phy.test.i)
# Using no closure option and setting up custom materials that computes f_D and Hw.
# In this case, these custom materials are computing just constant values
[GlobalParams]
gravity_vector = '0 0 0'
scaling_factor_1phase = '1 1 1e-8'
initial_vel = 0
initial_p = 1e5
initial_T = 300
closures = no_closures
[]
[FluidProperties]
[water]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[no_closures]
type = Closures1PhaseNone
[]
[]
[Materials]
[f_wall_mat]
type = ADGenericConstantMaterial
block = 'pipe'
prop_names = 'f_D'
prop_values = '0.123'
[]
[htc_wall_mat]
type = ADGenericConstantMaterial
block = 'pipe'
prop_names = 'Hw'
prop_values = '4.321'
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = water
position = '0 0 0'
orientation = '1 0 0'
A = 1e-4
length = 1
n_elems = 10
[]
[inlet]
type = SolidWall1Phase
input = 'pipe:in'
[]
[outlet]
type = SolidWall1Phase
input = 'pipe:out'
[]
[ht]
type = HeatTransferFromSpecifiedTemperature1Phase
flow_channel = pipe
T_wall = 300
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
num_steps = 2
dt = 1e-6
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = basic
nl_rel_tol = 1e-9
nl_abs_tol = 1e-8
nl_max_its = 5
l_tol = 1e-3
l_max_its = 10
[]
[Outputs]
[out]
type = Exodus
output_material_properties = true
show_material_properties = 'f_D Hw'
show = 'f_D Hw'
[]
[]
(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
[]
[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/heat_transfer_from_heat_structure_1phase/phy.conservation_1phase.i)
# Tests conservation for heat transfer between a cylindrical heat structure and
# a 1-phase flow channel
[GlobalParams]
gravity_vector = '0 0 0'
scaling_factor_1phase = '1e-3 1e-3 1e-8'
scaling_factor_temperature = 1e-3
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[SolidProperties]
[main-material]
type = ThermalFunctionSolidProperties
k = 1e4
cp = 500.0
rho = 100.0
[]
[]
[Functions]
[T0_fn]
type = ParsedFunction
expression = '290 + 20 * (y - 1)'
[]
[]
[Components]
[left_wall]
type = SolidWall1Phase
input = 'pipe:in'
[]
[pipe]
type = FlowChannel1Phase
fp = fp
position = '0 2 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'
[]
[heat_transfer]
type = HeatTransferFromHeatStructure1Phase
flow_channel = pipe
hs = heat_structure
hs_side = inner
Hw = 1e3
[]
[heat_structure]
#type = set externally
num_rods = 5
position = '0 2 0'
orientation = '1 0 0'
length = 1.0
n_elems = 5
names = 'main'
solid_properties = 'main-material'
solid_properties_T_ref = '300'
widths = '1.0'
n_part_elems = '5'
initial_T = T0_fn
[]
[]
[Postprocessors]
[E_pipe]
type = ElementIntegralVariablePostprocessor
variable = rhoEA
block = pipe
execute_on = 'initial timestep_end'
[]
[E_heat_structure]
block = 'heat_structure:main'
n_units = 5
execute_on = 'initial timestep_end'
[]
[E_tot]
type = SumPostprocessor
values = 'E_pipe E_heat_structure'
execute_on = 'initial timestep_end'
[]
[E_tot_change]
type = ChangeOverTimePostprocessor
change_with_respect_to_initial = true
postprocessor = E_tot
compute_relative_change = true
execute_on = 'initial timestep_end'
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
solve_type = 'PJFNK'
line_search = 'basic'
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 = 5
abort_on_solve_fail = true
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Outputs]
file_base = 'phy.conservation_1phase_cylinder'
csv = true
show = 'E_tot_change'
execute_on = 'final'
[]
(modules/fluid_properties/test/tests/auxkernels/stagnation_pressure_aux.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 2
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./specific_internal_energy]
[../]
[./specific_volume]
[../]
[./velocity]
[../]
[./stagnation_pressure]
[../]
[]
[Kernels]
[./diff_u]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./specific_internal_energy_ak]
type = ConstantAux
variable = specific_internal_energy
value = 1026.2e3
[../]
[./specific_volume_ak]
type = ConstantAux
variable = specific_volume
value = 0.0012192
[../]
[./velocity_ak]
type = ConstantAux
variable = velocity
value = 10.0
[../]
[./stagnation_pressure_ak]
type = StagnationPressureAux
variable = stagnation_pressure
e = specific_internal_energy
v = specific_volume
vel = velocity
fp = eos
[../]
[]
[FluidProperties]
[./eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0.0
p_inf = 1e9
cv = 1816.0
[../]
[]
[BCs]
[./left_u]
type = DirichletBC
variable = u
boundary = 0
value = 1
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = 1
value = 2
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
exodus = true
[]
(modules/thermal_hydraulics/test/tests/misc/initial_from_file/heat_transfer_from_heat_structure/steady_state.i)
[GlobalParams]
scaling_factor_1phase = '1. 1.e-2 1.e-4'
scaling_factor_temperature = 1e-2
initial_T = 500
initial_p = 6.e6
initial_vel = 0
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[SolidProperties]
[mat1]
type = ThermalFunctionSolidProperties
k = 16
cp = 356.
rho = 6.551400E+03
[]
[]
[Functions]
[Ts_init]
type = ParsedFunction
expression = '2*sin(x*pi)+507'
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp
# geometry
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 3
A = 1.907720E-04
D_h = 1.698566E-02
f = 0.1
[]
[hs]
type = HeatStructureCylindrical
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 3
names = 'wall'
n_part_elems = 1
solid_properties = 'mat1'
solid_properties_T_ref = '300'
inner_radius = 0.01
widths = 0.1
initial_T = Ts_init
[]
[ht]
type = HeatTransferFromHeatStructure1Phase
flow_channel = pipe
hs = hs
hs_side = INNER
Hw = 10000
[]
[temp_outside]
type = HSBoundarySpecifiedTemperature
hs = hs
boundary = hs:outer
T = Ts_init
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe:in'
m_dot = 0.1
T = 500
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 6e6
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 1
num_steps = 100
abort_on_solve_fail = true
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-7
nl_abs_tol = 1e-8
nl_max_its = 10
l_tol = 1e-3
l_max_its = 100
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu'
[]
[Outputs]
exodus = true
execute_on = 'initial final'
velocity_as_vector = false
[]
(modules/thermal_hydraulics/test/tests/closures/simple_1phase/err.missing_f_1phase.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_vel = 0
initial_p = 1e5
initial_T = 300
closures = simple_closures
[]
[FluidProperties]
[water]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = water
position = '0 0 0'
orientation = '1 0 0'
A = 1.
length = 1
n_elems = 10
[]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe:in'
p0 = 10
T0 = 10
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 10
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
dt = 1e-4
dtmin = 1.e-7
solve_type = 'PJFNK'
nl_rel_tol = 1e-9
nl_abs_tol = 1e-8
nl_max_its = 10
l_tol = 1e-8
l_max_its = 100
start_time = 0.0
num_steps = 10
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
(modules/thermal_hydraulics/test/tests/components/form_loss_from_function_1phase/phy.form_loss_1phase.i)
# Tests the form loss kernel for 1-phase flow.
#
# This test uses the following parameters and boundary data:
# Inlet: (rho = 996.5563397 kg/m^3, vel = 0.5 m/s)
# Outlet: p_out = 100 kPa
# Length: L = 2 m
# Form loss coefficient: K = 0.5, => K_prime = 0.25 m^-1 (uniform along length)
#
# The inlet pressure is
#
# p_in = p_out + dp ,
#
# where dp is given by the definition of the form loss coefficient:
#
# dp = K * 0.5 * rho * u^2
# = 0.5 * 0.5 * 996.5563397 * 0.5^2
# = 62.28477123125 Pa
#
# This value is output to CSV.
p_out = 100e3
[GlobalParams]
initial_p = ${p_out}
initial_vel = 0.5
initial_T = 300.0
gravity_vector = '0 0 0'
scaling_factor_1phase = '1 1 1e-4'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '1 0 0'
length = 2
A = 1
n_elems = 5
f = 0
[]
[form_loss]
type = FormLossFromFunction1Phase
flow_channel = pipe
K_prime = 0.25
[]
[inlet]
type = InletDensityVelocity1Phase
input = 'pipe:in'
rho = 996.5563397
vel = 0.5
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = ${p_out}
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
dt = 0.1
abort_on_solve_fail = true
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-8
nl_abs_tol = 5e-8
nl_max_its = 10
l_tol = 1e-3
l_max_its = 20
start_time = 0.0
num_steps = 100
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Postprocessors]
# this is not the right value, should be the value from the inlet ghost cell
[p_in]
type = SideAverageValue
boundary = inlet
variable = p
execute_on = TIMESTEP_END
[]
[p_out]
type = FunctionValuePostprocessor
function = ${p_out}
execute_on = TIMESTEP_END
[]
[dp]
type = DifferencePostprocessor
value1 = p_in
value2 = p_out
execute_on = TIMESTEP_END
[]
[]
[Outputs]
[out]
type = CSV
show = 'dp'
execute_postprocessors_on = final
[]
[]
(modules/thermal_hydraulics/test/tests/actions/coupled_heat_transfer_action/sub.i)
# This is a part of T_wall_action test. See the master file for details.
[GlobalParams]
initial_p = 1.e5
initial_vel = 0.
initial_T = 300.
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[AuxVariables]
[Hw]
family = monomial
order = constant
block = pipe1
[]
[]
[AuxKernels]
[Hw_ak]
type = ADMaterialRealAux
variable = Hw
property = 'Hw'
[]
[]
[UserObjects]
[T_uo]
type = LayeredAverage
direction = y
variable = T
num_layers = 10
block = pipe1
[]
[Hw_uo]
type = LayeredAverage
direction = y
variable = Hw
num_layers = 10
block = pipe1
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 1 0'
length = 1
n_elems = 10
A = 1.28584e-01
D_h = 8.18592e-01
f = 0.01
fp = eos
[]
[hxconn]
type = HeatTransferFromExternalAppTemperature1Phase
flow_channel = pipe1
Hw = 10000
P_hf = 6.28319e-01
initial_T_wall = 300.
var_type = elemental
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe1:in'
m_dot = 10
T = 400
[]
[outlet]
type = Outlet1Phase
input = 'pipe1:out'
p = 1e5
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Postprocessors]
[T_wall_avg]
type = ElementAverageValue
variable = T_wall
execute_on = 'INITIAL TIMESTEP_END'
[]
[htc_avg]
type = ElementAverageValue
variable = Hw
execute_on = 'INITIAL TIMESTEP_END'
[]
[T_avg]
type = ElementAverageValue
variable = T
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
dt = 0.1
dtmin = 1e-7
abort_on_solve_fail = true
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-7
nl_abs_tol = 1e-4
nl_max_its = 20
l_tol = 1e-3
l_max_its = 300
start_time = 0.0
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu'
[]
[Outputs]
[out]
type = Exodus
show = 'T_wall T Hw'
[]
[]
(modules/thermal_hydraulics/test/tests/misc/initial_from_file/volume_junction/base.i)
[GlobalParams]
scaling_factor_1phase = '1. 1.e-2 1.e-4'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
fp = fp
# geometry
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 3
A = 1.907720E-04
D_h = 1.698566E-02
f = 0.1
[]
[junction]
type = VolumeJunction1Phase
connections = 'pipe1:out pipe2:in'
volume = 1
position = '1 0 0'
scaling_factor_rhoV = 1
scaling_factor_rhouV = 1
scaling_factor_rhovV = 1
scaling_factor_rhowV = 1
scaling_factor_rhoEV = 1e-4
use_scalar_variables = false
[]
[pipe2]
type = FlowChannel1Phase
fp = fp
# geometry
position = '1 0 0'
orientation = '1 0 0'
length = 1
n_elems = 3
A = 1.907720E-04
D_h = 1.698566E-02
f = 0.1
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe1:in'
m_dot = 0.1
T = 500
[]
[outlet]
type = Outlet1Phase
input = 'pipe2:out'
p = 6e6
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 1
abort_on_solve_fail = true
solve_type = 'NEWTON'
nl_rel_tol = 0
nl_abs_tol = 1e-10
nl_max_its = 10
l_tol = 1e-3
l_max_its = 100
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
exodus = true
velocity_as_vector = false
[]
(modules/thermal_hydraulics/test/tests/components/heat_transfer_from_specified_temperature_1phase/phy.energy_walltemperature_ss_1phase.i)
# This test tests conservation of energy at steady state for 1-phase flow when
# wall temperature is specified. Conservation is checked by comparing the
# integral of the heat flux against the difference of the boundary fluxes.
[GlobalParams]
initial_p = 7.0e6
initial_vel = 0
initial_T = 513
gravity_vector = '0.0 0.0 0.0'
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 1'
length = 3.66
n_elems = 10
A = 1.907720E-04
D_h = 1.698566E-02
f = 0.0
fp = eos
[]
[ht_pipe]
type = HeatTransferFromSpecifiedTemperature1Phase
flow_channel = pipe
T_wall = 550
Hw = 1.0e3
P_hf = 4.4925e-2
[]
[inlet]
type = SolidWall1Phase
input = 'pipe:in'
[]
[outlet]
type = SolidWall1Phase
input = 'pipe:out'
[]
[]
[Postprocessors]
[hf_pipe]
type = ADHeatRateConvection1Phase
block = pipe
T_wall = T_wall
T = T
Hw = Hw
P_hf = P_hf
execute_on = 'initial timestep_end'
[]
[heat_added]
type = TimeIntegratedPostprocessor
value = hf_pipe
execute_on = 'initial timestep_end'
[]
[E]
type = ElementIntegralVariablePostprocessor
variable = rhoEA
execute_on = 'initial timestep_end'
[]
[E_change]
type = ChangeOverTimePostprocessor
postprocessor = E
change_with_respect_to_initial = true
execute_on = 'initial timestep_end'
[]
[E_conservation]
type = DifferencePostprocessor
value1 = heat_added
value2 = E_change
execute_on = 'initial timestep_end'
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = crank-nicolson
abort_on_solve_fail = true
dt = 1e-1
solve_type = 'NEWTON'
line_search = 'basic'
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu'
nl_rel_tol = 1e-9
nl_abs_tol = 1e-8
nl_max_its = 50
l_tol = 1e-3
l_max_its = 60
start_time = 0
num_steps = 10
[]
[Outputs]
[out]
type = CSV
show = 'E_conservation'
[]
[console]
type = Console
show = 'E_conservation'
[]
[]
(modules/thermal_hydraulics/test/tests/misc/initial_from_file/heat_transfer_from_heat_structure_3d/steady_state.i)
[GlobalParams]
scaling_factor_1phase = '1. 1.e-2 1.e-4'
scaling_factor_temperature = 1e-2
initial_T = 500
initial_p = 6.e6
initial_vel = 0
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Materials]
[mat]
type = ADGenericConstantMaterial
prop_names = 'density specific_heat thermal_conductivity'
prop_values = '16 356 6.5514e3'
[]
[]
[Functions]
[Ts_init]
type = ParsedFunction
expression = '2*sin(x*pi/2)+2*sin(pi*y) +507'
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp
# geometry
position = '-1 0 -2.5'
orientation = '1 0 0'
length = 2
n_elems = 2
A = 0.3
D_h = 0.1935483871
f = 0.1
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe:in'
m_dot = 0.1
T = 500
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 6e6
[]
[ht]
type = HeatTransferFromHeatStructure3D1Phase
flow_channels = 'pipe'
hs = blk
boundary = blk:right
P_hf = 3
Hw = 1000
[]
[blk]
type = HeatStructureFromFile3D
file = box.e
position = '0 0 0'
initial_T = Ts_init
[]
[right_bnd]
type = HSBoundarySpecifiedTemperature
hs = blk
boundary = blk:bottom
T = Ts_init
[]
[]
[Executioner]
type = Transient
dt = 1
num_steps = 100
abort_on_solve_fail = true
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-7
nl_abs_tol = 1e-8
nl_max_its = 10
l_tol = 1e-3
l_max_its = 100
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu'
[]
[Outputs]
exodus = true
execute_on = 'initial final'
[]
(modules/thermal_hydraulics/test/tests/misc/initial_from_file/flow_channel/steady_state.i)
[GlobalParams]
scaling_factor_1phase = '1. 1.e-2 1.e-4'
initial_T = 500
initial_p = 6.e6
initial_vel = 0
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp
# geometry
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 3
A = 1.907720E-04
D_h = 1.698566E-02
f = 0.1
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe:in'
m_dot = 0.1
T = 500
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 6e6
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 1
num_steps = 100
abort_on_solve_fail = true
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-7
nl_abs_tol = 1e-8
nl_max_its = 10
l_tol = 1e-3
l_max_its = 100
[]
[Outputs]
exodus = true
execute_on = 'initial final'
velocity_as_vector = false
[]
(modules/thermal_hydraulics/tutorials/single_phase_flow/06_custom_closures.i)
T_in = 300. # K
m_dot_in = 1e-2 # kg/s
press = 10e5 # Pa
# core parameters
core_length = 1. # m
core_n_elems = 25
core_dia = '${units 2. cm -> m}'
core_pitch = '${units 8.7 cm -> m}'
A_core = '${fparse core_pitch^2 - 0.25 *pi * core_dia^2}'
P_wet_core = '${fparse 4*core_pitch + pi * core_dia}'
Dh_core = '${fparse 4 * A_core / P_wet_core}'
# pipe parameters
pipe_dia = '${units 10. cm -> m}'
A_pipe = '${fparse 0.25 * pi * pipe_dia^2}'
tot_power = 2000 # W
# heat exchanger parameters
hx_dia_inner = '${units 12. 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.5 # m
hx_n_elems = 25
m_dot_sec_in = 1. # kg/s
[GlobalParams]
initial_p = ${press}
initial_vel = 0.0001
initial_T = ${T_in}
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
gravity_vector = '0 0 0'
rdg_slope_reconstruction = minmod
scaling_factor_1phase = '1 1e-2 1e-4'
scaling_factor_rhoV = 1
scaling_factor_rhouV = 1e-2
scaling_factor_rhovV = 1e-2
scaling_factor_rhowV = 1e-2
scaling_factor_rhoEV = 1e-4
closures = thm_closures
fp = he
[]
[Functions]
[m_dot_sec_fn]
type = PiecewiseLinear
xy_data = '
0 0
10 ${m_dot_sec_in}'
[]
[]
[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]
[thm_closures]
type = Closures1PhaseTHM
[]
[none_closures]
type = Closures1PhaseNone
[]
[]
[Materials]
[Re_mat]
type = ADReynoldsNumberMaterial
Re = Re
rho = rho
vel = vel
D_h = D_h
mu = mu
block = hx/pri
[]
[f_mat]
type = ADParsedMaterial
property_name = f_D
constant_names = 'a b c'
constant_expressions = '1 0.1 -0.5'
material_property_names = 'Re'
expression = 'a + b * Re^c'
block = hx/pri
[]
[Pr_mat]
type = ADPrandtlNumberMaterial
Pr = Pr
cp = cp
mu = mu
k = k
block = hx/pri
[]
[Nu_mat]
type = ADParsedMaterial
property_name = 'Nu'
constant_names = 'a b c'
constant_expressions = '0.03 0.9 0.5'
material_property_names = 'Re Pr'
expression = 'a * Re ^b * Pr^c'
block = hx/pri
[]
[Hw_mat]
type = ADConvectiveHeatTransferCoefficientMaterial
D_h = D_h
k = k
Nu = Nu
Hw = Hw
block = hx/pri
[]
[]
[SolidProperties]
[steel]
type = ThermalFunctionSolidProperties
rho = 8050
k = 45
cp = 466
[]
[]
[Components]
[total_power]
type = TotalPower
power = ${tot_power}
[]
[up_pipe_1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 1'
length = 0.5
n_elems = 15
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct1]
type = JunctionParallelChannels1Phase
position = '0 0 0.5'
connections = 'up_pipe_1:out core_chan:in'
volume = 1e-5
use_scalar_variables = false
[]
[core_chan]
type = FlowChannel1Phase
position = '0 0 0.5'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
roughness = .0001
A = ${A_core}
D_h = ${Dh_core}
[]
[core_hs]
type = HeatStructureCylindrical
position = '0 0 0.5'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
names = 'block'
widths = '${fparse core_dia / 2.}'
solid_properties = 'steel'
solid_properties_T_ref = '300'
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}'
[]
[jct2]
type = JunctionParallelChannels1Phase
position = '0 0 1.5'
connections = 'core_chan:out up_pipe_2:in'
volume = 1e-5
use_scalar_variables = false
[]
[up_pipe_2]
type = FlowChannel1Phase
position = '0 0 1.5'
orientation = '0 0 1'
length = 0.5
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct3]
type = JunctionOneToOne1Phase
connections = 'up_pipe_2:out top_pipe_1:in'
[]
[top_pipe_1]
type = FlowChannel1Phase
position = '0 0 2'
orientation = '1 0 0'
length = 0.5
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[top_pipe_2]
type = FlowChannel1Phase
position = '0.5 0 2'
orientation = '1 0 0'
length = 0.5
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct4]
type = VolumeJunction1Phase
position = '0.5 0 2'
volume = 1e-5
connections = 'top_pipe_1:out top_pipe_2:in press_pipe:in'
use_scalar_variables = false
[]
[press_pipe]
type = FlowChannel1Phase
position = '0.5 0 2'
orientation = '0 1 0'
length = 0.2
n_elems = 5
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[pressurizer]
type = InletStagnationPressureTemperature1Phase
p0 = ${press}
T0 = ${T_in}
input = press_pipe:out
[]
[jct5]
type = JunctionOneToOne1Phase
connections = 'top_pipe_2:out down_pipe_1:in'
[]
[down_pipe_1]
type = FlowChannel1Phase
position = '1 0 2'
orientation = '0 0 -1'
length = 0.25
A = ${A_pipe}
n_elems = 5
[]
[jct6]
type = JunctionParallelChannels1Phase
position = '1 0 1.75'
connections = 'down_pipe_1:out hx/pri:in'
volume = 1e-5
use_scalar_variables = false
[]
[hx]
[pri]
type = FlowChannel1Phase
position = '1 0 1.75'
orientation = '0 0 -1'
length = ${hx_length}
n_elems = ${hx_n_elems}
roughness = 1e-5
A = '${fparse pi * hx_dia_inner * hx_dia_inner / 4.}'
D_h = ${hx_dia_inner}
closures = none_closures
[]
[ht_pri]
type = HeatTransferFromHeatStructure1Phase
hs = hx/wall
hs_side = inner
flow_channel = hx/pri
P_hf = '${fparse pi * hx_dia_inner}'
[]
[wall]
type = HeatStructureCylindrical
position = '1 0 1.75'
orientation = '0 0 -1'
length = ${hx_length}
n_elems = ${hx_n_elems}
widths = '${hx_wall_thickness}'
n_part_elems = '3'
solid_properties = 'steel'
solid_properties_T_ref = '300'
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 0.25'
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
initial_T = 300
[]
[]
[jct7]
type = JunctionParallelChannels1Phase
position = '1 0 0.5'
connections = 'hx/pri:out down_pipe_2:in'
volume = 1e-5
use_scalar_variables = false
[]
[down_pipe_2]
type = FlowChannel1Phase
position = '1 0 0.25'
orientation = '0 0 -1'
length = 0.25
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct8]
type = JunctionOneToOne1Phase
connections = 'down_pipe_2:out bottom_1:in'
[]
[bottom_1]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '-1 0 0'
length = 0.5
n_elems = 5
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[pump]
type = Pump1Phase
position = '0.5 0 0'
connections = 'bottom_1:out bottom_2:in'
volume = 1e-4
A_ref = ${A_pipe}
head = 0
use_scalar_variables = false
[]
[bottom_2]
type = FlowChannel1Phase
position = '0.5 0 0'
orientation = '-1 0 0'
length = 0.5
n_elems = 5
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct9]
type = JunctionOneToOne1Phase
connections = 'bottom_2:out up_pipe_1:in'
[]
[inlet_sec]
type = InletMassFlowRateTemperature1Phase
input = 'hx/sec:in'
m_dot = 0
T = 300
[]
[outlet_sec]
type = Outlet1Phase
input = 'hx/sec:out'
p = 1e5
[]
[]
[ControlLogic]
[set_point]
type = GetFunctionValueControl
function = ${m_dot_in}
[]
[pid]
type = PIDControl
initial_value = 0.0
set_point = set_point:value
input = m_dot_pump
K_p = 1.
K_i = 4.
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]
[power_to_coolant]
type = ADHeatRateConvection1Phase
block = core_chan
P_hf = '${fparse pi *core_dia}'
[]
[m_dot_pump]
type = ADFlowJunctionFlux1Phase
boundary = core_chan:in
connection_index = 1
equation = mass
junction = jct7
[]
[core_T_out]
type = SideAverageValue
boundary = core_chan:out
variable = T
[]
[core_p_in]
type = SideAverageValue
boundary = core_chan:in
variable = p
[]
[core_p_out]
type = SideAverageValue
boundary = core_chan:out
variable = p
[]
[core_delta_p]
type = ParsedPostprocessor
pp_names = 'core_p_in core_p_out'
expression = 'core_p_in - core_p_out'
[]
[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
[]
[m_dot_sec]
type = ADFlowBoundaryFlux1Phase
boundary = inlet_sec
equation = mass
[]
[Hw_hx_pri]
type = ADElementAverageMaterialProperty
mat_prop = Hw
block = hx/pri
[]
[fD_hx_pri]
type = ADElementAverageMaterialProperty
mat_prop = f_D
block = hx/pri
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 0
[TimeStepper]
type = IterationAdaptiveDT
dt = 1
[]
dtmax = 5
end_time = 500
line_search = basic
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 25
[]
[Outputs]
exodus = true
[console]
type = Console
max_rows = 1
outlier_variable_norms = false
[]
print_linear_residuals = false
[]
(modules/thermal_hydraulics/test/tests/components/free_boundary_1phase/phy.conservation_free_boundary_1phase.i)
# This test tests conservation of mass, momentum, and energy on a transient
# problem with an inlet and outlet (using free boundaries for each). This test
# takes 1 time step with Crank-Nicolson and some boundary flux integral
# post-processors needed for the full conservation statement. Lastly, the
# conservation quantities are shown on the console, which should ideally be zero
# for full conservation.
[GlobalParams]
gravity_vector = '0 0 0'
scaling_factor_1phase = '1 1 1e-6'
closures = simple_closures
[]
[Functions]
[T_fn]
type = ParsedFunction
expression = '300 + 10 * (cos(2*pi*x + pi))'
[]
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[inlet]
type = FreeBoundary1Phase
input = pipe:in
[]
[pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1.0
n_elems = 10
A = 1.0
initial_T = T_fn
initial_p = 1e5
initial_vel = 1
f = 0
fp = fp
[]
[outlet]
type = FreeBoundary1Phase
input = pipe:out
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = crank-nicolson
start_time = 0.0
end_time = 0.01
dt = 0.01
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 1e-6
nl_abs_tol = 1e-4
nl_max_its = 10
l_tol = 1e-2
l_max_its = 20
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Postprocessors]
# MASS
[massflux_left]
type = MassFluxIntegral
boundary = inlet
arhouA = rhouA
[]
[massflux_right]
type = MassFluxIntegral
boundary = outlet
arhouA = rhouA
[]
[massflux_difference]
type = DifferencePostprocessor
value1 = massflux_right
value2 = massflux_left
[]
[massflux_integral]
type = TimeIntegratedPostprocessor
value = massflux_difference
[]
[mass]
type = ElementIntegralVariablePostprocessor
variable = rhoA
execute_on = 'initial timestep_end'
[]
[mass_change]
type = ChangeOverTimePostprocessor
postprocessor = mass
change_with_respect_to_initial = true
execute_on = 'initial timestep_end'
[]
[mass_conservation]
type = SumPostprocessor
values = 'mass_change massflux_integral'
[]
# MOMENTUM
[momentumflux_left]
type = MomentumFluxIntegral
boundary = inlet
arhouA = rhouA
vel = vel
p = p
A = A
[]
[momentumflux_right]
type = MomentumFluxIntegral
boundary = outlet
arhouA = rhouA
vel = vel
p = p
A = A
[]
[momentumflux_difference]
type = DifferencePostprocessor
value1 = momentumflux_right
value2 = momentumflux_left
[]
[momentumflux_integral]
type = TimeIntegratedPostprocessor
value = momentumflux_difference
[]
[momentum]
type = ElementIntegralVariablePostprocessor
variable = rhouA
execute_on = 'initial timestep_end'
[]
[momentum_change]
type = ChangeOverTimePostprocessor
postprocessor = momentum
change_with_respect_to_initial = true
execute_on = 'initial timestep_end'
[]
[momentum_conservation]
type = SumPostprocessor
values = 'momentum_change momentumflux_integral'
[]
# ENERGY
[energyflux_left]
type = EnergyFluxIntegral
boundary = inlet
arhouA = rhouA
H = H
[]
[energyflux_right]
type = EnergyFluxIntegral
boundary = outlet
arhouA = rhouA
H = H
[]
[energyflux_difference]
type = DifferencePostprocessor
value1 = energyflux_right
value2 = energyflux_left
[]
[energyflux_integral]
type = TimeIntegratedPostprocessor
value = energyflux_difference
[]
[energy]
type = ElementIntegralVariablePostprocessor
variable = rhoEA
execute_on = 'initial timestep_end'
[]
[energy_change]
type = ChangeOverTimePostprocessor
postprocessor = energy
change_with_respect_to_initial = true
execute_on = 'initial timestep_end'
[]
[energy_conservation]
type = SumPostprocessor
values = 'energy_change energyflux_integral'
[]
[]
[Outputs]
[console]
type = Console
show = 'mass_conservation momentum_conservation energy_conservation'
[]
velocity_as_vector = false
[]
(modules/thermal_hydraulics/test/tests/components/volume_junction_1phase/phy.deadend.i)
# Junction between 3 pipes, 1 of which goes to a dead-end. In the steady-state,
# no flow should go into the dead-end pipe.
[GlobalParams]
gravity_vector = '0 0 0'
scaling_factor_1phase = '1 1 1e-5'
initial_T = 250
initial_p = 1e5
initial_vel_x = 1
initial_vel_y = 0
initial_vel_z = 0
closures = simple_closures
[]
[AuxVariables]
[p0]
block = 'inlet_pipe outlet_pipe deadend_pipe'
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[p0_kernel]
type = StagnationPressureAux
variable = p0
fp = eos
e = e
v = v
vel = vel
[]
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 1.4
cv = 725
q = 0
q_prime = 0
p_inf = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Functions]
[T0]
type = ParsedFunction
expression = 'if (x < 1, 300 + 50 * sin(2*pi*x + 1.5*pi), 250)'
[]
[]
[Components]
[inlet]
type = InletDensityVelocity1Phase
input = 'inlet_pipe:in'
rho = 1.37931034483
vel = 1
[]
[inlet_pipe]
type = FlowChannel1Phase
fp = eos
position = '0 0 0'
orientation = '1 0 0'
length = 1
A = 1
f = 0
initial_T = T0
initial_p = 1e5
initial_vel = 1
n_elems = 20
[]
[junction1]
type = VolumeJunction1Phase
connections = 'inlet_pipe:out deadend_pipe:in outlet_pipe:in'
position = '1 0 0'
volume = 1e-8
use_scalar_variables = false
[]
[outlet_pipe]
type = FlowChannel1Phase
fp = eos
position = '1 0 0'
orientation = '1 0 0'
length = 1
A = 1
f = 0
initial_T = 250
initial_p = 1e5
initial_vel = 1
n_elems = 20
[]
[outlet]
type = Outlet1Phase
input = 'outlet_pipe:out'
p = 1e5
[]
[deadend_pipe]
type = FlowChannel1Phase
fp = eos
position = '1 0 0'
orientation = '0 1 0'
length = 1
A = 1
f = 0
initial_T = 250
initial_p = 1e5
initial_vel = 0
n_elems = 20
[]
[deadend]
type = SolidWall1Phase
input = 'deadend_pipe:out'
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 0
nl_abs_tol = 1e-6
nl_max_its = 10
l_tol = 1e-6
l_max_its = 10
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
start_time = 0
end_time = 5
dt = 0.1
abort_on_solve_fail = true
[]
[Postprocessors]
# These post-processors are used for testing that the stagnation pressure in
# the dead-end pipe is equal to the inlet stagnation pressure.
[p0_inlet]
type = SideAverageValue
variable = p0
boundary = inlet_pipe:in
[]
[p0_deadend]
type = SideAverageValue
variable = p0
boundary = deadend_pipe:out
[]
[test_rel_err]
type = RelativeDifferencePostprocessor
value1 = p0_deadend
value2 = p0_inlet
[]
[]
[Outputs]
[out]
type = CSV
show = test_rel_err
sync_only = true
sync_times = '1 2 3 4 5'
[]
velocity_as_vector = false
[]
(modules/thermal_hydraulics/test/tests/components/volume_junction_1phase/err.missing_ics.i)
[GlobalParams]
gravity_vector = '0 0 0'
A = 1e-4
f = 0
fp = fp
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 1.4
cv = 725
p_inf = 0
q = 0
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe1:in'
# Stagnation property with p = 1e5 Pa, T = 250 K, vel = 1 m/s
p0 = 100000.68965687
T0 = 250.00049261084
[]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 2
initial_p = 1e5
initial_T = 250
initial_vel = 0
[]
[junction]
type = VolumeJunction1Phase
connections = 'pipe1:out pipe2:in'
position = '1.02 0 0'
volume = 0.1
use_scalar_variables = false
[]
[pipe2]
type = FlowChannel1Phase
position = '1.04 0 0'
orientation = '1 0 0'
length = 0.96
n_elems = 2
initial_p = 1e5
initial_T = 250
initial_vel = 0
[]
[outlet]
type = Outlet1Phase
input = 'pipe2:out'
p = 1e5
[]
[]
[Executioner]
type = Transient
abort_on_solve_fail = true
[]
(modules/thermal_hydraulics/tutorials/single_phase_flow/05_secondary_side.i)
T_in = 300. # K
m_dot_in = 1e-2 # kg/s
press = 10e5 # Pa
# core parameters
core_length = 1. # m
core_n_elems = 25
core_dia = '${units 2. cm -> m}'
core_pitch = '${units 8.7 cm -> m}'
A_core = '${fparse core_pitch^2 - 0.25 *pi * core_dia^2}'
P_wet_core = '${fparse 4*core_pitch + pi * core_dia}'
Dh_core = '${fparse 4 * A_core / P_wet_core}'
# pipe parameters
pipe_dia = '${units 10. cm -> m}'
A_pipe = '${fparse 0.25 * pi * pipe_dia^2}'
tot_power = 2000 # W
# heat exchanger parameters
hx_dia_inner = '${units 12. 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.5 # m
hx_n_elems = 25
m_dot_sec_in = 1. # kg/s
[GlobalParams]
initial_p = ${press}
initial_vel = 0.0001
initial_T = ${T_in}
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
gravity_vector = '0 0 0'
rdg_slope_reconstruction = minmod
scaling_factor_1phase = '1 1e-2 1e-4'
scaling_factor_rhoV = 1
scaling_factor_rhouV = 1e-2
scaling_factor_rhovV = 1e-2
scaling_factor_rhowV = 1e-2
scaling_factor_rhoEV = 1e-4
closures = thm_closures
fp = he
[]
[Functions]
[m_dot_sec_fn]
type = PiecewiseLinear
xy_data = '
0 0
10 ${m_dot_sec_in}'
[]
[]
[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]
[thm_closures]
type = Closures1PhaseTHM
[]
[]
[SolidProperties]
[steel]
type = ThermalFunctionSolidProperties
rho = 8050
k = 45
cp = 466
[]
[]
[Components]
[total_power]
type = TotalPower
power = ${tot_power}
[]
[up_pipe_1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 1'
length = 0.5
n_elems = 15
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct1]
type = JunctionParallelChannels1Phase
position = '0 0 0.5'
connections = 'up_pipe_1:out core_chan:in'
volume = 1e-5
use_scalar_variables = false
[]
[core_chan]
type = FlowChannel1Phase
position = '0 0 0.5'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
roughness = .0001
A = ${A_core}
D_h = ${Dh_core}
[]
[core_hs]
type = HeatStructureCylindrical
position = '0 0 0.5'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
names = 'block'
widths = '${fparse core_dia / 2.}'
solid_properties = 'steel'
solid_properties_T_ref = '300'
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}'
[]
[jct2]
type = JunctionParallelChannels1Phase
position = '0 0 1.5'
connections = 'core_chan:out up_pipe_2:in'
volume = 1e-5
use_scalar_variables = false
[]
[up_pipe_2]
type = FlowChannel1Phase
position = '0 0 1.5'
orientation = '0 0 1'
length = 0.5
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct3]
type = JunctionOneToOne1Phase
connections = 'up_pipe_2:out top_pipe_1:in'
[]
[top_pipe_1]
type = FlowChannel1Phase
position = '0 0 2'
orientation = '1 0 0'
length = 0.5
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[top_pipe_2]
type = FlowChannel1Phase
position = '0.5 0 2'
orientation = '1 0 0'
length = 0.5
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct4]
type = VolumeJunction1Phase
position = '0.5 0 2'
volume = 1e-5
connections = 'top_pipe_1:out top_pipe_2:in press_pipe:in'
use_scalar_variables = false
[]
[press_pipe]
type = FlowChannel1Phase
position = '0.5 0 2'
orientation = '0 1 0'
length = 0.2
n_elems = 5
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[pressurizer]
type = InletStagnationPressureTemperature1Phase
p0 = ${press}
T0 = ${T_in}
input = press_pipe:out
[]
[jct5]
type = JunctionOneToOne1Phase
connections = 'top_pipe_2:out down_pipe_1:in'
[]
[down_pipe_1]
type = FlowChannel1Phase
position = '1 0 2'
orientation = '0 0 -1'
length = 0.25
A = ${A_pipe}
n_elems = 5
[]
[jct6]
type = JunctionParallelChannels1Phase
position = '1 0 1.75'
connections = 'down_pipe_1:out hx/pri:in'
volume = 1e-5
use_scalar_variables = false
[]
[hx]
[pri]
type = FlowChannel1Phase
position = '1 0 1.75'
orientation = '0 0 -1'
length = ${hx_length}
n_elems = ${hx_n_elems}
roughness = 1e-5
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
P_hf = '${fparse pi * hx_dia_inner}'
[]
[wall]
type = HeatStructureCylindrical
position = '1 0 1.75'
orientation = '0 0 -1'
length = ${hx_length}
n_elems = ${hx_n_elems}
widths = '${hx_wall_thickness}'
n_part_elems = '3'
solid_properties = 'steel'
solid_properties_T_ref = '300'
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 0.25'
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
initial_T = 300
[]
[]
[jct7]
type = JunctionParallelChannels1Phase
position = '1 0 0.5'
connections = 'hx/pri:out down_pipe_2:in'
volume = 1e-5
use_scalar_variables = false
[]
[down_pipe_2]
type = FlowChannel1Phase
position = '1 0 0.25'
orientation = '0 0 -1'
length = 0.25
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct8]
type = JunctionOneToOne1Phase
connections = 'down_pipe_2:out bottom_1:in'
[]
[bottom_1]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '-1 0 0'
length = 0.5
n_elems = 5
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[pump]
type = Pump1Phase
position = '0.5 0 0'
connections = 'bottom_1:out bottom_2:in'
volume = 1e-4
A_ref = ${A_pipe}
head = 0
use_scalar_variables = false
[]
[bottom_2]
type = FlowChannel1Phase
position = '0.5 0 0'
orientation = '-1 0 0'
length = 0.5
n_elems = 5
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct9]
type = JunctionOneToOne1Phase
connections = 'bottom_2:out up_pipe_1:in'
[]
[inlet_sec]
type = InletMassFlowRateTemperature1Phase
input = 'hx/sec:in'
m_dot = 0
T = 300
[]
[outlet_sec]
type = Outlet1Phase
input = 'hx/sec:out'
p = 1e5
[]
[]
[ControlLogic]
[set_point]
type = GetFunctionValueControl
function = ${m_dot_in}
[]
[pid]
type = PIDControl
initial_value = 0.0
set_point = set_point:value
input = m_dot_pump
K_p = 1.
K_i = 4.
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]
[power_to_coolant]
type = ADHeatRateConvection1Phase
block = core_chan
P_hf = '${fparse pi *core_dia}'
[]
[m_dot_pump]
type = ADFlowJunctionFlux1Phase
boundary = core_chan:in
connection_index = 1
equation = mass
junction = jct7
[]
[core_T_out]
type = SideAverageValue
boundary = core_chan:out
variable = T
[]
[core_p_in]
type = SideAverageValue
boundary = core_chan:in
variable = p
[]
[core_p_out]
type = SideAverageValue
boundary = core_chan:out
variable = p
[]
[core_delta_p]
type = ParsedPostprocessor
pp_names = 'core_p_in core_p_out'
expression = 'core_p_in - core_p_out'
[]
[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
[]
[m_dot_sec]
type = ADFlowBoundaryFlux1Phase
boundary = inlet_sec
equation = mass
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 0
[TimeStepper]
type = IterationAdaptiveDT
dt = 1
[]
dtmax = 5
end_time = 500
line_search = basic
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 0
nl_abs_tol = 1e-8
nl_max_its = 25
[]
[Outputs]
exodus = true
[console]
type = Console
max_rows = 1
outlier_variable_norms = false
[]
print_linear_residuals = false
[]
(modules/thermal_hydraulics/test/tests/jacobians/materials/fluid_properties_3eqn.i)
[JacobianTest1Phase]
A = 10
p = 1e5
T = 300
vel = 2
fp_1phase = fp_1phase
[]
[FluidProperties]
[fp_1phase]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Kernels]
[test_kernel]
type = MaterialDerivativeTestKernel
variable = rhoA
material_property = <none>
coupled_variables = 'rhoA rhouA rhoEA'
[]
[]
(modules/thermal_hydraulics/test/tests/components/inlet_stagnation_p_t_1phase/phy.stagnation_p_T_steady_3eqn.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = 101325
initial_T = 300
initial_vel = 34.84507
scaling_factor_1phase = '1 1 1e-4'
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = eos
# geometry
position = '0 0 0'
orientation = '1 0 0'
A = 1.
f = 0.0
length = 1
n_elems = 10
[]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe:in'
p0 = 102041.128
T0 = 300.615
reversible = false
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 101325
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 1e-4
num_steps = 10
abort_on_solve_fail = true
solve_type = 'NEWTON'
nl_rel_tol = 1e-9
nl_abs_tol = 1e-8
nl_max_its = 30
l_tol = 1e-3
l_max_its = 100
[]
[Outputs]
[out]
type = Exodus
[]
velocity_as_vector = false
[]
(modules/thermal_hydraulics/test/tests/auxkernels/prandtl_number/1phase.i)
# Use PrandtlNumberAux to compute Prandtl number
[GlobalParams]
family = MONOMIAL
order = CONSTANT
[]
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
allow_renumbering = false
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[AuxVariables]
[prandtl_no]
[]
[v]
initial_condition = 1e-3
[]
[e]
initial_condition = 1e5
[]
[]
[AuxKernels]
[pr_aux]
type = PrandtlNumberAux
variable = prandtl_no
v = v
e = e
fp = fp
[]
[]
[Problem]
solve = false
[]
[Postprocessors]
[prandtl_no]
type = ElementalVariableValue
variable = prandtl_no
elementid = 0
[]
[]
[Executioner]
type = Transient
dt = 1
num_steps = 1
abort_on_solve_fail = true
[]
[Outputs]
csv = true
execute_on = TIMESTEP_END
[]
(modules/thermal_hydraulics/test/tests/components/volume_junction_1phase/equal_area_with_junction.i)
# Tests a junction between 2 flow channels of equal area and orientation. A
# sinusoidal density shape is advected to the right and should not be affected
# by the junction; the solution should be identical to the equivalent
# no-junction solution.
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = 1e5
initial_vel = 1
A = 25
f = 0
fp = fp
scaling_factor_1phase = '0.04 0.04 0.04e-5'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 1.4
cv = 725
p_inf = 0
q = 0
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Functions]
[T0]
type = CosineHumpFunction
axis = x
hump_center_position = 1
hump_width = 0.5
hump_begin_value = 250
hump_center_value = 300
[]
[]
[Components]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe1:in'
# Stagnation property with p = 1e5 Pa, T = 250 K, vel = 1 m/s
p0 = 100000.68965687
T0 = 250.00049261084
[]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
initial_T = T0
n_elems = 25
[]
[junction]
type = VolumeJunction1Phase
connections = 'pipe1:out pipe2:in'
# NOTE: volume parameters are added via command-line arguments by tests file.
position = '1.02 0 0'
initial_T = T0
initial_vel_x = 1
initial_vel_y = 0
initial_vel_z = 0
scaling_factor_rhoV = 1
scaling_factor_rhouV = 1
scaling_factor_rhovV = 1
scaling_factor_rhowV = 1
scaling_factor_rhoEV = 1e-5
use_scalar_variables = false
[]
[pipe2]
type = FlowChannel1Phase
position = '1.04 0 0'
orientation = '1 0 0'
length = 0.96
initial_T = T0
n_elems = 24
[]
[outlet]
type = Outlet1Phase
input = 'pipe2:out'
p = 1e5
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 0.01
num_steps = 5
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 0
nl_abs_tol = 1e-6
nl_max_its = 10
l_tol = 1e-3
l_max_its = 10
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Postprocessors]
[junction_rho]
type = ElementAverageValue
variable = rhoV
block = 'junction'
execute_on = 'initial timestep_end'
[]
[junction_rhou]
type = ElementAverageValue
variable = rhouV
block = 'junction'
execute_on = 'initial timestep_end'
[]
[junction_rhoE]
type = ElementAverageValue
variable = rhoEV
block = 'junction'
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
[out]
type = CSV
execute_scalars_on = 'none'
execute_on = 'initial timestep_end'
[]
[]
(modules/thermal_hydraulics/test/tests/components/deprecated/heat_source_volumetric.i)
[GlobalParams]
scaling_factor_1phase = '1 1e-2 1e-4'
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[flow_channel]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 10
A = 1
f = 0
fp = fp
closures = simple_closures
initial_T = 310
initial_p = 1e5
initial_vel = 0
[]
[wall1]
type = SolidWall1Phase
input = flow_channel:in
[]
[wall2]
type = SolidWall1Phase
input = flow_channel:out
[]
[heat_source]
type = HeatSourceVolumetric
flow_channel = flow_channel
q = 1e3
[]
[]
[Postprocessors]
[E_tot]
type = ElementIntegralVariablePostprocessor
variable = rhoEA
execute_on = 'initial timestep_end'
[]
[E_tot_change]
type = ChangeOverTimePostprocessor
change_with_respect_to_initial = true
postprocessor = E_tot
execute_on = 'initial timestep_end'
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
solve_type = 'NEWTON'
line_search = 'basic'
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.1
end_time = 1
abort_on_solve_fail = true
[]
(modules/thermal_hydraulics/test/tests/base/simulation/loop_identification.i)
# This test tests the loop identification function, which creates a map of component
# names to a loop name. "Loops" are defined to be sets of components which are
# physically connected - heat exchanger connections do not constitute physical
# connections in this sense. Note that this test is not meant to actually perform
# any physical computations, so dummy values are provided for the required parameters.
#
# The test configuration for this test is the following:
#
# pipe1 -> corechannel:pipe -> pipe2 -> hx:primary -> pipe1
# j1 j2 j3 j4
#
# inlet -> hx:secondary -> outlet
#
# This test uses the command-line option "--print-component-loops" to print out
# the lists of components in each loop, with the desired output being the
# following:
#
# Loop 1:
#
# corechannel:pipe
# hx:primary
# j1
# j2
# j3
# j4
# pipe1
# pipe2
#
# Loop 2:
#
# hx:secondary
# inlet
# outlet
[GlobalParams]
closures = simple_closures
initial_p = 1e6
initial_T = 300
initial_vel = 0
[]
[FluidProperties]
[fp_liquid]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[SolidProperties]
[hx:wall]
type = ThermalFunctionSolidProperties
k = 1
cp = 1
rho = 1
[]
[]
[Components]
# PRIMARY LOOP
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 1
A = 1
f = 1
fp = fp_liquid
[]
[j1]
type = JunctionOneToOne1Phase
connections = 'pipe1:out corechannel:in'
[]
[corechannel]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 1
A = 1
f = 1
fp = fp_liquid
[]
[j2]
type = JunctionOneToOne1Phase
connections = 'corechannel:out pipe2:in'
[]
[pipe2]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 1
A = 1
f = 1
fp = fp_liquid
[]
[j3]
type = JunctionOneToOne1Phase
connections = 'pipe2:out hx:primary:in'
[]
[hx:primary]
type = FlowChannel1Phase
position = '0 1 0'
orientation = '1 0 0'
length = 1
n_elems = 1
A = 1
f = 1
fp = fp_liquid
[]
[j4]
type = JunctionOneToOne1Phase
connections = 'hx:primary:out pipe1:in'
[]
# HEAT EXCHANGER
[hs]
type = HeatStructurePlate
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 1
solid_properties = hx:wall
solid_properties_T_ref = '300'
n_part_elems = 1
names = 0
widths = 1
depth = 1
initial_T = 300
[]
[ht_primary]
type = HeatTransferFromHeatStructure1Phase
hs = hs
flow_channel = hx:primary
hs_side = outer
Hw = 0
[]
[ht_secondary]
type = HeatTransferFromHeatStructure1Phase
hs = hs
flow_channel = hx:secondary
hs_side = inner
Hw = 0
[]
# SECONDARY LOOP
[inlet]
type = SolidWall1Phase
input = 'hx:secondary:out'
[]
[hx:secondary]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 1
A = 1
f = 1
fp = fp_liquid
[]
[outlet]
type = SolidWall1Phase
input = 'hx:secondary:in'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
[console]
type = Console
system_info = ''
enable = false
[]
[]
(modules/thermal_hydraulics/test/tests/components/junction_parallel_channels_1phase/err.missing_ics.i)
[GlobalParams]
gravity_vector = '0 0 0'
A = 1e-4
f = 0
fp = fp
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 1.4
cv = 725
p_inf = 0
q = 0
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe1:in'
# Stagnation property with p = 1e5 Pa, T = 250 K, vel = 1 m/s
p0 = 100000.68965687
T0 = 250.00049261084
[]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 2
initial_p = 1e5
initial_T = 250
initial_vel = 0
[]
[junction]
type = JunctionParallelChannels1Phase
connections = 'pipe1:out pipe2:in'
position = '1.02 0 0'
volume = 0.1
use_scalar_variables = false
[]
[pipe2]
type = FlowChannel1Phase
position = '1.04 0 0'
orientation = '1 0 0'
length = 0.96
n_elems = 2
initial_p = 1e5
initial_T = 250
initial_vel = 0
[]
[outlet]
type = Outlet1Phase
input = 'pipe2:out'
p = 1e5
[]
[]
[Executioner]
type = Transient
abort_on_solve_fail = true
[]
(modules/thermal_hydraulics/test/tests/closures/THM_1phase/thm1phase.i)
D = 0.1
A = '${fparse (1./4.)*pi*D^2}'
P_hf = '${fparse pi*D}'
D_h = '${fparse 4*A/P_hf}'
mdot = 0.04
file_base = 'db_churchill'
[GlobalParams]
gravity_vector = '0 0 0'
initial_vel = 0.003
initial_p = 1e5
initial_T = 300
D_h = ${D_h}
A = ${A}
P_hf = ${P_hf}
m_dot = ${mdot}
closures = thm
execute_on = 'initial timestep_begin'
[]
[FluidProperties]
[water]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.56361
mu = 8.84e-05
[]
[]
[Closures]
[thm]
type = Closures1PhaseTHM
wall_htc_closure = dittus_boelter
wall_ff_closure = churchill
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = water
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 10
[]
#--------------Pipe BCs-------------#
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe:in'
T = 300
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 1e5
[]
[ht]
type = HeatTransferFromSpecifiedTemperature1Phase
flow_channel = 'pipe'
T_wall = 500
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
num_steps = 1
dt = 1e-5
[]
[Postprocessors]
[Hw]
type = ADElementAverageMaterialProperty
mat_prop = Hw
[]
[f]
type = ADElementAverageMaterialProperty
mat_prop = f_D
block = pipe
[]
[]
[Outputs]
csv = true
file_base = ${file_base}
[]
(modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_1phase/phy.T_wall_transfer_3eqn_x.i)
# Testing that T_solid gets properly projected onto a pipe
# That's why Hw in pipe1 is set to 0, so we do not have any heat exchange
# Note that the pipe and the heat structure have an opposite orientation, which
# is crucial for this test.
[GlobalParams]
initial_p = 1.e5
initial_vel = 0.
initial_T = 300.
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[SolidProperties]
[wall-mat]
type = ThermalFunctionSolidProperties
k = 100.0
rho = 100.0
cp = 100.0
[]
[]
[Functions]
[T_init]
type = ParsedFunction
expression = '290 + sin((1 - x) * pi * 1.4)'
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
position = '0 -0.2 0'
orientation = '1 0 0'
length = 1
n_elems = 50
A = 9.6858407346e-01
D_h = 6.1661977237e+00
f = 0.01
fp = eos
[]
[hs]
type = HeatStructureCylindrical
position = '1 -0.1 0'
orientation = '-1 0 0'
length = 1
n_elems = 50
#rotation = 90
solid_properties = 'wall-mat'
solid_properties_T_ref = '300'
n_part_elems = 3
widths = '0.1'
names = 'wall'
initial_T = T_init
[]
[hxconn]
type = HeatTransferFromHeatStructure1Phase
hs = hs
hs_side = outer
flow_channel = pipe1
Hw = 0
P_hf = 6.2831853072e-01
[]
[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 = 1
abort_on_solve_fail = true
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-6
nl_max_its = 20
l_tol = 1e-5
l_max_its = 300
start_time = 0.0
num_steps = 1
[]
[Outputs]
[out]
type = Exodus
show = 'T_wall T_solid'
[]
print_linear_residuals = false
[]
(modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_flux_1phase/phy.q_wall_multiple_3eqn.i)
# Tests that energy conservation is satisfied in 1-phase flow when there are
# multiple heat transfer components connected to the same pipe, using specified
# wall heat flux.
#
# This problem has 2 wall heat flux sources, each with differing parameters.
# Solid wall boundary conditions are imposed such that there should be no flow,
# and the solution should be spatially uniform. With no other sources, the
# energy balance is
# (rho*e*A)^{n+1} = (rho*e*A)^n + dt * [(q1*P1) + (q2*P2)]
# Note that spatial integration is dropped here due to spatial uniformity, and
# E has been replaced with e since velocity should be zero.
#
# For the initial conditions
# p = 100 kPa
# T = 300 K
# the density and specific internal energy should be
# rho = 1359.792245 kg/m^3
# e = 1.1320645935e+05 J/kg
#
# With the following heat source parameters:
# q1 = 10 MW/m^2 P1 = 0.2 m
# q2 = 20 MW/m^2 P2 = 0.4 m
# and A = 1 m^2 and dt = 2 s, the new energy solution value should be
# (rho*e*A)^{n+1} = 1359.792245 * 1.1320645935e+05 * 1 + 2 * (10e6 * 0.2 + 20e6 * 0.4)
# = 173937265.50803775 J/m
#
[GlobalParams]
gravity_vector = '0 0 0'
initial_T = 300
initial_p = 100e3
initial_vel = 0
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '1 0 0'
A = 1
f = 0
# length and number of elements should be arbitrary for the test
length = 10
n_elems = 1
[]
[ht1]
type = HeatTransferFromHeatFlux1Phase
flow_channel = pipe
q_wall = 10e6
P_hf = 0.2
Hw = 1
[]
[ht2]
type = HeatTransferFromHeatFlux1Phase
flow_channel = pipe
q_wall = 20e6
P_hf = 0.4
Hw = 1
[]
[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
dt = 2
num_steps = 1
abort_on_solve_fail = true
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 0
nl_abs_tol = 1e-6
nl_max_its = 5
l_tol = 1e-10
l_max_its = 10
[]
[Postprocessors]
[rhoEA_predicted]
type = ElementAverageValue
variable = rhoEA
block = pipe
[]
# This is included to test the naming of heat transfer quantities in the case
# of multiple heat transfers connected to a flow channel. This PP is not used
# in output but just included to ensure that an error does not occur (which is
# the case if the expected material property name does not exist).
# See https://github.com/idaholab/moose/issues/26286.
[q_wall_name_check]
type = ADElementAverageMaterialProperty
mat_prop = 'q_wall:2'
[]
[]
[Outputs]
[out]
type = CSV
show = 'rhoEA_predicted'
execute_on = 'final'
[]
[]
(modules/thermal_hydraulics/test/tests/components/volume_junction_1phase/phy.unequal_area.i)
# Junction between 2 pipes where the second has half the area of the first.
# The momentum density of the second should be twice that of the first.
[GlobalParams]
gravity_vector = '0 0 0'
initial_T = 250
initial_p = 1e5
initial_vel = 1
initial_vel_x = 1
initial_vel_y = 0
initial_vel_z = 0
f = 0
fp = eos
scaling_factor_1phase = '1 1 1e-5'
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 1.4
cv = 725
p_inf = 0
q = 0
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[inlet]
type = InletDensityVelocity1Phase
input = 'pipe1:in'
rho = 1.37931034483
vel = 1
[]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
A = 1
n_elems = 20
[]
[junction]
type = VolumeJunction1Phase
connections = 'pipe1:out pipe2:in'
position = '1 0 0'
volume = 1e-8
use_scalar_variables = false
[]
[pipe2]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '1 0 0'
length = 1
A = 0.5
n_elems = 20
[]
[outlet]
type = Outlet1Phase
input = 'pipe2:out'
p = 1e5
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 0
nl_abs_tol = 1e-6
nl_max_its = 10
l_tol = 1e-10
l_max_its = 10
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
start_time = 0
end_time = 3
dt = 0.1
abort_on_solve_fail = true
[]
[Postprocessors]
# These post-processors are used to test that the outlet side of the junction,
# which has half the area of the inlet side, has twice the momentum density
# that the inlet side does.
[rhouA_pipe1]
type = SideAverageValue
variable = rhouA
boundary = pipe1:out
[]
[rhouA_pipe2]
type = SideAverageValue
variable = rhouA
boundary = pipe2:out
[]
[test_rel_err]
type = RelativeDifferencePostprocessor
value1 = rhouA_pipe1
value2 = rhouA_pipe2
[]
[]
[Outputs]
[out]
type = CSV
show = test_rel_err
execute_on = 'final'
[]
[]
(modules/thermal_hydraulics/test/tests/components/flow_channel_1phase/jacobian.i)
[GlobalParams]
initial_p = 9.5e4
initial_T = 310
initial_vel = 2
gravity_vector = '9.81 0 0'
scaling_factor_1phase = '1. 1. 1.'
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[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.12837916709551
f = 0.0
length = 1
n_elems = 2
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 0
dt = 1
num_steps = 1
abort_on_solve_fail = true
solve_type = 'NEWTON'
nl_rel_tol = 1e-9
nl_abs_tol = 1e-8
nl_max_its = 30
l_tol = 1e-3
l_max_its = 100
petsc_options_iname = '-snes_type -snes_test_err'
petsc_options_value = 'test 1e-11'
[]
(modules/thermal_hydraulics/test/tests/components/inlet_stagnation_p_t_1phase/clg.ctrl_p0_3eqn.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = 1e5
initial_T = 300
initial_vel = 0.0
scaling_factor_1phase = '1 1 1e-5'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 50
A = 1.0000000000e-04
D_h = 1.1283791671e-02
f = 0.0
fp = fp
[]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe:in'
p0 = 1e5
T0 = 300
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 1e5
[]
[]
[Functions]
[inlet_p0_fn]
type = PiecewiseLinear
x = '0 1'
y = '1e5 1.001e5'
[]
[]
[ControlLogic]
[set_inlet_value]
type = TimeFunctionComponentControl
component = inlet
parameter = p0
function = inlet_p0_fn
[]
[]
[Postprocessors]
[inlet_p0]
type = RealComponentParameterValuePostprocessor
component = inlet
parameter = p0
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0.0
dt = 0.25
num_steps = 5
abort_on_solve_fail = true
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-5
nl_abs_tol = 1e-6
nl_max_its = 30
l_tol = 1e-3
l_max_its = 100
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_1phase/phy.T_wall_transfer_3eqn_y.i)
# Testing that T_solid gets properly projected onto a pipe
# That's why Hw in pipe1 is set to 0, so we do not have any heat exchange
# Note that the pipe and the heat structure have an opposite orientation, which
# is crucial for this test.
[GlobalParams]
initial_p = 1.e5
initial_vel = 0.
initial_T = 300.
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[SolidProperties]
[wall-mat]
type = ThermalFunctionSolidProperties
k = 100.0
rho = 100.0
cp = 100.0
[]
[]
[Functions]
[T_init]
type = ParsedFunction
expression = '290 + sin((1 - y) * pi * 1.4)'
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
position = '0.2 0 0'
orientation = '0 1 0'
length = 1
n_elems = 50
A = 9.6858407346e-01
D_h = 6.1661977237e+00
f = 0.01
fp = eos
[]
[hs]
type = HeatStructureCylindrical
position = '0.1 1 0'
orientation = '0 -1 0'
length = 1
n_elems = 50
solid_properties = 'wall-mat'
solid_properties_T_ref = '300'
n_part_elems = 3
widths = '0.1'
names = 'wall'
initial_T = T_init
[]
[hxconn]
type = HeatTransferFromHeatStructure1Phase
hs = hs
hs_side = outer
flow_channel = pipe1
Hw = 0
P_hf = 6.2831853072e-01
[]
[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 = 1
abort_on_solve_fail = true
solve_type = 'NEWTON'
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
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
start_time = 0.0
num_steps = 1
[]
[Outputs]
[out]
type = Exodus
show = 'T_wall T_solid'
[]
print_linear_residuals = false
[]
(modules/thermal_hydraulics/test/tests/misc/displaced_components/displaced_components.i)
[GlobalParams]
initial_T = 300
initial_p = 1e5
initial_vel = 0
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
gravity_vector = '0 0 0'
scaling_factor_1phase = '1.e0 1.e-4 1.e-6'
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
fp = eos
position = '0 0 0'
orientation = '1 0 0'
A = 1.
D_h = 1.12837916709551
f = 0
length = 1
n_elems = 10
[]
[pipe2]
type = FlowChannel1Phase
fp = eos
position = '0 0 0'
orientation = '0 1 0'
A = 1.
D_h = 1.12837916709551
f = 0
length = 1
n_elems = 10
[]
[pipe3]
type = FlowChannel1Phase
fp = eos
position = '0 0 0'
orientation = '0 0 1'
A = 1.
D_h = 1.12837916709551
f = 0
length = 1
n_elems = 10
[]
[junction]
type = VolumeJunction1Phase
connections = 'pipe1:in pipe2:in pipe3:in'
position = '0 0 0'
volume = 1e-5
use_scalar_variables = false
[]
[in1]
type = SolidWall1Phase
input = 'pipe1:out'
[]
[in2]
type = SolidWall1Phase
input = 'pipe2:out'
[]
[in3]
type = SolidWall1Phase
input = 'pipe3:out'
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 1e-5
num_steps = 1
abort_on_solve_fail = true
solve_type = 'PJFNK'
nl_rel_tol = 1e-5
nl_abs_tol = 1e-6
nl_max_its = 10
l_tol = 1e-3
l_max_its = 100
[]
[Outputs]
exodus = true
show = 'A'
[]
(modules/thermal_hydraulics/test/tests/components/simple_turbine_1phase/clg.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
f = 0
fp = fp
closures = simple_closures
gravity_vector = '0 0 0'
automatic_scaling = true
[]
[FluidProperties]
[fp]
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
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Functions]
[W_dot_fn]
type = PiecewiseLinear
xy_data = '
0 0
1 10'
[]
[]
[Components]
[inlet]
type = InletVelocityTemperature1Phase
input = 'pipe1:in'
vel = 1
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 = 0
use_scalar_variables = false
[]
[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
[]
[]
[ControlLogic]
[W_dot_ctrl]
type = TimeFunctionComponentControl
component = turbine
parameter = power
function = W_dot_fn
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
start_time = 0
dt = 0.1
num_steps = 10
solve_type = 'newton'
line_search = 'basic'
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu'
nl_rel_tol = 1e-6
nl_abs_tol = 1e-3
nl_max_its = 5
l_tol = 1e-4
abort_on_solve_fail = true
[]
[Postprocessors]
[turbine_power]
type = ElementAverageValue
variable = W_dot
block = 'turbine'
[]
[]
[Outputs]
[csv]
type = CSV
show = 'turbine_power'
[]
[]
(modules/thermal_hydraulics/test/tests/components/solid_wall_1phase/jacobian.i)
[GlobalParams]
initial_p = 9.5e4
initial_T = 310
initial_vel = 2
gravity_vector = '9.81 0 0'
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[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.12837916709551
f = 0.0
length = 1
n_elems = 3
[]
[inlet]
type = SolidWall1Phase
input = 'pipe:in'
[]
[outlet]
type = SolidWall1Phase
input = 'pipe:out'
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 0
dt = 1
num_steps = 1
abort_on_solve_fail = true
solve_type = 'NEWTON'
nl_rel_tol = 1e-9
nl_abs_tol = 1e-8
nl_max_its = 30
l_tol = 1e-3
l_max_its = 100
petsc_options_iname = '-snes_type -snes_test_err'
petsc_options_value = 'test 1e-11'
[]
(modules/thermal_hydraulics/test/tests/controls/copy_postprocessor_value_control/test.i)
# This is testing that the values copied by CopyPostprocessorValueControl are used.
# A postprocessor T_pt samples value at point (0, 0, 0), those values are then
# read in by CopyPostprocessorValueControl and then we output this value. The values
# are lagged by one time step, because controls are executed at the beginning
# of the time step and postprocessors at the end of the time step. Note that
# CopyPostprocessorValueControl is added when a postprocessor is created. That's why
# you do not see the object in this input file.
[GlobalParams]
initial_p = 100.e3
initial_vel = 1.0
initial_T = 350.
scaling_factor_1phase = '1 1e-2 1e-4'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '1 0 0'
length = 15.0
n_elems = 10
A = 0.01
D_h = 0.1
f = 0.01
[]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe1:in'
p0 = 100.e3
T0 = 340.
[]
[outlet]
type = Outlet1Phase
input = 'pipe1:out'
p = 100.0e3
[]
[]
[Postprocessors]
[T_pt]
type = SideAverageValue
boundary = pipe1:in
variable = T
execute_on = 'initial timestep_end'
[]
[T_ctrl]
type = RealControlDataValuePostprocessor
control_data_name = T_pt
execute_on = timestep_end
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 0
dt = 1e-5
num_steps = 3
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 1e-6
nl_abs_tol = 1e-6
nl_max_its = 20
l_tol = 1e-3
l_max_its = 5
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_1phase/err.not_a_hs.i)
[GlobalParams]
initial_p = 15.5e6
initial_vel = 2
initial_T = 560
scaling_factor_1phase = '1 1 1'
scaling_factor_temperature = '1'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 1'
length = 3.865
n_elems = 1
A = 8.78882e-5
D_h = 0.01179
f = 0.01
fp = fp
[]
[hx]
type = HeatTransferFromHeatStructure1Phase
hs = inlet # wrong
hs_side = outer
flow_channel = pipe
Hw = 5.33e4
P_hf = 0.029832559676
[]
[hx2]
type = HeatTransferFromHeatStructure1Phase
hs = asdf # wrong
hs_side = outer
flow_channel = pipe
Hw = 5.33e4
P_hf = 0.029832559676
[]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe:in'
p0 = 15.5e6
T0 = 560
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 15e6
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
dt = 1.e-2
dtmin = 1.e-2
solve_type = 'NEWTON'
nl_rel_tol = 1e-9
nl_abs_tol = 1e-8
nl_max_its = 1
l_tol = 1e-3
l_max_its = 30
start_time = 0.0
num_steps = 20
[]
(modules/thermal_hydraulics/test/tests/components/inlet_mass_flow_rate_1phase/jacobian.i)
[GlobalParams]
initial_p = 1e5
initial_T = 300
initial_vel = 2
gravity_vector = '9.81 0 0'
scaling_factor_1phase = '1. 1. 1'
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[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.12837916709551
f = 0
length = 1
n_elems = 2
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe:in'
m_dot = 1
T = 300
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 0
dt = 1e-2
num_steps = 1
abort_on_solve_fail = true
solve_type = 'NEWTON'
petsc_options_iname = '-snes_type -snes_test_err'
petsc_options_value = 'test 1e-11'
[]
(modules/thermal_hydraulics/test/tests/components/simple_turbine_1phase/jacobian.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'
[]
[FluidProperties]
[fp]
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
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 2
A = 1
[]
[turbine]
type = SimpleTurbine1Phase
connections = 'pipe1:out pipe2:in'
position = '1 0 0'
volume = 1
A_ref = 1.0
K = 0
on = false
power = 1000
use_scalar_variables = false
[]
[pipe2]
type = FlowChannel1Phase
position = '1. 0 0'
orientation = '1 0 0'
length = 1
n_elems = 2
A = 1
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
start_time = 0
dt = 1
num_steps = 1
abort_on_solve_fail = true
solve_type = 'newton'
line_search = 'basic'
petsc_options_iname = '-snes_test_err'
petsc_options_value = ' 1e-11'
[]
(modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_1phase/phy.energy_heatstructure_ss_1phase.i)
# This test tests conservation of energy at steady state for 1-phase flow when a
# heat structure is used. Conservation is checked by comparing the integral of
# the heat flux against the difference of the boundary fluxes.
[GlobalParams]
initial_p = 7.0e6
initial_vel = 0
initial_T = 513
gravity_vector = '0.0 0.0 0.0'
scaling_factor_1phase = '1 1 1e-4'
closures = simple_closures
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[SolidProperties]
[fuel-mat]
type = ThermalFunctionSolidProperties
k = 3.7
cp = 3.e2
rho = 10.42e3
[]
[gap-mat]
type = ThermalFunctionSolidProperties
k = 0.7
cp = 5e3
rho = 1.0
[]
[clad-mat]
type = ThermalFunctionSolidProperties
k = 16
cp = 356.
rho = 6.551400E+03
[]
[]
[Components]
[reactor]
type = TotalPower
power = 1e3
[]
[core:pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 1'
length = 3.66
n_elems = 10
A = 1.907720E-04
D_h = 1.698566E-02
f = 0.0
fp = eos
[]
[core:solid]
type = HeatStructureCylindrical
position = '0 -0.0071501 0'
orientation = '0 0 1'
length = 3.66
n_elems = 10
names = 'FUEL GAP CLAD'
widths = '6.057900E-03 1.524000E-04 9.398000E-04'
n_part_elems = '5 1 2'
solid_properties = 'fuel-mat gap-mat clad-mat'
solid_properties_T_ref = '300 300 300'
initial_T = 513
[]
[core:hgen]
type = HeatSourceFromTotalPower
hs = core:solid
regions = 'FUEL'
power = reactor
power_fraction = 1
[]
[core:hx]
type = HeatTransferFromHeatStructure1Phase
flow_channel = core:pipe
hs = core:solid
hs_side = outer
Hw = 1.0e4
P_hf = 4.4925e-2
[]
[inlet]
type = InletDensityVelocity1Phase
input = 'core:pipe:in'
rho = 817.382210128610836
vel = 2.4
[]
[outlet]
type = Outlet1Phase
input = 'core:pipe:out'
p = 7e6
[]
[]
[Postprocessors]
[E_in]
type = ADFlowBoundaryFlux1Phase
boundary = inlet
equation = energy
execute_on = 'initial timestep_end'
[]
[E_out]
type = ADFlowBoundaryFlux1Phase
boundary = outlet
equation = energy
execute_on = 'initial timestep_end'
[]
[hf_pipe]
type = ADHeatRateConvection1Phase
block = core:pipe
T_wall = T_wall
T = T
Hw = Hw
P_hf = P_hf
execute_on = 'initial timestep_end'
[]
[E_diff]
type = DifferencePostprocessor
value1 = E_in
value2 = E_out
execute_on = 'initial timestep_end'
[]
[E_conservation]
type = SumPostprocessor
values = 'E_diff hf_pipe'
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
abort_on_solve_fail = true
dt = 5
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 50
l_tol = 1e-3
l_max_its = 60
start_time = 0
end_time = 260
[]
[Outputs]
[out]
type = CSV
execute_on = final
show = 'E_conservation'
[]
[console]
type = Console
show = 'E_conservation'
[]
[]
(modules/thermal_hydraulics/test/tests/components/volume_junction_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 = 0
initial_vel_x = 0
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
[]
[FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[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
[]
[junction]
type = VolumeJunction1Phase
connections = 'pipe_cold:out pipe_hot:out pipe_warm:in'
position = '1 0.5 0'
volume = 1e-8
use_scalar_variables = false
[]
[]
[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'
[]
[console]
type = Console
max_rows = 1
[]
print_linear_residuals = false
[]
(modules/thermal_hydraulics/test/tests/misc/initial_from_file/flow_channel/test.i)
# Test that the initial conditions read from the exodus file are correct
[GlobalParams]
scaling_factor_1phase = '1. 1.e-2 1.e-4'
closures = simple_closures
initial_from_file = 'steady_state_out.e'
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
k = 0.5
mu = 281.8e-6
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = fp
# geometry
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 3
A = 1.907720E-04
D_h = 1.698566E-02
f = 0.1
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe:in'
m_dot = 0.1
T = 500
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = 6e6
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 1
num_steps = 1
abort_on_solve_fail = true
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-7
nl_abs_tol = 1e-8
nl_max_its = 10
l_tol = 1e-3
l_max_its = 100
[]
[Outputs]
exodus = true
execute_on = 'initial'
velocity_as_vector = false
[]
(modules/fluid_properties/test/tests/ics/rho_from_pressure_temperature/test.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
allow_renumbering = false
[]
[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
[]
[]
[AuxVariables]
[rho]
[]
[p]
[]
[T]
[]
[]
[ICs]
[rho_ic]
type = RhoFromPressureTemperatureIC
variable = rho
p = p
T = T
fp = fp_steam
[]
[p_ic]
type = ConstantIC
variable = p
value = 100e3
[]
[T_ic]
type = ConstantIC
variable = T
value = 500
[]
[]
[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/controls/error_checking/non_existent_control_data.i)
# This test makes sure that we error out when a control object requests a data
# that were not declared
[GlobalParams]
initial_p = 100.e3
initial_vel = 1.0
initial_T = 350.
scaling_factor_1phase = '1 1e-2 1e-4'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '1 0 0'
length = 15.0
n_elems = 10
A = 0.01
D_h = 0.1
f = 0.01
[]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe1:in'
p0 = 105.e3
T0 = 300.
[]
[outlet]
type = Outlet1Phase
input = 'pipe1:out'
p = 100.0e3
[]
[]
[ControlLogic]
[set_inlet_value]
type = SetComponentRealValueControl
component = inlet
parameter = T0
value = wrong # this does not exist
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 0
dt = 0.5
num_steps = 1
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 1e-6
nl_abs_tol = 1e-6
nl_max_its = 20
l_tol = 1e-3
l_max_its = 5
[]
(modules/thermal_hydraulics/test/tests/components/junction_parallel_channels_1phase/equal_area_no_junction.i)
# Tests a junction between 2 flow channels of equal area and orientation. A
# sinusoidal density shape is advected to the right and should not be affected
# by the junction; the solution should be identical to the equivalent
# no-junction solution.
#
# This input file has no junction and is used for comparison to the results with
# a junction.
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = 1e5
initial_vel = 1
A = 25
f = 0
fp = fp
scaling_factor_1phase = '0.04 0.04 0.04e-5'
closures = simple_closures
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 1.4
cv = 725
p_inf = 0
q = 0
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Functions]
[T0]
type = CosineHumpFunction
axis = x
hump_center_position = 1
hump_width = 0.5
hump_begin_value = 250
hump_center_value = 300
[]
[]
[Components]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe1:in'
# Stagnation property with p = 1e5 Pa, T = 250 K, vel = 1 m/s
p0 = 100000.68965687
T0 = 250.00049261084
[]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 2
initial_T = T0
n_elems = 50
[]
[outlet]
type = Outlet1Phase
input = 'pipe1:out'
p = 1e5
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 0.01
num_steps = 5
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 0
nl_abs_tol = 1e-6
nl_max_its = 10
l_tol = 1e-3
l_max_its = 10
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Postprocessors]
[junction_rhoA]
type = PointValue
variable = rhoA
point = '1.02 0 0'
execute_on = 'initial timestep_end'
[]
[junction_rhouA]
type = PointValue
variable = rhouA
point = '1.02 0 0'
execute_on = 'initial timestep_end'
[]
[junction_rhoEA]
type = PointValue
variable = rhoEA
point = '1.02 0 0'
execute_on = 'initial timestep_end'
[]
[junction_rho]
type = ScalePostprocessor
value = junction_rhoA
scaling_factor = 0.04
execute_on = 'initial timestep_end'
[]
[junction_rhou]
type = ScalePostprocessor
value = junction_rhouA
scaling_factor = 0.04
execute_on = 'initial timestep_end'
[]
[junction_rhoE]
type = ScalePostprocessor
value = junction_rhoEA
scaling_factor = 0.04
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
[out]
type = CSV
show = 'junction_rho junction_rhou junction_rhoE'
execute_scalars_on = 'none'
execute_on = 'initial timestep_end'
[]
[]
(modules/thermal_hydraulics/test/tests/components/flow_channel_1phase/err.overspecified.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_vel = 0
initial_p = 1e5
initial_T = 300
closures = simple_closures
[]
[FluidProperties]
[water]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe]
type = FlowChannel1Phase
fp = water
# geometry
position = '0 0 0'
orientation = '1 0 0'
A = 1.
D_h = 1.12837916709551
f = 0.01
length = 1
n_elems = 100
[]
[inlet1]
type = InletStagnationPressureTemperature1Phase
input = 'pipe:in'
p0 = 10
T0 = 10
[]
[inlet2]
type = InletStagnationPressureTemperature1Phase
input = 'pipe:in'
p0 = 11
T0 = 10
[]
[outlet1]
type = Outlet1Phase
input = 'pipe:out'
p = 10
[]
[outlet2]
type = Outlet1Phase
input = 'pipe:out'
p = 11
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
dt = 1e-4
dtmin = 1.e-7
solve_type = 'PJFNK'
nl_rel_tol = 1e-9
nl_abs_tol = 1e-8
nl_max_its = 10
l_tol = 1e-8
l_max_its = 100
start_time = 0.0
num_steps = 10
[]
[Outputs]
[out]
type = Exodus
[]
[]