- componentThe name of the component to be controlled.
C++ Type:std::string
Controllable:No
Description:The name of the component to be controlled.
- parameterThe name of the parameter in the component to be controlled.
C++ Type:std::string
Controllable:No
Description:The name of the parameter in the component to be controlled.
RealComponentParameterValuePostprocessor
The RealComponentParameterValuePostprocessor 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
- 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
Options:NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM, TRANSFER, ALWAYS
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.
Optional 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/shaft_connected_motor/clg.test.i)
- (modules/thermal_hydraulics/test/tests/components/inlet_stagnation_p_t_1phase/clg.ctrl_p0_3eqn.i)
- (modules/thermal_hydraulics/test/tests/components/inlet_mass_flow_rate_1phase/clg.ctrl_T_3eqn_rdg.i)
- (modules/thermal_hydraulics/test/tests/controls/dependency/test.i)
- (modules/thermal_hydraulics/test/tests/problems/brayton_cycle/closed_brayton_cycle.i)
- (modules/thermal_hydraulics/test/tests/components/pump_1phase/clg.head.i)
- (modules/thermal_hydraulics/test/tests/components/inlet_stagnation_p_t_1phase/clg.ctrl_T0_3eqn.i)
- (modules/thermal_hydraulics/test/tests/components/outlet_1phase/clg.ctrl_p_3eqn.i)
- (modules/thermal_hydraulics/test/tests/controls/set_component_real_value_control/test.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_specified_temperature_1phase/clg.Hw.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/clg.velocity_t_3eqn.i)
- (modules/thermal_hydraulics/test/tests/postprocessors/real_component_parameter_value/non_existent_par_name.i)
- (modules/thermal_hydraulics/test/tests/components/total_power/clg.power.i)
- (modules/thermal_hydraulics/test/tests/components/total_power/phy.constant_power.i)
- (modules/thermal_hydraulics/test/tests/components/heat_transfer_from_specified_temperature_1phase/clg.T_wall.i)
- (modules/thermal_hydraulics/test/tests/problems/brayton_cycle/open_brayton_cycle.i)
- (modules/thermal_hydraulics/test/tests/components/inlet_mass_flow_rate_1phase/clg.ctrl_m_dot_3eqn_rdg.i)
References
No citations exist within this document.(modules/thermal_hydraulics/test/tests/components/shaft_connected_motor/clg.test.i)
[Functions]
[torque_fn]
type = PiecewiseLinear
xy_data = '
0 2
1 3'
[]
[inertia_fn]
type = PiecewiseLinear
xy_data = '
0 1
1 2'
[]
[]
[HeatStructureMaterials]
[mat]
type = SolidMaterialProperties
rho = 1
cp = 1
k = 1
[]
[]
[Components]
[motor]
type = ShaftConnectedMotor
inertia = 1
torque = 2
[]
[shaft]
type = Shaft
connected_components = 'motor'
initial_speed = 0
[]
[hs]
type = HeatStructureCylindrical
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 1
names = '0'
n_part_elems = 1
widths = '1'
materials = 'mat'
initial_T = 300
[]
[]
[ControlLogic]
[motor_ctrl]
type = TimeFunctionComponentControl
component = motor
[]
[]
[Postprocessors]
[test]
type = RealComponentParameterValuePostprocessor
component = motor
execute_on = 'initial timestep_end'
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
num_steps = 5
dt = 0.2
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
[]
[Outputs]
csv = true
show = 'test'
[]
(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
[]
[Modules/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
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Outputs]
csv = true
[]
(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
[]
[Modules/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
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[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
[]
[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]
[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/problems/brayton_cycle/closed_brayton_cycle.i)
# This input file is used to demonstrate a simple closed, air Brayton cycle using
# a compressor, turbine, shaft, motor, and generator.
# The flow length is divided into 6 segments as illustrated below, where
# - "(C)" denotes the compressor
# - "(T)" denotes the turbine
# - "*" denotes a fictitious junction
#
# Heated section Cooled section
# *-----(C)-----*--------------*-----(T)-----*--------------*
# 1 2 3 4 5 6
#
# Initially the fluid is at rest at ambient conditions, the shaft speed is zero,
# and no heat transfer occurs with the system.
# The transient is controlled as follows:
# * 0 - 100 s: motor ramps up torque linearly from zero
# * 100 - 200 s: motor ramps down torque linearly to zero, HTC ramps up linearly from zero.
# * 200 - 300 s: (no changes; should approach steady condition)
I_motor = 1.0
motor_torque_max = 400.0
I_generator = 1.0
generator_torque_per_shaft_speed = -0.00025
motor_ramp_up_duration = 100.0
motor_ramp_down_duration = 100.0
post_motor_time = 100.0
t1 = ${motor_ramp_up_duration}
t2 = ${fparse t1 + motor_ramp_down_duration}
t3 = ${fparse t2 + post_motor_time}
D1 = 0.15
D2 = ${D1}
D3 = ${D1}
D4 = ${D1}
D5 = ${D1}
D6 = ${D1}
A1 = ${fparse 0.25 * pi * D1^2}
A2 = ${fparse 0.25 * pi * D2^2}
A3 = ${fparse 0.25 * pi * D3^2}
A4 = ${fparse 0.25 * pi * D4^2}
A5 = ${fparse 0.25 * pi * D5^2}
A6 = ${fparse 0.25 * pi * D6^2}
L1 = 10.0
L2 = ${L1}
L3 = ${L1}
L4 = ${L1}
L5 = ${L1}
L6 = ${L1}
x1 = 0.0
x2 = ${fparse x1 + L1}
x3 = ${fparse x2 + L2}
x4 = ${fparse x3 + L3}
x5 = ${fparse x4 + L4}
x6 = ${fparse x5 + L5}
x2_minus = ${fparse x2 - 0.001}
x2_plus = ${fparse x2 + 0.001}
x5_minus = ${fparse x5 - 0.001}
x5_plus = ${fparse x5 + 0.001}
n_elems1 = 10
n_elems2 = ${n_elems1}
n_elems3 = ${n_elems1}
n_elems4 = ${n_elems1}
n_elems5 = ${n_elems1}
n_elems6 = ${n_elems1}
A_ref_comp = ${fparse 0.5 * (A1 + A2)}
V_comp = ${fparse A_ref_comp * 1.0}
I_comp = 1.0
A_ref_turb = ${fparse 0.5 * (A4 + A5)}
V_turb = ${fparse A_ref_turb * 1.0}
I_turb = 1.0
c0_rated_comp = 351.6925137
rho0_rated_comp = 1.146881112
rated_mfr = 0.25
speed_rated_rpm = 96000
speed_rated = ${fparse speed_rated_rpm * 2 * pi / 60.0}
speed_initial = 0
eff_comp = 0.79
eff_turb = 0.843
T_hot = 1000
T_cold = 300
T_ambient = 300
p_ambient = 1e5
[GlobalParams]
orientation = '1 0 0'
gravity_vector = '0 0 0'
initial_p = ${p_ambient}
initial_T = ${T_ambient}
initial_vel = 0
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
fp = fp_air
closures = closures
f = 0
scaling_factor_1phase = '1 1 1e-5'
scaling_factor_rhoV = 1
scaling_factor_rhouV = 1
scaling_factor_rhovV = 1
scaling_factor_rhowV = 1
scaling_factor_rhoEV = 1e-5
rdg_slope_reconstruction = none
[]
[Functions]
[motor_torque_fn]
type = PiecewiseLinear
x = '0 ${t1} ${t2}'
y = '0 ${motor_torque_max} 0'
[]
[motor_power_fn]
type = ParsedFunction
value = 'torque * speed'
vars = 'torque speed'
vals = 'motor_torque shaft:omega'
[]
[generator_torque_fn]
type = ParsedFunction
value = 'slope * t'
vars = 'slope'
vals = '${generator_torque_per_shaft_speed}'
[]
[generator_power_fn]
type = ParsedFunction
value = 'torque * speed'
vars = 'torque speed'
vals = 'generator_torque shaft:omega'
[]
[htc_wall_fn]
type = PiecewiseLinear
x = '0 ${t1} ${t2}'
y = '0 0 1e3'
[]
[]
[Modules/FluidProperties]
[fp_air]
type = IdealGasFluidProperties
emit_on_nan = none
[]
[]
[Closures]
[closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[shaft]
type = Shaft
connected_components = 'motor compressor turbine generator'
initial_speed = ${speed_initial}
[]
[motor]
type = ShaftConnectedMotor
inertia = ${I_motor}
torque = 0 # controlled
[]
[generator]
type = ShaftConnectedMotor
inertia = ${I_generator}
torque = generator_torque_fn
[]
[pipe1]
type = FlowChannel1Phase
position = '${x1} 0 0'
length = ${L1}
n_elems = ${n_elems1}
A = ${A1}
[]
[compressor]
type = ShaftConnectedCompressor1Phase
position = '${x2} 0 0'
inlet = 'pipe1:out'
outlet = 'pipe2:in'
A_ref = ${A_ref_comp}
volume = ${V_comp}
omega_rated = ${speed_rated}
mdot_rated = ${rated_mfr}
c0_rated = ${c0_rated_comp}
rho0_rated = ${rho0_rated_comp}
speeds = '0.5208 0.6250 0.7292 0.8333 0.9375'
Rp_functions = 'rp_comp1 rp_comp2 rp_comp3 rp_comp4 rp_comp5'
eff_functions = 'eff_comp1 eff_comp2 eff_comp3 eff_comp4 eff_comp5'
min_pressure_ratio = 1.0
speed_cr_I = 0
inertia_const = ${I_comp}
inertia_coeff = '${I_comp} 0 0 0'
# assume no shaft friction
speed_cr_fr = 0
tau_fr_const = 0
tau_fr_coeff = '0 0 0 0'
[]
[pipe2]
type = FlowChannel1Phase
position = '${x2} 0 0'
length = ${L2}
n_elems = ${n_elems2}
A = ${A2}
[]
[junction2_3]
type = JunctionOneToOne1Phase
connections = 'pipe2:out pipe3:in'
[]
[pipe3]
type = FlowChannel1Phase
position = '${x3} 0 0'
length = ${L3}
n_elems = ${n_elems3}
A = ${A3}
[]
[junction3_4]
type = JunctionOneToOne1Phase
connections = 'pipe3:out pipe4:in'
[]
[pipe4]
type = FlowChannel1Phase
position = '${x4} 0 0'
length = ${L4}
n_elems = ${n_elems4}
A = ${A4}
[]
[turbine]
type = ShaftConnectedCompressor1Phase
position = '${x5} 0 0'
inlet = 'pipe4:out'
outlet = 'pipe5:in'
A_ref = ${A_ref_turb}
volume = ${V_turb}
treat_as_turbine = true
omega_rated = ${speed_rated}
mdot_rated = ${rated_mfr}
c0_rated = ${c0_rated_comp}
rho0_rated = ${rho0_rated_comp}
speeds = '0 0.5208 0.6250 0.7292 0.8333 0.9375'
Rp_functions = 'rp_turb0 rp_turb1 rp_turb2 rp_turb3 rp_turb4 rp_turb5'
eff_functions = 'eff_turb1 eff_turb1 eff_turb2 eff_turb3 eff_turb4 eff_turb5'
min_pressure_ratio = 1.0
speed_cr_I = 0
inertia_const = ${I_turb}
inertia_coeff = '${I_turb} 0 0 0'
# assume no shaft friction
speed_cr_fr = 0
tau_fr_const = 0
tau_fr_coeff = '0 0 0 0'
[]
[pipe5]
type = FlowChannel1Phase
position = '${x5} 0 0'
length = ${L5}
n_elems = ${n_elems5}
A = ${A5}
[]
[junction5_6]
type = JunctionOneToOne1Phase
connections = 'pipe5:out pipe6:in'
[]
[pipe6]
type = FlowChannel1Phase
position = '${x6} 0 0'
length = ${L6}
n_elems = ${n_elems6}
A = ${A6}
[]
[junction6_1]
type = JunctionOneToOne1Phase
connections = 'pipe6:out pipe1:in'
[]
[heating]
type = HeatTransferFromSpecifiedTemperature1Phase
flow_channel = pipe3
T_wall = ${T_hot}
Hw = htc_wall_fn
[]
[cooling]
type = HeatTransferFromSpecifiedTemperature1Phase
flow_channel = pipe6
T_wall = ${T_cold}
Hw = htc_wall_fn
[]
[]
[ControlLogic]
[motor_ctrl]
type = TimeFunctionComponentControl
component = motor
parameter = torque
function = motor_torque_fn
[]
[]
[Postprocessors]
[heating_rate]
type = ADHeatRateConvection1Phase
block = 'pipe3'
T = T
T_wall = T_wall
Hw = Hw
P_hf = P_hf
execute_on = 'INITIAL TIMESTEP_END'
[]
[cooling_rate]
type = ADHeatRateConvection1Phase
block = 'pipe6'
T = T
T_wall = T_wall
Hw = Hw
P_hf = P_hf
execute_on = 'INITIAL TIMESTEP_END'
[]
[motor_torque]
type = RealComponentParameterValuePostprocessor
component = motor
parameter = torque
execute_on = 'INITIAL TIMESTEP_END'
[]
[motor_power]
type = FunctionValuePostprocessor
function = motor_power_fn
execute_on = 'INITIAL TIMESTEP_END'
[]
[generator_torque]
type = ShaftConnectedComponentPostprocessor
quantity = torque
shaft_connected_component_uo = generator:shaftconnected_uo
execute_on = 'INITIAL TIMESTEP_END'
[]
[generator_power]
type = FunctionValuePostprocessor
function = generator_power_fn
execute_on = 'INITIAL TIMESTEP_END'
[]
[shaft_speed]
type = ScalarVariable
variable = 'shaft:omega'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_in_comp]
type = PointValue
variable = p
point = '${x2_minus} 0 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_out_comp]
type = PointValue
variable = p
point = '${x2_plus} 0 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_ratio_comp]
type = ParsedPostprocessor
pp_names = 'p_in_comp p_out_comp'
function = 'p_out_comp / p_in_comp'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_in_turb]
type = PointValue
variable = p
point = '${x5_minus} 0 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_out_turb]
type = PointValue
variable = p
point = '${x5_plus} 0 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_ratio_turb]
type = ParsedPostprocessor
pp_names = 'p_in_turb p_out_turb'
function = 'p_in_turb / p_out_turb'
execute_on = 'INITIAL TIMESTEP_END'
[]
[mfr_comp]
type = ADFlowJunctionFlux1Phase
boundary = pipe1:out
connection_index = 0
equation = mass
junction = compressor
[]
[mfr_turb]
type = ADFlowJunctionFlux1Phase
boundary = pipe4:out
connection_index = 0
equation = mass
junction = turbine
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
end_time = ${t3}
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.01
optimal_iterations = 5
iteration_window = 1
growth_factor = 1.1
cutback_factor = 0.9
[]
dtmin = 1e-5
steady_state_detection = true
steady_state_start_time = ${t2}
solve_type = NEWTON
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 15
l_tol = 1e-4
l_max_its = 10
[]
[Outputs]
exodus = true
[csv]
type = CSV
file_base = 'closed_brayton_cycle'
execute_vector_postprocessors_on = 'INITIAL'
[]
[console]
type = Console
show = 'shaft_speed p_ratio_comp p_ratio_turb compressor:pressure_ratio turbine:pressure_ratio'
[]
[]
[Functions]
# compressor pressure ratio
[rp_comp1]
type = PiecewiseLinear
data_file = 'rp_comp1.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_comp2]
type = PiecewiseLinear
data_file = 'rp_comp2.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_comp3]
type = PiecewiseLinear
data_file = 'rp_comp3.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_comp4]
type = PiecewiseLinear
data_file = 'rp_comp4.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_comp5]
type = PiecewiseLinear
data_file = 'rp_comp5.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
# compressor efficiency
[eff_comp1]
type = ConstantFunction
value = ${eff_comp}
[]
[eff_comp2]
type = ConstantFunction
value = ${eff_comp}
[]
[eff_comp3]
type = ConstantFunction
value = ${eff_comp}
[]
[eff_comp4]
type = ConstantFunction
value = ${eff_comp}
[]
[eff_comp5]
type = ConstantFunction
value = ${eff_comp}
[]
# turbine pressure ratio
[rp_turb0]
type = ConstantFunction
value = 1
[]
[rp_turb1]
type = PiecewiseLinear
data_file = 'rp_turb1.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_turb2]
type = PiecewiseLinear
data_file = 'rp_turb2.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_turb3]
type = PiecewiseLinear
data_file = 'rp_turb3.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_turb4]
type = PiecewiseLinear
data_file = 'rp_turb4.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_turb5]
type = PiecewiseLinear
data_file = 'rp_turb5.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
# turbine efficiency
[eff_turb1]
type = ConstantFunction
value = ${eff_turb}
[]
[eff_turb2]
type = ConstantFunction
value = ${eff_turb}
[]
[eff_turb3]
type = ConstantFunction
value = ${eff_turb}
[]
[eff_turb4]
type = ConstantFunction
value = ${eff_turb}
[]
[eff_turb5]
type = ConstantFunction
value = ${eff_turb}
[]
[]
(modules/thermal_hydraulics/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
[]
[Modules/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
[]
[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/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
[]
[Modules/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
automatic_scaling = true
[]
[Outputs]
csv = true
[]
(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
[]
[Modules/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
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Outputs]
csv = true
[]
(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
[]
[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]
[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
start_time = 0.0
end_time = 1
[]
[Outputs]
csv = true
[]
(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
[]
[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]
[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/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
[]
[Modules/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 = 'PJFNK'
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/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
[]
[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]
[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/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
[]
[Modules/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
[]
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/components/total_power/clg.power.i)
[Functions]
[decayheatcurve]
type = PiecewiseLinear
x = '0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.5 2.0 3.0 4.0 5.0 6.0 8.0 10.0'
y = '1.0 .8382 .572 .3806 .2792 .2246 .1904 .1672 .1503 .1376 .1275 .1032 .09884
.09209 .0869 .08271 .07922 .07375 .06967'
[]
[dts]
type = PiecewiseLinear
# this matches the decay heat curve function
x = '0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.5 2.0 3.0 4.0 5.0 6.0 8.0 10.0'
y = '0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.5 0.5 1.0 1.0 1.0 1.0 2.0 2.0 2.0'
[]
[]
[HeatStructureMaterials]
[mat]
type = SolidMaterialProperties
k = 1
cp = 1
rho = 1
[]
[]
[Components]
[total_power]
type = TotalPower
power = 1.
[]
[ch1:solid]
type = HeatStructureCylindrical
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 1
initial_T = 300
names = '0'
widths = '1'
n_part_elems = '1'
materials = 'mat'
[]
[]
[ControlLogic]
[reactor_power_control]
type = TimeFunctionComponentControl
component = total_power
parameter = power
function = decayheatcurve
[]
[]
[Postprocessors]
[reactor_power]
type = RealComponentParameterValuePostprocessor
component = total_power
parameter = power
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
[TimeStepper]
type = FunctionDT
function = dts
[]
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 1e-12
nl_abs_tol = 1e-6
nl_max_its = 10
l_tol = 1e-3
l_max_its = 300
start_time = 0.0
end_time = 10
[]
[Outputs]
csv = true
show = 'reactor_power'
[]
(modules/thermal_hydraulics/test/tests/components/total_power/phy.constant_power.i)
[HeatStructureMaterials]
[mat]
type = SolidMaterialProperties
k = 1
cp = 1
rho = 1
[]
[]
[Components]
[total_power]
type = TotalPower
power = 1234.
[]
[ch1:solid]
type = HeatStructureCylindrical
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 1
initial_T = 300
names = '0'
widths = '1'
n_part_elems = '1'
materials = 'mat'
[]
[]
[Postprocessors]
[reactor_power]
type = RealComponentParameterValuePostprocessor
component = total_power
parameter = power
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
dt = 1
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 1e-12
nl_abs_tol = 1e-6
nl_max_its = 10
l_tol = 1e-3
l_max_its = 300
start_time = 0.0
end_time = 10
[]
[Outputs]
csv = true
show = 'reactor_power'
[]
(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
[]
[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]
[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/problems/brayton_cycle/open_brayton_cycle.i)
# This input file is used to demonstrate a simple open-air Brayton cycle using
# a compressor, turbine, shaft, motor, and generator.
# The flow length is divided into 5 segments as illustrated below, where
# - "(I)" denotes the inlet
# - "(C)" denotes the compressor
# - "(T)" denotes the turbine
# - "(O)" denotes the outlet
# - "*" denotes a fictitious junction
#
# Heated section
# (I)-----(C)-----*--------------*-----(T)-----(O)
# 1 2 3 4 5
#
# Initially the fluid is at rest at ambient conditions, the shaft speed is zero,
# and no heat transfer occurs with the system.
# The transient is controlled as follows:
# * 0 - 100 s: motor ramps up torque linearly from zero
# * 100 - 200 s: motor ramps down torque linearly to zero, HTC ramps up linearly from zero.
# * 200 - 300 s: (no changes; should approach steady condition)
I_motor = 1.0
motor_torque_max = 400.0
I_generator = 1.0
generator_torque_per_shaft_speed = -0.00025
motor_ramp_up_duration = 100.0
motor_ramp_down_duration = 100.0
post_motor_time = 100.0
t1 = ${motor_ramp_up_duration}
t2 = ${fparse t1 + motor_ramp_down_duration}
t3 = ${fparse t2 + post_motor_time}
D1 = 0.15
D2 = ${D1}
D3 = ${D1}
D4 = ${D1}
D5 = ${D1}
A1 = ${fparse 0.25 * pi * D1^2}
A2 = ${fparse 0.25 * pi * D2^2}
A3 = ${fparse 0.25 * pi * D3^2}
A4 = ${fparse 0.25 * pi * D4^2}
A5 = ${fparse 0.25 * pi * D5^2}
L1 = 10.0
L2 = ${L1}
L3 = ${L1}
L4 = ${L1}
L5 = ${L1}
x1 = 0.0
x2 = ${fparse x1 + L1}
x3 = ${fparse x2 + L2}
x4 = ${fparse x3 + L3}
x5 = ${fparse x4 + L4}
x2_minus = ${fparse x2 - 0.001}
x2_plus = ${fparse x2 + 0.001}
x5_minus = ${fparse x5 - 0.001}
x5_plus = ${fparse x5 + 0.001}
n_elems1 = 10
n_elems2 = ${n_elems1}
n_elems3 = ${n_elems1}
n_elems4 = ${n_elems1}
n_elems5 = ${n_elems1}
A_ref_comp = ${fparse 0.5 * (A1 + A2)}
V_comp = ${fparse A_ref_comp * 1.0}
I_comp = 1.0
A_ref_turb = ${fparse 0.5 * (A4 + A5)}
V_turb = ${fparse A_ref_turb * 1.0}
I_turb = 1.0
c0_rated_comp = 351.6925137
rho0_rated_comp = 1.146881112
rated_mfr = 0.25
speed_rated_rpm = 96000
speed_rated = ${fparse speed_rated_rpm * 2 * pi / 60.0}
speed_initial = 0
eff_comp = 0.79
eff_turb = 0.843
T_hot = 1000
T_ambient = 300
p_ambient = 1e5
[GlobalParams]
orientation = '1 0 0'
gravity_vector = '0 0 0'
initial_p = ${p_ambient}
initial_T = ${T_ambient}
initial_vel = 0
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
fp = fp_air
closures = closures
f = 0
scaling_factor_1phase = '1 1 1e-5'
scaling_factor_rhoV = 1
scaling_factor_rhouV = 1
scaling_factor_rhovV = 1
scaling_factor_rhowV = 1
scaling_factor_rhoEV = 1e-5
rdg_slope_reconstruction = none
[]
[Functions]
[motor_torque_fn]
type = PiecewiseLinear
x = '0 ${t1} ${t2}'
y = '0 ${motor_torque_max} 0'
[]
[motor_power_fn]
type = ParsedFunction
value = 'torque * speed'
vars = 'torque speed'
vals = 'motor_torque shaft:omega'
[]
[generator_torque_fn]
type = ParsedFunction
value = 'slope * t'
vars = 'slope'
vals = '${generator_torque_per_shaft_speed}'
[]
[generator_power_fn]
type = ParsedFunction
value = 'torque * speed'
vars = 'torque speed'
vals = 'generator_torque shaft:omega'
[]
[htc_wall_fn]
type = PiecewiseLinear
x = '0 ${t1} ${t2}'
y = '0 0 1e3'
[]
[]
[Modules/FluidProperties]
[fp_air]
type = IdealGasFluidProperties
emit_on_nan = none
[]
[]
[Closures]
[closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[shaft]
type = Shaft
connected_components = 'motor compressor turbine generator'
initial_speed = ${speed_initial}
[]
[motor]
type = ShaftConnectedMotor
inertia = ${I_motor}
torque = 0 # controlled
[]
[generator]
type = ShaftConnectedMotor
inertia = ${I_generator}
torque = generator_torque_fn
[]
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe1:in'
p0 = ${p_ambient}
T0 = ${T_ambient}
[]
[pipe1]
type = FlowChannel1Phase
position = '${x1} 0 0'
length = ${L1}
n_elems = ${n_elems1}
A = ${A1}
[]
[compressor]
type = ShaftConnectedCompressor1Phase
position = '${x2} 0 0'
inlet = 'pipe1:out'
outlet = 'pipe2:in'
A_ref = ${A_ref_comp}
volume = ${V_comp}
omega_rated = ${speed_rated}
mdot_rated = ${rated_mfr}
c0_rated = ${c0_rated_comp}
rho0_rated = ${rho0_rated_comp}
speeds = '0.5208 0.6250 0.7292 0.8333 0.9375'
Rp_functions = 'rp_comp1 rp_comp2 rp_comp3 rp_comp4 rp_comp5'
eff_functions = 'eff_comp1 eff_comp2 eff_comp3 eff_comp4 eff_comp5'
min_pressure_ratio = 1.0
speed_cr_I = 0
inertia_const = ${I_comp}
inertia_coeff = '${I_comp} 0 0 0'
# assume no shaft friction
speed_cr_fr = 0
tau_fr_const = 0
tau_fr_coeff = '0 0 0 0'
[]
[pipe2]
type = FlowChannel1Phase
position = '${x2} 0 0'
length = ${L2}
n_elems = ${n_elems2}
A = ${A2}
[]
[junction2_3]
type = JunctionOneToOne1Phase
connections = 'pipe2:out pipe3:in'
[]
[pipe3]
type = FlowChannel1Phase
position = '${x3} 0 0'
length = ${L3}
n_elems = ${n_elems3}
A = ${A3}
[]
[junction3_4]
type = JunctionOneToOne1Phase
connections = 'pipe3:out pipe4:in'
[]
[pipe4]
type = FlowChannel1Phase
position = '${x4} 0 0'
length = ${L4}
n_elems = ${n_elems4}
A = ${A4}
[]
[turbine]
type = ShaftConnectedCompressor1Phase
position = '${x5} 0 0'
inlet = 'pipe4:out'
outlet = 'pipe5:in'
A_ref = ${A_ref_turb}
volume = ${V_turb}
treat_as_turbine = true
omega_rated = ${speed_rated}
mdot_rated = ${rated_mfr}
c0_rated = ${c0_rated_comp}
rho0_rated = ${rho0_rated_comp}
speeds = '0 0.5208 0.6250 0.7292 0.8333 0.9375'
Rp_functions = 'rp_turb0 rp_turb1 rp_turb2 rp_turb3 rp_turb4 rp_turb5'
eff_functions = 'eff_turb1 eff_turb1 eff_turb2 eff_turb3 eff_turb4 eff_turb5'
min_pressure_ratio = 1.0
speed_cr_I = 0
inertia_const = ${I_turb}
inertia_coeff = '${I_turb} 0 0 0'
# assume no shaft friction
speed_cr_fr = 0
tau_fr_const = 0
tau_fr_coeff = '0 0 0 0'
[]
[pipe5]
type = FlowChannel1Phase
position = '${x5} 0 0'
length = ${L5}
n_elems = ${n_elems5}
A = ${A5}
[]
[outlet]
type = Outlet1Phase
input = 'pipe5:out'
p = ${p_ambient}
[]
[heating]
type = HeatTransferFromSpecifiedTemperature1Phase
flow_channel = pipe3
T_wall = ${T_hot}
Hw = htc_wall_fn
[]
[]
[ControlLogic]
[motor_ctrl]
type = TimeFunctionComponentControl
component = motor
parameter = torque
function = motor_torque_fn
[]
[]
[Postprocessors]
[heating_rate]
type = ADHeatRateConvection1Phase
block = 'pipe3'
T = T
T_wall = T_wall
Hw = Hw
P_hf = P_hf
execute_on = 'INITIAL TIMESTEP_END'
[]
[motor_torque]
type = RealComponentParameterValuePostprocessor
component = motor
parameter = torque
execute_on = 'INITIAL TIMESTEP_END'
[]
[motor_power]
type = FunctionValuePostprocessor
function = motor_power_fn
execute_on = 'INITIAL TIMESTEP_END'
[]
[generator_torque]
type = ShaftConnectedComponentPostprocessor
quantity = torque
shaft_connected_component_uo = generator:shaftconnected_uo
execute_on = 'INITIAL TIMESTEP_END'
[]
[generator_power]
type = FunctionValuePostprocessor
function = generator_power_fn
execute_on = 'INITIAL TIMESTEP_END'
[]
[shaft_speed]
type = ScalarVariable
variable = 'shaft:omega'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_in_comp]
type = PointValue
variable = p
point = '${x2_minus} 0 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_out_comp]
type = PointValue
variable = p
point = '${x2_plus} 0 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_ratio_comp]
type = ParsedPostprocessor
pp_names = 'p_in_comp p_out_comp'
function = 'p_out_comp / p_in_comp'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_in_turb]
type = PointValue
variable = p
point = '${x5_minus} 0 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_out_turb]
type = PointValue
variable = p
point = '${x5_plus} 0 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_ratio_turb]
type = ParsedPostprocessor
pp_names = 'p_in_turb p_out_turb'
function = 'p_in_turb / p_out_turb'
execute_on = 'INITIAL TIMESTEP_END'
[]
[mfr_comp]
type = ADFlowJunctionFlux1Phase
boundary = pipe1:out
connection_index = 0
equation = mass
junction = compressor
[]
[mfr_turb]
type = ADFlowJunctionFlux1Phase
boundary = pipe4:out
connection_index = 0
equation = mass
junction = turbine
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
end_time = ${t3}
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.01
optimal_iterations = 5
iteration_window = 1
growth_factor = 1.1
cutback_factor = 0.9
[]
dtmin = 1e-5
steady_state_detection = true
steady_state_start_time = ${t2}
solve_type = NEWTON
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 15
l_tol = 1e-4
l_max_its = 10
[]
[Outputs]
exodus = true
[csv]
type = CSV
file_base = 'open_brayton_cycle'
execute_vector_postprocessors_on = 'INITIAL'
[]
[console]
type = Console
show = 'shaft_speed p_ratio_comp p_ratio_turb compressor:pressure_ratio turbine:pressure_ratio'
[]
[]
[Functions]
# compressor pressure ratio
[rp_comp1]
type = PiecewiseLinear
data_file = 'rp_comp1.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_comp2]
type = PiecewiseLinear
data_file = 'rp_comp2.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_comp3]
type = PiecewiseLinear
data_file = 'rp_comp3.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_comp4]
type = PiecewiseLinear
data_file = 'rp_comp4.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_comp5]
type = PiecewiseLinear
data_file = 'rp_comp5.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
# compressor efficiency
[eff_comp1]
type = ConstantFunction
value = ${eff_comp}
[]
[eff_comp2]
type = ConstantFunction
value = ${eff_comp}
[]
[eff_comp3]
type = ConstantFunction
value = ${eff_comp}
[]
[eff_comp4]
type = ConstantFunction
value = ${eff_comp}
[]
[eff_comp5]
type = ConstantFunction
value = ${eff_comp}
[]
# turbine pressure ratio
[rp_turb0]
type = ConstantFunction
value = 1
[]
[rp_turb1]
type = PiecewiseLinear
data_file = 'rp_turb1.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_turb2]
type = PiecewiseLinear
data_file = 'rp_turb2.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_turb3]
type = PiecewiseLinear
data_file = 'rp_turb3.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_turb4]
type = PiecewiseLinear
data_file = 'rp_turb4.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_turb5]
type = PiecewiseLinear
data_file = 'rp_turb5.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
# turbine efficiency
[eff_turb1]
type = ConstantFunction
value = ${eff_turb}
[]
[eff_turb2]
type = ConstantFunction
value = ${eff_turb}
[]
[eff_turb3]
type = ConstantFunction
value = ${eff_turb}
[]
[eff_turb4]
type = ConstantFunction
value = ${eff_turb}
[]
[eff_turb5]
type = ConstantFunction
value = ${eff_turb}
[]
[]
(modules/thermal_hydraulics/test/tests/components/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
[]
[Modules/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
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Outputs]
csv = true
[]