- execute_onTIMESTEP_ENDThe list of flag(s) indicating when this object should be executed, the available options include NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM, ALWAYS.
Default:TIMESTEP_END
C++ Type:ExecFlagEnum
Controllable:No
Description:The list of flag(s) indicating when this object should be executed, the available options include NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM, ALWAYS.
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- valuesList of postprocessors to add
C++ Type:std::vector<PostprocessorName>
Controllable:No
Description:List of postprocessors to add
SumPostprocessor
The SumPostprocessor has not been documented. The content contained on this page includes the typical automatic documentation associated with a MooseObject; however, what is contained is ultimately determined by what is necessary to make the documentation clear for users.
Input Parameters
- allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
Default:False
C++ Type:bool
Controllable:No
Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- force_postauxFalseForces the UserObject to be executed in POSTAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in POSTAUX
- force_preauxFalseForces the UserObject to be executed in PREAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREAUX
- force_preicFalseForces the UserObject to be executed in PREIC during initial setup
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREIC during initial setup
- outputsVector of output names were you would like to restrict the output of variables(s) associated with this object
C++ Type:std::vector<OutputName>
Controllable:No
Description:Vector of output names were you would like to restrict the output of variables(s) associated with this 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
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_1phase/phy.conservation_1phase.i)
- (modules/thermal_hydraulics/test/tests/components/junction_parallel_channels_1phase/phy.shower.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_3d/phy.conservation_ss.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/shaft_connected_compressor_1phase/shaft_motor_compressor.i)
- (modules/thermal_hydraulics/test/tests/components/shaft_connected_pump_1phase/shaft_motor_pump.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_3d/jac.1phase.i)
- (modules/thermal_hydraulics/test/tests/components/volume_junction_1phase/t_junction_1phase.i)
- (modules/thermal_hydraulics/test/tests/components/junction_parallel_channels_1phase/conservation.i)
- (modules/thermal_hydraulics/test/tests/components/shaft_connected_turbine_1phase/shaft_motor_turbine.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/heat_transfer_from_heat_structure_3d/phy.conservation.i)
- (modules/thermal_hydraulics/test/tests/components/volume_junction_1phase/phy.shower.i)
- (modules/thermal_hydraulics/test/tests/components/shaft_connected_pump_1phase/pump_coastdown.i)
- (modules/thermal_hydraulics/test/tests/components/free_boundary_1phase/phy.conservation_free_boundary_1phase.i)
- (modules/thermal_hydraulics/test/tests/components/pump_1phase/pump_mass_energy_conservation.i)
References
No citations exist within this document.(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
[]
[Modules/FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[HeatStructureMaterials]
[main-material]
type = SolidMaterialProperties
k = 1e4
cp = 500.0
rho = 100.0
[]
[]
[Functions]
[T0_fn]
type = ParsedFunction
value = '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'
materials = 'main-material'
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/thermal_hydraulics/test/tests/components/junction_parallel_channels_1phase/phy.shower.i)
# This problem models a "shower": water from two pipes, one hot and one cold,
# mixes together to produce a temperature between the two.
[GlobalParams]
gravity_vector = '0 0 0'
initial_T = 300
initial_p = 1e5
initial_vel = 1
initial_vel_x = 1
initial_vel_y = 0
initial_vel_z = 0
# global parameters for pipes
fp = eos
orientation = '1 0 0'
length = 1
n_elems = 20
f = 0
scaling_factor_1phase = '1 1 1e-6'
closures = simple_closures
[]
[Modules/FluidProperties]
[eos]
type = IdealGasFluidProperties
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[inlet_hot]
type = InletDensityVelocity1Phase
input = 'pipe_hot:in'
# rho @ (p = 1e5, T = 310 K)
rho = 1315.9279785683
vel = 1
[]
[inlet_cold]
type = InletDensityVelocity1Phase
input = 'pipe_cold:in'
# rho @ (p = 1e5, T = 280 K)
rho = 1456.9202619863
vel = 1
[]
[outlet]
type = Outlet1Phase
input = 'pipe_warm:out'
p = 1e5
[]
[pipe_hot]
type = FlowChannel1Phase
position = '0 1 0'
A = 1
[]
[pipe_cold]
type = FlowChannel1Phase
position = '0 0 0'
A = 1
[]
[pipe_warm]
type = FlowChannel1Phase
position = '1 0.5 0'
A = 2
initial_vel = 0.5
[]
[junction]
type = JunctionParallelChannels1Phase
connections = 'pipe_cold:out pipe_hot:out pipe_warm:in'
position = '1 0.5 0'
volume = 1e-8
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-5
nl_max_its = 10
l_tol = 1e-2
l_max_its = 10
start_time = 0
end_time = 5
dt = 0.05
abort_on_solve_fail = true
[]
[Postprocessors]
# These post-processors are used to test that the energy flux on
# the warm side of the junction is equal to the sum of the energy
# fluxes of the hot and cold inlets to the junction.
[energy_flux_hot]
type = EnergyFluxIntegral
boundary = pipe_hot:out
arhouA = rhouA
H = H
[]
[energy_flux_cold]
type = EnergyFluxIntegral
boundary = pipe_cold:out
arhouA = rhouA
H = H
[]
[energy_flux_warm]
type = EnergyFluxIntegral
boundary = pipe_warm:in
arhouA = rhouA
H = H
[]
[energy_flux_inlet_sum]
type = SumPostprocessor
values = 'energy_flux_hot energy_flux_cold'
[]
[test_rel_err]
type = RelativeDifferencePostprocessor
value1 = energy_flux_warm
value2 = energy_flux_inlet_sum
[]
[]
[Outputs]
[out]
type = CSV
show = test_rel_err
sync_only = true
sync_times = '3 4 5'
[]
[]
(modules/thermal_hydraulics/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'
[]
[]
[Modules/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/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
[]
[Modules/FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[HeatStructureMaterials]
[fuel-mat]
type = SolidMaterialProperties
k = 3.7
cp = 3.e2
rho = 10.42e3
[]
[gap-mat]
type = SolidMaterialProperties
k = 0.7
cp = 5e3
rho = 1.0
[]
[clad-mat]
type = SolidMaterialProperties
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'
materials = 'fuel-mat gap-mat clad-mat'
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/shaft_connected_compressor_1phase/shaft_motor_compressor.i)
area = 0.2359
dt = 1.e-3
[GlobalParams]
initial_p = 1e5
initial_T = 288
initial_vel = 60
initial_vel_x = 60
initial_vel_y = 0
initial_vel_z = 0
A = ${area}
A_ref = ${area}
f = 100
scaling_factor_1phase = '0.04 0.04 0.04e-5'
closures = simple_closures
fp = fp
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[compressor]
type = ShaftConnectedCompressor1Phase
inlet = 'pipe:out'
outlet = 'pipe:in'
position = '0 0 0'
scaling_factor_rhoEV = 1e-5
volume = ${fparse area*0.45}
inertia_coeff = '1 1 1 1'
inertia_const = 1.61397
speed_cr_I = 1e12
speed_cr_fr = 0
tau_fr_coeff = '0 0 0 0'
tau_fr_const = 0
omega_rated = 200
mdot_rated = 21.74
rho0_rated = 1.1812
c0_rated = 340
speeds = '0.0 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 2'
Rp_functions = 'Rp00 Rp04 Rp05 Rp06 Rp07 Rp08 Rp09 Rp10 Rp11 Rp11'
eff_functions = 'eff00 eff04 eff05 eff06 eff07 eff08 eff09 eff10 eff11 eff11'
[]
[pipe]
type = FlowChannel1Phase
position = '0.1 0 0'
orientation = '1 0 0'
length = 10
n_elems = 20
[]
[motor]
type = ShaftConnectedMotor
inertia = 1e2
torque = 100
[]
[shaft]
type = Shaft
connected_components = 'motor compressor'
initial_speed = 100
[]
[]
[Functions]
[Rp00]
type = PiecewiseLinear
x = '0 0.3736 0.4216'
y = '1 0.9701 0.9619'
[]
[eff00]
type = PiecewiseLinear
x = '0 0.3736 0.4216'
y = '0.001 0.8941 0.6641'
[]
[Rp04]
type = PiecewiseLinear
x = '0.3736 0.3745 0.3753 0.3762 0.3770 0.3919 0.4067 0.4216 0.4826'
y = '1.0789 1.0779 1.0771 1.0759 1.0749 1.0570 1.0388 1.0204 0.9450'
[]
[eff04]
type = PiecewiseLinear
x = '0.3736 0.3745 0.3753 0.3762 0.3770 0.3919 0.4067 0.4216 0.4826'
y = '0.8941 0.8929 0.8925 0.8915 0.8901 0.8601 0.7986 0.6641 0.1115'
[]
[Rp05]
type = PiecewiseLinear
x = '0.3736 0.4026 0.4106 0.4186 0.4266 0.4346 0.4426 0.4506 0.4586 0.4666 0.4746 0.4826 0.5941'
y = '1.2898 1.2442 1.2316 1.2189 1.2066 1.1930 1.1804 1.1677 1.1542 1.1413 1.1279 1.1150 0.9357'
[]
[eff05]
type = PiecewiseLinear
x = '0.3736 0.4026 0.4106 0.4186 0.4266 0.4346 0.4426 0.4506 0.4586 0.4666 0.4746 0.4826 0.5941'
y = '0.9281 0.9263 0.9258 0.9244 0.9226 0.9211 0.9195 0.9162 0.9116 0.9062 0.8995 0.8914 0.7793'
[]
[Rp06]
type = PiecewiseLinear
x = '0.4026 0.4613 0.4723 0.4834 0.4945 0.5055 0.5166 0.5277 0.5387 0.5609 0.5719 0.583 0.5941 0.7124'
y = '1.5533 1.4438 1.4232 1.4011 1.3793 1.3589 1.3354 1.3100 1.2867 1.2376 1.2131 1.1887 1.1636 0.896'
[]
[eff06]
type = PiecewiseLinear
x = '0.4026 0.4613 0.4723 0.4834 0.4945 0.5055 0.5166 0.5277 0.5387 0.5609 0.5719 0.583 0.5941 0.7124'
y = '0.9148 0.9255 0.9275 0.9277 0.9282 0.9295 0.9290 0.9269 0.9242 0.9146 0.9080 0.900 0.8920 0.8061'
[]
[Rp07]
type = PiecewiseLinear
x = '0.4613 0.5447 0.5587 0.5726 0.5866 0.6006 0.6145 0.6285 0.6425 0.6565 0.6704 0.6844 0.6984 0.7124 0.8358'
y = '1.8740 1.6857 1.6541 1.6168 1.5811 1.5430 1.5067 1.4684 1.4292 1.3891 1.3479 1.3061 1.2628 1.2208 0.8498'
[]
[eff07]
type = PiecewiseLinear
x = '0.4613 0.5447 0.5587 0.5726 0.5866 0.6006 0.6145 0.6285 0.6425 0.6565 0.6704 0.6844 0.6984 0.7124 0.8358'
y = '0.9004 0.9232 0.9270 0.9294 0.9298 0.9312 0.9310 0.9290 0.9264 0.9225 0.9191 0.9128 0.9030 0.8904 0.7789'
[]
[Rp08]
type = PiecewiseLinear
x = '0.5447 0.6638 0.6810 0.6982 0.7154 0.7326 0.7498 0.7670 0.7842 0.8014 0.8186 0.8358 0.9702'
y = '2.3005 1.9270 1.8732 1.8195 1.7600 1.7010 1.6357 1.5697 1.5019 1.4327 1.3638 1.2925 0.7347'
[]
[eff08]
type = PiecewiseLinear
x = '0.5447 0.6638 0.6810 0.6982 0.7154 0.7326 0.7498 0.7670 0.7842 0.8014 0.8186 0.8358 0.9702'
y = '0.9102 0.9276 0.9301 0.9313 0.9319 0.9318 0.9293 0.9256 0.9231 0.9153 0.9040 0.8933 0.8098'
[]
[Rp09]
type = PiecewiseLinear
x = '0.6638 0.7762 0.7938 0.8115 0.8291 0.8467 0.8644 0.8820 0.8997 0.9173 0.9349 0.9526 0.9702 1.1107 1.25120'
y = '2.6895 2.2892 2.2263 2.1611 2.0887 2.0061 1.9211 1.8302 1.7409 1.6482 1.5593 1.4612 1.3586 0.5422 -0.2742'
[]
[eff09]
type = PiecewiseLinear
x = '0.6638 0.7762 0.7938 0.8115 0.8291 0.8467 0.8644 0.8820 0.8997 0.9173 0.9349 0.9526 0.9702 1.1107 1.2512'
y = '0.8961 0.9243 0.9288 0.9323 0.9330 0.9325 0.9319 0.9284 0.9254 0.9215 0.9134 0.9051 0.8864 0.7380 0.5896'
[]
[Rp10]
type = PiecewiseLinear
x = '0.7762 0.9255 0.9284 0.9461 0.9546 0.9816 0.9968 1.0170 1.039 1.0525 1.0812 1.0880 1.1056 1.1107 1.2511'
y = '3.3162 2.6391 2.6261 2.5425 2.5000 2.3469 2.2521 2.1211 1.974 1.8806 1.6701 1.6169 1.4710 1.4257 0.1817'
[]
[eff10]
type = PiecewiseLinear
x = '0.7762 0.9255 0.9284 0.9461 0.9546 0.9816 0.9968 1.0170 1.0390 1.0525 1.0812 1.0880 1.1056 1.1107 1.2511'
y = '0.8991 0.9276 0.9281 0.9308 0.9317 0.9329 0.9318 0.9291 0.9252 0.9223 0.9116 0.9072 0.8913 0.8844 0.6937'
[]
[Rp11]
type = PiecewiseLinear
x = '0.9255 1.0749 1.134 1.2511'
y = '3.9586 2.9889 2.605 1.4928'
[]
[eff11]
type = PiecewiseLinear
x = '0.9255 1.0749 1.1340 1.2511'
y = '0.9257 0.9308 0.9328 0.8823'
[]
[S_energy_fcn]
type = ParsedFunction
value = '-(tau_isen+tau_diss)*omega'
vars = 'tau_isen tau_diss omega'
vals = 'compressor:isentropic_torque compressor:dissipation_torque shaft:omega'
[]
[energy_conservation_fcn]
type = ParsedFunction
value = '(E_change - S_energy * dt) / E_tot'
vars = 'E_change S_energy dt E_tot'
vals = 'E_change S_energy ${dt} E_tot'
[]
[]
[Postprocessors]
# mass conservation
[mass_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoA
block = 'pipe'
execute_on = 'initial timestep_end'
[]
[mass_compressor]
type = ScalarVariable
variable = compressor:rhoV
execute_on = 'initial timestep_end'
[]
[mass_tot]
type = SumPostprocessor
values = 'mass_pipes mass_compressor'
execute_on = 'initial timestep_end'
[]
[mass_conservation]
type = ChangeOverTimePostprocessor
postprocessor = mass_tot
change_with_respect_to_initial = true
compute_relative_change = true
execute_on = 'initial timestep_end'
[]
# energy conservation
[E_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoEA
block = 'pipe'
execute_on = 'initial timestep_end'
[]
[E_compressor]
type = ScalarVariable
variable = compressor:rhoEV
execute_on = 'initial timestep_end'
[]
[E_tot]
type = LinearCombinationPostprocessor
pp_coefs = '1 1'
pp_names = 'E_pipes E_compressor'
execute_on = 'initial timestep_end'
[]
[S_energy]
type = FunctionValuePostprocessor
function = S_energy_fcn
execute_on = 'initial timestep_end'
[]
[E_change]
type = ChangeOverTimePostprocessor
postprocessor = E_tot
execute_on = 'initial timestep_end'
[]
# This should also execute on initial. This value is
# lagged by one timestep as a workaround to moose issue #13262.
[energy_conservation]
type = FunctionValuePostprocessor
function = energy_conservation_fcn
execute_on = 'timestep_end'
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'implicit-euler'
dt = ${dt}
num_steps = 6
solve_type = 'NEWTON'
line_search = 'basic'
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-6
nl_max_its = 15
l_tol = 1e-4
l_max_its = 10
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Outputs]
velocity_as_vector = false
[]
(modules/thermal_hydraulics/test/tests/components/shaft_connected_pump_1phase/shaft_motor_pump.i)
# Pump data used in this test comes from the Semiscale Program, summarized in NUREG/CR-4945
initial_T = 393.15
area = 1e-2
dt = 1.e-2
[GlobalParams]
initial_p = 1.4E+07
initial_T = ${initial_T}
initial_vel = 10
initial_vel_x = 10
initial_vel_y = 0
initial_vel_z = 0
A = ${area}
A_ref = ${area}
f = 100
scaling_factor_1phase = '0.04 0.04 0.04e-5'
closures = simple_closures
fp = fp
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pump]
type = ShaftConnectedPump1Phase
inlet = 'pipe:out'
outlet = 'pipe:in'
position = '0 0 0'
scaling_factor_rhoEV = 1e-5
volume = 0.3
inertia_coeff = '1 1 1 1'
inertia_const = 1.61397
omega_rated = 314
speed_cr_I = 1e12
speed_cr_fr = 0
torque_rated = 47.1825
volumetric_rated = 1
head_rated = 58.52
tau_fr_coeff = '0 0 9.084 0'
tau_fr_const = 0
head = head_fcn
torque_hydraulic = torque_fcn
density_rated = 124.2046
[]
[pipe]
type = FlowChannel1Phase
position = '0.6096 0 0'
orientation = '1 0 0'
length = 10
n_elems = 20
[]
[motor]
type = ShaftConnectedMotor
inertia = 2
torque = 47
[]
[shaft]
type = Shaft
connected_components = 'motor pump'
initial_speed = 30
[]
[]
[Functions]
[head_fcn]
type = PiecewiseLinear
data_file = semiscale_head_data.csv
format = columns
[]
[torque_fcn]
type = PiecewiseLinear
data_file = semiscale_torque_data.csv
format = columns
[]
[S_energy_fcn]
type = ParsedFunction
value = '-tau_hyd * omega'
vars = 'tau_hyd omega'
vals = 'pump:hydraulic_torque shaft:omega'
[]
[energy_conservation_fcn]
type = ParsedFunction
value = '(E_change - S_energy * dt) / E_tot'
vars = 'E_change S_energy dt E_tot'
vals = 'E_change S_energy ${dt} E_tot'
[]
[]
[Postprocessors]
# mass conservation
[mass_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoA
block = 'pipe'
execute_on = 'initial timestep_end'
[]
[mass_pump]
type = ScalarVariable
variable = pump:rhoV
execute_on = 'initial timestep_end'
[]
[mass_tot]
type = SumPostprocessor
values = 'mass_pipes mass_pump'
execute_on = 'initial timestep_end'
[]
[mass_conservation]
type = ChangeOverTimePostprocessor
postprocessor = mass_tot
change_with_respect_to_initial = true
compute_relative_change = true
execute_on = 'initial timestep_end'
[]
# energy conservation
[E_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoEA
block = 'pipe'
execute_on = 'initial timestep_end'
[]
[E_pump]
type = ScalarVariable
variable = pump:rhoEV
execute_on = 'initial timestep_end'
[]
[E_tot]
type = LinearCombinationPostprocessor
pp_coefs = '1 1'
pp_names = 'E_pipes E_pump'
execute_on = 'initial timestep_end'
[]
[S_energy]
type = FunctionValuePostprocessor
function = S_energy_fcn
execute_on = 'initial timestep_end'
[]
[E_change]
type = ChangeOverTimePostprocessor
postprocessor = E_tot
execute_on = 'initial timestep_end'
[]
# This should also execute on initial. This value is
# lagged by one timestep as a workaround to moose issue #13262.
[energy_conservation]
type = FunctionValuePostprocessor
function = energy_conservation_fcn
execute_on = 'timestep_end'
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'implicit-euler'
dt = ${dt}
num_steps = 6
solve_type = 'NEWTON'
line_search = 'basic'
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-6
nl_max_its = 15
l_tol = 1e-4
l_max_its = 10
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Outputs]
velocity_as_vector = false
[]
(modules/thermal_hydraulics/test/tests/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'
[]
[]
[Modules/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
value = '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/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
[]
[Modules/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
[]
[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 = 'PJFNK'
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]
# mass conservation
[mass_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoA
block = 'pipe1 pipe2 pipe3'
execute_on = 'initial timestep_end'
[]
[mass_junction]
type = ScalarVariable
variable = junction:rhoV
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 = ScalarVariable
variable = junction:rhoEV
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/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'
closures = simple_closures
[]
[Modules/FluidProperties]
[eos]
type = StiffenedGasFluidProperties
gamma = 1.4
cv = 725
p_inf = 0
q = 0
q_prime = 0
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[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'
scaling_factor_rhouV = 1e-4
scaling_factor_rhoEV = 1e-5
position = '1 0 0'
volume = 1e-2
[]
[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'
scaling_factor_rhouV = 1e-4
scaling_factor_rhoEV = 1e-5
position = '1 0 0'
volume = 1e-2
[]
[]
[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-6
nl_max_its = 20
l_tol = 1e-3
l_max_its = 20
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Postprocessors]
# mass conservation
[mass_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoA
block = 'pipe1 pipe2'
execute_on = 'initial timestep_end'
[]
[mass_junction1]
type = ScalarVariable
variable = junction1:rhoV
execute_on = 'initial timestep_end'
[]
[mass_junction2]
type = ScalarVariable
variable = junction2:rhoV
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 = ScalarVariable
variable = junction1:rhoEV
execute_on = 'initial timestep_end'
[]
[E_junction2]
type = ScalarVariable
variable = junction2:rhoEV
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'
[]
[]
[Outputs]
[out]
type = CSV
show = 'mass_tot_change E_tot_change'
[]
[]
(modules/thermal_hydraulics/test/tests/components/shaft_connected_turbine_1phase/shaft_motor_turbine.i)
area = 0.2359
dt = 1.e-3
[GlobalParams]
initial_p = 2e5
initial_T = 600
initial_vel = 100
initial_vel_x = 100
initial_vel_y = 0
initial_vel_z = 0
A = ${area}
A_ref = ${area}
f = 100
scaling_factor_1phase = '0.04 0.04 0.04e-5'
closures = simple_closures
fp = fp
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[turbine]
type = ShaftConnectedTurbine1Phase
inlet = 'pipe:out'
outlet = 'pipe:in'
position = '0 0 0'
volume = 0.2
inertia_coeff = '1 1 1 1'
inertia_const = 1.61397
speed_cr_I = 1e12
speed_cr_fr = 0
tau_fr_coeff = '0 0 0 0'
tau_fr_const = 0
omega_rated = 100
D_wheel = 0.4
head_coefficient = head
power_coefficient = power
[]
[pipe]
type = FlowChannel1Phase
position = '0.1 0 0'
orientation = '1 0 0'
length = 10
n_elems = 20
initial_p = 2e6
[]
[dyno]
type = ShaftConnectedMotor
inertia = 1e2
torque = -1e3
[]
[shaft]
type = Shaft
connected_components = 'dyno turbine'
initial_speed = 300
[]
[]
[Functions]
[head]
type = PiecewiseLinear
x = '0 7e-3 1e-2'
y = '0 15 20'
[]
[power]
type = PiecewiseLinear
x = '0 6e-3 1e-2'
y = '0 0.05 0.18'
[]
[S_energy_fcn]
type = ParsedFunction
value = '-(tau_driving+tau_fr)*omega'
vars = 'tau_driving tau_fr omega'
vals = 'turbine:driving_torque turbine:friction_torque shaft:omega'
[]
[energy_conservation_fcn]
type = ParsedFunction
value = '(E_change - S_energy * dt) / E_tot'
vars = 'E_change S_energy dt E_tot'
vals = 'E_change S_energy ${dt} E_tot'
[]
[]
[Postprocessors]
# mass conservation
[mass_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoA
block = 'pipe'
execute_on = 'initial timestep_end'
[]
[mass_turbine]
type = ScalarVariable
variable = turbine:rhoV
execute_on = 'initial timestep_end'
[]
[mass_tot]
type = SumPostprocessor
values = 'mass_pipes mass_turbine'
execute_on = 'initial timestep_end'
[]
[mass_conservation]
type = ChangeOverTimePostprocessor
postprocessor = mass_tot
change_with_respect_to_initial = true
compute_relative_change = true
execute_on = 'initial timestep_end'
[]
# energy conservation
[E_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoEA
block = 'pipe'
execute_on = 'initial timestep_end'
[]
[E_turbine]
type = ScalarVariable
variable = turbine:rhoEV
execute_on = 'initial timestep_end'
[]
[E_tot]
type = LinearCombinationPostprocessor
pp_coefs = '1 1'
pp_names = 'E_pipes E_turbine'
execute_on = 'initial timestep_end'
[]
[S_energy]
type = FunctionValuePostprocessor
function = S_energy_fcn
execute_on = 'initial timestep_end'
[]
[E_change]
type = ChangeOverTimePostprocessor
postprocessor = E_tot
execute_on = 'initial timestep_end'
[]
# This should also execute on initial. This value is
# lagged by one timestep as a workaround to moose issue #13262.
[energy_conservation]
type = FunctionValuePostprocessor
function = energy_conservation_fcn
execute_on = 'timestep_end'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'implicit-euler'
dt = ${dt}
num_steps = 6
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-6
nl_max_its = 15
l_tol = 1e-4
l_max_its = 10
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Outputs]
velocity_as_vector = false
[]
(modules/thermal_hydraulics/test/tests/components/heat_transfer_from_heat_structure_3d/err.not_a_3d_hs.i)
[GlobalParams]
scaling_factor_1phase = '1 1 1e-3'
[]
[Materials]
[mat]
type = ADGenericConstantMaterial
block = 'blk:0'
prop_names = 'density specific_heat thermal_conductivity'
prop_values = '1000 100 30'
[]
[]
[Modules/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
value = '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
materials = 'mat'
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
[]
[Outputs]
exodus = true
[]
(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'
[]
[]
[Modules/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
value = '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/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
[]
[Modules/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
[]
[]
[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/components/shaft_connected_pump_1phase/pump_coastdown.i)
# Pump data used in this test comes from the Semiscale Program, summarized in NUREG/CR-4945
initial_T = 393.15
area = 1e-2
dt = 0.005
[GlobalParams]
initial_p = 1.4E+07
initial_T = ${initial_T}
initial_vel = 0.01
initial_vel_x = 0.01
initial_vel_y = 0
initial_vel_z = 0
A = ${area}
A_ref = ${area}
f = 100
scaling_factor_1phase = '1 1 1e-3'
closures = simple_closures
rdg_slope_reconstruction = minmod
fp = fp
[]
[Modules/FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pump]
type = ShaftConnectedPump1Phase
inlet = 'pipe:out'
outlet = 'pipe:in'
position = '0 0 0'
scaling_factor_rhoEV = 1e-5
volume = 0.3
inertia_coeff = '1 1 1 1'
inertia_const = 0.5
omega_rated = 314
speed_cr_I = 1e12
speed_cr_fr = 0.001
torque_rated = 47.1825
volumetric_rated = 1
head_rated = 58.52
tau_fr_coeff = '4 0 80 0'
tau_fr_const = 8
head = head_fcn
torque_hydraulic = torque_fcn
density_rated = 124.2046
[]
[pipe]
type = FlowChannel1Phase
position = '0.6096 0 0'
orientation = '1 0 0'
length = 10
n_elems = 20
[]
[shaft]
type = Shaft
connected_components = 'pump'
initial_speed = 1
[]
[]
[Functions]
[head_fcn]
type = PiecewiseLinear
data_file = semiscale_head_data.csv
format = columns
[]
[torque_fcn]
type = PiecewiseLinear
data_file = semiscale_torque_data.csv
format = columns
[]
[S_energy_fcn]
type = ParsedFunction
value = '-tau_hyd * omega'
vars = 'tau_hyd omega'
vals = 'pump:hydraulic_torque shaft:omega'
[]
[energy_conservation_fcn]
type = ParsedFunction
value = '(E_change - S_energy * dt) / E_tot'
vars = 'E_change S_energy dt E_tot'
vals = 'E_change S_energy ${dt} E_tot'
[]
[]
[Postprocessors]
# mass conservation
[mass_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoA
block = 'pipe'
execute_on = 'initial timestep_end'
[]
[mass_pump]
type = ScalarVariable
variable = pump:rhoV
execute_on = 'initial timestep_end'
[]
[mass_tot]
type = SumPostprocessor
values = 'mass_pipes mass_pump'
execute_on = 'initial timestep_end'
[]
[mass_conservation]
type = ChangeOverTimePostprocessor
postprocessor = mass_tot
change_with_respect_to_initial = true
compute_relative_change = true
execute_on = 'initial timestep_end'
[]
# energy conservation
[E_pipes]
type = ElementIntegralVariablePostprocessor
variable = rhoEA
block = 'pipe'
execute_on = 'initial timestep_end'
[]
[E_pump]
type = ScalarVariable
variable = pump:rhoEV
execute_on = 'initial timestep_end'
[]
[E_tot]
type = LinearCombinationPostprocessor
pp_coefs = '1 1'
pp_names = 'E_pipes E_pump'
execute_on = 'initial timestep_end'
[]
[S_energy]
type = FunctionValuePostprocessor
function = S_energy_fcn
execute_on = 'initial timestep_end'
[]
[E_change]
type = ChangeOverTimePostprocessor
postprocessor = E_tot
execute_on = 'initial timestep_end'
[]
# This should also execute on initial. This value is
# lagged by one timestep as a workaround to moose issue #13262.
[energy_conservation]
type = FunctionValuePostprocessor
function = energy_conservation_fcn
execute_on = 'timestep_end'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
dt = ${dt}
num_steps = 40
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 15
l_tol = 1e-4
l_max_its = 10
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Outputs]
velocity_as_vector = false
exodus = true
[]
(modules/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
value = '300 + 10 * (cos(2*pi*x + pi))'
[]
[]
[Modules/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
[]
[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/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}
[]
[Modules/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
[]
[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
[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 = ScalarVariable
variable = pump:rhoV
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 = ScalarVariable
variable = pump:rhoEV
execute_on = 'initial timestep_end'
[]
[E_tot]
type = LinearCombinationPostprocessor
pp_coefs = '1 1'
pp_names = 'E_pipes E_pump'
execute_on = 'initial timestep_end'
[]
[S_energy]
type = FunctionValuePostprocessor
function = S_energy_fcn
execute_on = 'initial timestep_end'
[]
[E_change]
type = ChangeOverTimePostprocessor
postprocessor = E_tot
execute_on = 'initial timestep_end'
[]
# this should also execute on initial, this value is
# lagged by one timestep as a workaround to moose issue #13262
[E_conservation]
type = FunctionValuePostprocessor
function = E_conservation_fcn
execute_on = 'timestep_end'
[]
[]
[Functions]
[S_energy_fcn]
type = ParsedFunction
value = 'rhouV * g * head * A / volume'
vars = 'rhouV g head A volume'
vals = 'pump:rhouV ${g} ${head} ${A} ${volume}'
[]
[E_conservation_fcn]
type = ParsedFunction
value = '(E_change - S_energy * dt) / E_tot'
vars = 'E_change S_energy dt E_tot'
vals = 'E_change S_energy ${dt} E_tot'
[]
[]
[Outputs]
[out]
type = CSV
execute_on = 'FINAL'
show = 'mass_tot_change E_conservation'
[]
[]