- variableThe name of the variable that this residual object operates on
C++ Type:NonlinearVariableName
Controllable:No
Description:The name of the variable that this residual object operates on
HeatSource
The HeatSource has not been documented. The content listed below should be used as a starting point for documenting the class, which 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.
Demonstrates the multiple ways that scalar values can be introduced into kernels, e.g. (controllable) constants, functions, and postprocessors. Implements the weak form .
Overview
Example Input File Syntax
Input Parameters
- blockThe list of blocks (ids or names) that this object will be applied
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:The list of blocks (ids or names) that this object will be applied
- displacementsThe displacements
C++ Type:std::vector<VariableName>
Controllable:No
Description:The displacements
- function1Function describing the volumetric heat source
Default:1
C++ Type:FunctionName
Controllable:No
Description:Function describing the volumetric heat source
- postprocessor1A postprocessor whose value is multiplied by the body force
Default:1
C++ Type:PostprocessorName
Controllable:No
Description:A postprocessor whose value is multiplied by the body force
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
- value1Value of heat source. Multiplied by function if present.
Default:1
C++ Type:double
Controllable:Yes
Description:Value of heat source. Multiplied by function if present.
Optional Parameters
- absolute_value_vector_tagsThe tags for the vectors this residual object should fill with the absolute value of the residual contribution
C++ Type:std::vector<TagName>
Controllable:No
Description:The tags for the vectors this residual object should fill with the absolute value of the residual contribution
- extra_matrix_tagsThe extra tags for the matrices this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the matrices this Kernel should fill
- extra_vector_tagsThe extra tags for the vectors this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the vectors this Kernel should fill
- matrix_tagssystemThe tag for the matrices this Kernel should fill
Default:system
C++ Type:MultiMooseEnum
Options:nontime, system
Controllable:No
Description:The tag for the matrices this Kernel should fill
- vector_tagsnontimeThe tag for the vectors this Kernel should fill
Default:nontime
C++ Type:MultiMooseEnum
Options:nontime, time
Controllable:No
Description:The tag for the vectors this Kernel should fill
Tagging Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- diag_save_inThe name of auxiliary variables to save this Kernel's diagonal Jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
C++ Type:std::vector<AuxVariableName>
Controllable:No
Description:The name of auxiliary variables to save this Kernel's diagonal Jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- implicitTrueDetermines whether this object is calculated using an implicit or explicit form
Default:True
C++ Type:bool
Controllable:No
Description:Determines whether this object is calculated using an implicit or explicit form
- save_inThe name of auxiliary variables to save this Kernel's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
C++ Type:std::vector<AuxVariableName>
Controllable:No
Description:The name of auxiliary variables to save this Kernel's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
Input Files
- (modules/combined/tutorials/introduction/thermal_mechanical/thermomech_step01.i)
- (modules/heat_transfer/test/tests/code_verification/cylindrical_test_no5.i)
- (modules/heat_transfer/test/tests/code_verification/cylindrical_test_no3.i)
- (modules/heat_transfer/test/tests/meshed_gap_thermal_contact/meshed_annulus_thermal_contact.i)
- (modules/combined/test/tests/adaptive_timestepping/adapt_tstep_function_change_restart2.i)
- (modules/combined/examples/optimization/thermomechanical/thermal_sub.i)
- (modules/heat_transfer/test/tests/code_verification/spherical_test_no5.i)
- (modules/heat_transfer/test/tests/code_verification/cartesian_test_no5.i)
- (modules/misc/test/tests/dynamic_loading/dynamic_obj_registration/dynamic_objects2.i)
- (modules/heat_transfer/test/tests/code_verification/cartesian_test_no3.i)
- (modules/heat_transfer/test/tests/conjugate_heat_transfer/conjugate_heat_transfer.i)
- (tutorials/tutorial03_verification/app/test/tests/step04_mms/2d_mms_spatial.i)
- (modules/combined/test/tests/adaptive_timestepping/adapt_tstep_function_force_step.i)
- (modules/heat_transfer/test/tests/code_verification/cartesian_test_no1.i)
- (modules/combined/test/tests/adaptive_timestepping/adapt_tstep_function_change.i)
- (modules/heat_transfer/test/tests/code_verification/spherical_test_no4.i)
- (modules/combined/test/tests/optimization/thermal_sensitivity/2d_root.i)
- (tutorials/tutorial03_verification/app/test/tests/step04_mms/2d_mms_temporal.i)
- (modules/heat_transfer/test/tests/code_verification/cylindrical_test_no4.i)
- (modules/combined/test/tests/adaptive_timestepping/adapt_tstep_function_change_restart1.i)
- (modules/heat_transfer/tutorials/introduction/therm_step03a.i)
- (modules/heat_transfer/test/tests/heat_source_bar/heat_source_bar.i)
- (modules/heat_transfer/test/tests/code_verification/cartesian_test_no4.i)
- (modules/heat_transfer/test/tests/code_verification/spherical_test_no3.i)
- (modules/combined/test/tests/optimization/compliance_sensitivity/three_materials_thermal.i)
- (tutorials/tutorial03_verification/app/test/tests/step04_mms/2d_main.i)
- (modules/combined/test/tests/optimization/compliance_sensitivity/thermal_test.i)
(modules/combined/tutorials/introduction/thermal_mechanical/thermomech_step01.i)
#
# Single block coupled thermal/mechanical
# https://mooseframework.inl.gov/modules/combined/tutorials/introduction/thermoech_step01.html
#
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[generated]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmax = 2
ymax = 1
[]
[pin]
type = ExtraNodesetGenerator
input = generated
new_boundary = pin
coord = '0 0 0'
[]
[]
[Variables]
[T]
initial_condition = 300.0
[]
[]
[Kernels]
[heat_conduction]
type = HeatConduction
variable = T
[]
[time_derivative]
type = HeatConductionTimeDerivative
variable = T
[]
[heat_source]
type = HeatSource
variable = T
value = 5e4
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
add_variables = true
strain = FINITE
automatic_eigenstrain_names = true
generate_output = 'vonmises_stress'
[]
[]
[Materials]
[thermal]
type = HeatConductionMaterial
thermal_conductivity = 45.0
specific_heat = 0.5
[]
[density]
type = GenericConstantMaterial
prop_names = 'density'
prop_values = 8000.0
[]
[elasticity]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e9
poissons_ratio = 0.3
[]
[expansion1]
type = ComputeThermalExpansionEigenstrain
temperature = T
thermal_expansion_coeff = 0.001
stress_free_temperature = 300
eigenstrain_name = thermal_expansion
[]
[stress]
type = ComputeFiniteStrainElasticStress
[]
[]
[BCs]
[t_left]
type = DirichletBC
variable = T
value = 300
boundary = 'left'
[]
[t_right]
type = FunctionDirichletBC
variable = T
function = '300+5*t'
boundary = 'right'
[]
[pin_x]
type = DirichletBC
variable = disp_x
boundary = pin
value = 0
[]
[bottom_y]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
end_time = 5
dt = 1
[]
[Outputs]
exodus = true
[]
(modules/heat_transfer/test/tests/code_verification/cylindrical_test_no5.i)
# Problem II.5
#
# The volumetric heat generation in an infinitely long solid cylinder
# varies with spatial location. It has a constant thermal conductivity.
#
# REFERENCE:
# A. Toptan, et al. (Mar.2020). Tech. rep. CASL-U-2020-1939-000, SAND2020-3887 R. DOI:10.2172/1614683.
[Mesh]
[./geom]
type = GeneratedMeshGenerator
dim = 1
elem_type = EDGE2
nx = 1
[../]
[]
[Variables]
[./u]
order = FIRST
[../]
[]
[Problem]
coord_type = RZ
[]
[Functions]
[./volumetric_heat]
type = ParsedFunction
symbol_names = 'q ro beta'
symbol_values = '1200 1 0.1'
expression = 'q * (1-beta*x/ro)'
[../]
[./exact]
type = ParsedFunction
symbol_names = 'uo q k ro beta'
symbol_values = '300 1200 1 1 0.1'
expression = 'uo + (0.25*q*ro^2/k) * ( (1-(x/ro)^2) - (1-(x/ro)^3) * beta * 4/9 )'
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = u
[../]
[./heatsource]
type = HeatSource
function = volumetric_heat
variable = u
[../]
[]
[BCs]
[./uo]
type = DirichletBC
boundary = right
variable = u
value = 300
[../]
[]
[Materials]
[./property]
type = GenericConstantMaterial
prop_names = 'density specific_heat thermal_conductivity'
prop_values = '1.0 1.0 1.0'
[../]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[./error]
type = ElementL2Error
function = exact
variable = u
[../]
[./h]
type = AverageElementSize
[]
[]
[Outputs]
csv = true
[]
(modules/heat_transfer/test/tests/code_verification/cylindrical_test_no3.i)
# Problem II.3
#
# The thermal conductivity of an infinitely long hollow cylinder varies
# linearly with temperature: k = k0(1+beta*u). The tube inside radius is ri and
# outside radius is ro. It has a constant internal heat generation q and
# is exposed to the same constant temperature on both surfaces: u(ri) = u(ro) = uo.
#
# REFERENCE:
# A. Toptan, et al. (Mar.2020). Tech. rep. CASL-U-2020-1939-000, SAND2020-3887 R. DOI:10.2172/1614683.
[Mesh]
[./geom]
type = GeneratedMeshGenerator
dim = 1
elem_type = EDGE2
xmin = 0.2
nx = 4
[../]
[]
[Variables]
[./u]
order = FIRST
[../]
[]
[Problem]
coord_type = RZ
[]
[Functions]
[./exact]
type = ParsedFunction
symbol_names = 'q k0 ri ro beta u0'
symbol_values = '1200 1 0.2 1.0 1e-3 0'
expression = 'u0+(1/beta)*( ( 1 + 0.5*beta*((ro^2-x^2)-(ro^2-ri^2) * log(ro/x)/log(ro/ri))*q/k0 )^0.5 - 1)'
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = u
[../]
[./heatsource]
type = HeatSource
function = 1200
variable = u
[../]
[]
[BCs]
[./uo]
type = DirichletBC
boundary = 'left right'
variable = u
value = 0
[../]
[]
[Materials]
[./property]
type = GenericConstantMaterial
prop_names = 'density specific_heat'
prop_values = '1.0 1.0'
[../]
[./thermal_conductivity]
type = ParsedMaterial
property_name = 'thermal_conductivity'
coupled_variables = u
expression = '1 * (1 + 1e-3*u)'
[../]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[./error]
type = ElementL2Error
function = exact
variable = u
[../]
[./h]
type = AverageElementSize
[]
[]
[Outputs]
csv = true
[]
(modules/heat_transfer/test/tests/meshed_gap_thermal_contact/meshed_annulus_thermal_contact.i)
[Mesh]
[fmesh]
type = FileMeshGenerator
file = meshed_annulus.e
[]
[rename]
type = RenameBlockGenerator
input = fmesh
old_block = '1 2 3'
new_block = '1 4 3'
[]
[]
[Variables]
[./temp]
block = '1 3'
initial_condition = 1.0
[../]
[]
[Kernels]
[./hc]
type = HeatConduction
variable = temp
block = '1 3'
[../]
[./source]
type = HeatSource
variable = temp
block = 3
value = 10.0
[../]
[]
[BCs]
[./outside]
type = DirichletBC
variable = temp
boundary = 1
value = 1.0
[../]
[]
[ThermalContact]
[./gap_conductivity]
type = GapHeatTransfer
variable = temp
primary = 2
secondary = 3
emissivity_primary = 0
emissivity_secondary = 0
gap_conductivity = 0.5
[../]
[]
[Materials]
[./hcm]
type = HeatConductionMaterial
block = '1 3'
temp = temp
thermal_conductivity = 1
[../]
[]
[Problem]
type = FEProblem
kernel_coverage_check = false
material_coverage_check = false
[]
[Executioner]
type = Steady
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[./out]
type = Exodus
[../]
[]
(modules/combined/test/tests/adaptive_timestepping/adapt_tstep_function_change_restart2.i)
# This is a test designed to evaluate the cabability of the
# IterationAdaptiveDT TimeStepper to adjust time step size according to
# a function. For example, if the power input function for a BISON
# simulation rapidly increases or decreases, the IterationAdaptiveDT
# TimeStepper should take time steps small enough to capture the
# oscillation.
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
order = FIRST
family = LAGRANGE
block = 1
[]
[Mesh]
file = 1hex8_10mm_cube.e
[]
[Functions]
[./Fiss_Function]
type = PiecewiseLinear
x = '0 1e6 2e6 2.001e6 2.002e6'
y = '0 3e8 3e8 12e8 0'
[../]
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[./temp]
[../]
[]
[Modules/TensorMechanics/Master]
[./all]
strain = FINITE
volumetric_locking_correction = true
incremental = true
eigenstrain_names = thermal_expansion
decomposition_method = EigenSolution
add_variables = true
generate_output = 'vonmises_stress'
temperature = temp
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = temp
[../]
[./heat_ie]
type = HeatConductionTimeDerivative
variable = temp
[../]
[./heat_source]
type = HeatSource
variable = temp
value = 1.0
function = Fiss_Function
[../]
[]
[BCs]
[./bottom_temp]
type = DirichletBC
variable = temp
boundary = 1
value = 300
[../]
[./top_bottom_disp_x]
type = DirichletBC
variable = disp_x
boundary = '1'
value = 0
[../]
[./top_bottom_disp_y]
type = DirichletBC
variable = disp_y
boundary = '1'
value = 0
[../]
[./top_bottom_disp_z]
type = DirichletBC
variable = disp_z
boundary = '1'
value = 0
[../]
[]
[Materials]
[./thermal]
type = HeatConductionMaterial
temp = temp
specific_heat = 1.0
thermal_conductivity = 1.0
[../]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 300e6
poissons_ratio = .3
[../]
[./stress]
type = ComputeFiniteStrainElasticStress
[../]
[./thermal_expansion]
type = ComputeThermalExpansionEigenstrain
thermal_expansion_coeff = 5e-6
stress_free_temperature = 300.0
temperature = temp
eigenstrain_name = thermal_expansion
[../]
[./density]
type = Density
density = 10963.0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
verbose = true
nl_abs_tol = 1e-10
num_steps = 50000
end_time = 2.002e6
[./TimeStepper]
type = IterationAdaptiveDT
timestep_limiting_function = Fiss_Function
max_function_change = 3e7
dt = 1e6
[../]
[]
[Postprocessors]
[./Temperature_of_Block]
type = ElementAverageValue
variable = temp
execute_on = 'timestep_end'
[../]
[./vonMises]
type = ElementAverageValue
variable = vonmises_stress
execute_on = 'timestep_end'
[../]
[]
[Outputs]
[./out]
type = Exodus
elemental_as_nodal = true
[../]
[./console]
type = Console
max_rows = 10
[../]
[]
[Problem]
restart_file_base = adapt_tstep_function_change_restart1_checkpoint_cp/0065
[]
(modules/combined/examples/optimization/thermomechanical/thermal_sub.i)
vol_frac = 0.4
power = 2.0
E0 = 1.0e-6
E1 = 1.0
rho0 = 0.0
rho1 = 1.0
C0 = 1.0e-6
C1 = 1.0
TC0 = 1.0e-16
TC1 = 1.0
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 2
nx = 40
ny = 40
xmin = 0
xmax = 40
ymin = 0
ymax = 40
[]
[node]
type = ExtraNodesetGenerator
input = MeshGenerator
new_boundary = hold
nodes = 0
[]
[push_left]
type = ExtraNodesetGenerator
input = node
new_boundary = push_left
coord = '16 0 0'
[]
[push_center]
type = ExtraNodesetGenerator
input = push_left
new_boundary = push_center
coord = '24 0 0'
[]
[extra]
type = SideSetsFromBoundingBoxGenerator
input = push_center
bottom_left = '-0.01 17.999 0'
top_right = '5 22.001 0'
boundary_new = n1
boundaries_old = left
[]
[dirichlet_bc]
type = SideSetsFromNodeSetsGenerator
input = extra
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[temp]
initial_condition = 100.0
[]
[]
[AuxVariables]
[Dc]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[Cc]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[Tc]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[Cost]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = FIRST
initial_condition = ${vol_frac}
[]
[]
[AuxKernels]
[Cost]
type = MaterialRealAux
variable = Cost
property = Cost_mat
[]
[]
[Kernels]
[heat_conduction]
type = HeatConduction
variable = temp
diffusion_coefficient = thermal_cond
[]
[heat_source]
type = HeatSource
value = 1e-2 # W/m^3
variable = temp
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = hold
value = 0.0
[]
[no_x_symm]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[]
[left_n1]
type = DirichletBC
variable = temp
boundary = n1
value = 0.0
[]
[top]
type = NeumannBC
variable = temp
boundary = top
value = 0
[]
[bottom]
type = NeumannBC
variable = temp
boundary = bottom
value = 0
[]
[right]
type = NeumannBC
variable = temp
boundary = right
value = 0
[]
[left]
type = NeumannBC
variable = temp
boundary = left
value = 0
[]
[]
[NodalKernels]
[push_left]
type = NodalGravity
variable = disp_y
boundary = push_left
gravity_value = 0.0 # -1e-8
mass = 1
[]
[push_center]
type = NodalGravity
variable = disp_y
boundary = push_center
gravity_value = 0.0 # -1e-8
mass = 1
[]
[]
[Materials]
[thermal_cond]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${TC0}-${TC1})/(${rho0}^${power}-${rho1}^${power}); "
"B1:=${TC0}-A1*${rho0}^${power}; TC1:=A1*mat_den^${power}+B1; TC1"
coupled_variables = 'mat_den'
property_name = thermal_cond
outputs = 'exodus'
[]
[thermal_compliance]
type = ThermalCompliance
temperature = temp
thermal_conductivity = thermal_cond
outputs = 'exodus'
[]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${E0}-${E1})/(${rho0}^${power}-${rho1}^${power}); "
"B1:=${E0}-A1*${rho0}^${power}; E1:=A1*mat_den^${power}+B1; E1"
coupled_variables = 'mat_den'
property_name = E_phys
[]
[Cost_mat]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${C0}-${C1})/(${rho0}^(1/${power})-${rho1}^(1/${power})); "
"B1:=${C0}-A1*${rho0}^(1/${power}); C1:=A1*mat_den^(1/${power})+B1; C1"
coupled_variables = 'mat_den'
property_name = Cost_mat
[]
[CostDensity]
type = ParsedMaterial
property_name = CostDensity
coupled_variables = 'mat_den Cost'
expression = 'mat_den*Cost'
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
[]
[cc]
type = CostSensitivity
design_density = mat_den
cost = Cost_mat
outputs = 'exodus'
[]
[tc]
type = ThermalSensitivity
design_density = mat_den
thermal_conductivity = thermal_cond
temperature = temp
outputs = 'exodus'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[rad_avg]
type = RadialAverage
radius = 0.1
weights = linear
prop_name = sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[rad_avg_cost]
type = RadialAverage
radius = 0.1
weights = linear
prop_name = cost_sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[rad_avg_thermal]
type = RadialAverage
radius = 0.1
weights = linear
prop_name = thermal_sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
# Provides Dc
[calc_sense]
type = SensitivityFilter
density_sensitivity = Dc
design_density = mat_den
filter_UO = rad_avg
execute_on = TIMESTEP_END
force_postaux = true
[]
# Provides Cc
[calc_sense_cost]
type = SensitivityFilter
density_sensitivity = Cc
design_density = mat_den
filter_UO = rad_avg_cost
execute_on = TIMESTEP_END
force_postaux = true
[]
# Provides Tc
[calc_sense_thermal]
type = SensitivityFilter
density_sensitivity = Tc
design_density = mat_den
filter_UO = rad_avg_thermal
execute_on = TIMESTEP_END
force_postaux = true
[]
[]
[Executioner]
type = Transient
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-12
dt = 1.0
num_steps = 500
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[right_flux]
type = SideDiffusiveFluxAverage
variable = temp
boundary = right
diffusivity = 10
[]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
function = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
[]
[cost_sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = cost_sensitivity
[]
[cost]
type = ElementIntegralMaterialProperty
mat_prop = CostDensity
[]
[cost_frac]
type = ParsedPostprocessor
function = 'cost / mesh_volume'
pp_names = 'cost mesh_volume'
[]
[objective]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
[]
[objective_thermal]
type = ElementIntegralMaterialProperty
mat_prop = thermal_compliance
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
(modules/heat_transfer/test/tests/code_verification/spherical_test_no5.i)
# Problem III.5
#
# A solid sphere has a spatially dependent internal heating. It has a constant thermal
# conductivity. It is exposed to a constant temperature on its boundary.
#
# REFERENCE:
# A. Toptan, et al. (Mar.2020). Tech. rep. CASL-U-2020-1939-000, SAND2020-3887 R. DOI:10.2172/1614683.
[Mesh]
[./geom]
type = GeneratedMeshGenerator
dim = 1
elem_type = EDGE2
nx = 4
[../]
[]
[Variables]
[./u]
order = FIRST
[../]
[]
[Problem]
coord_type = RSPHERICAL
[]
[Functions]
[./volumetric_heat]
type = ParsedFunction
symbol_names = 'q ro beta'
symbol_values = '1200 1 0.1'
expression = 'q * (1-beta*(x/ro)^2)'
[../]
[./exact]
type = ParsedFunction
symbol_names = 'uf q k ro beta'
symbol_values = '300 1200 1 1 0.1'
expression = 'uf + (q*ro^2/(6*k)) * ( (1-(x/ro)^2) - 0.3*beta*(1-(x/ro)^4) )'
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = u
[../]
[./heatsource]
type = HeatSource
function = volumetric_heat
variable = u
[../]
[]
[BCs]
[./uo]
type = DirichletBC
boundary = 'right'
variable = u
value = 300
[../]
[]
[Materials]
[./property]
type = GenericConstantMaterial
prop_names = 'density specific_heat thermal_conductivity'
prop_values = '1.0 1.0 1.0'
[../]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[./error]
type = ElementL2Error
function = exact
variable = u
[../]
[./h]
type = AverageElementSize
[]
[]
[Outputs]
csv = true
[]
(modules/heat_transfer/test/tests/code_verification/cartesian_test_no5.i)
# Problem I.5
#
# The volumetric heat generation in an infinite plate varies linearly
# with spatial location. It has constant thermal conductivity.
# It is insulated on the left boundary and exposed to a
# constant temperature on the right.
#
# REFERENCE:
# A. Toptan, et al. (Mar.2020). Tech. rep. CASL-U-2020-1939-000, SAND2020-3887 R. DOI:10.2172/1614683.
[Mesh]
[./geom]
type = GeneratedMeshGenerator
dim = 1
elem_type = EDGE2
nx = 1
[../]
[]
[Variables]
[./u]
order = FIRST
[../]
[]
[Functions]
[./volumetric_heat]
type = ParsedFunction
symbol_names = 'q L beta'
symbol_values = '1200 1 0.1'
expression = 'q * (1-beta*x/L)'
[../]
[./exact]
type = ParsedFunction
symbol_names = 'uo q k L beta'
symbol_values = '300 1200 1 1 0.1'
expression = 'uo + (0.5*q*L^2/k) * ( (1-(x/L)^2) - (1-(x/L)^3) * beta/3 )'
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = u
[../]
[./heatsource]
type = HeatSource
function = volumetric_heat
variable = u
[../]
[]
[BCs]
[./uo]
type = DirichletBC
boundary = right
variable = u
value = 300
[../]
[]
[Materials]
[./property]
type = GenericConstantMaterial
prop_names = 'density specific_heat thermal_conductivity'
prop_values = '1.0 1.0 1.0'
[../]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[./error]
type = ElementL2Error
function = exact
variable = u
[../]
[./h]
type = AverageElementSize
[]
[]
[Outputs]
csv = true
[]
(modules/misc/test/tests/dynamic_loading/dynamic_obj_registration/dynamic_objects2.i)
# This input file contains some objects only available through heat_transfer
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 2
xmax = 50
ymax = 25
elem_type = QUAD4
uniform_refine = 2
[]
[Variables]
[c]
order = THIRD
family = HERMITE
[]
[]
[ICs]
[c_IC]
type = BoundingBoxIC
x1 = 15.0
x2 = 35.0
y1 = 0.0
y2 = 25.0
inside = 1.0
outside = -0.8
variable = c
[]
[]
[Kernels]
[ie_c]
type = TimeDerivative
variable = c
[]
[d]
type = Diffusion
variable = c
[]
[s]
type = HeatSource
variable = c
[]
[]
[BCs]
[Periodic]
[all]
auto_direction = 'x y'
[]
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart'
petsc_options_value = 'hypre boomeramg 31'
l_max_its = 15
nl_max_its = 10
start_time = 0.0
num_steps = 2
dt = 1.0
[]
[Problem]
register_objects_from = 'HeatTransferApp'
library_path = '../../../../../heat_transfer/lib'
[]
(modules/heat_transfer/test/tests/code_verification/cartesian_test_no3.i)
# Problem I.3
#
# The thermal conductivity of an infinite plate varies linearly with
# temperature: k = ko(1+beta*u). It has a constant internal heat generation q,
# and has the boundary conditions du/dx = 0 at x= L and u(L) = uo.
#
# REFERENCE:
# A. Toptan, et al. (Mar.2020). Tech. rep. CASL-U-2020-1939-000, SAND2020-3887 R. DOI:10.2172/1614683.
[Mesh]
[./geom]
type = GeneratedMeshGenerator
dim = 1
elem_type = EDGE2
nx = 4
[../]
[]
[Variables]
[./u]
order = FIRST
[../]
[]
[Functions]
[./exact]
type = ParsedFunction
symbol_names = 'q L beta uo ko'
symbol_values = '1200 1 1e-3 0 1'
expression = 'uo+(1/beta)*( ( 1 + (1-(x/L)^2) * (beta*q*L^2) / ko )^0.5 - 1)'
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = u
[../]
[./heatsource]
type = HeatSource
function = 1200
variable = u
[../]
[]
[BCs]
[./ui]
type = NeumannBC
boundary = left
variable = u
value = 0
[../]
[./uo]
type = DirichletBC
boundary = right
variable = u
value = 0
[../]
[]
[Materials]
[./property]
type = GenericConstantMaterial
prop_names = 'density specific_heat'
prop_values = '1.0 1.0'
[../]
[./thermal_conductivity]
type = ParsedMaterial
property_name = 'thermal_conductivity'
coupled_variables = u
expression = '1 * (1 + 1e-3*u)'
[../]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[./error]
type = ElementL2Error
function = exact
variable = u
[../]
[./h]
type = AverageElementSize
[]
[]
[Outputs]
csv = true
[]
(modules/heat_transfer/test/tests/conjugate_heat_transfer/conjugate_heat_transfer.i)
[Mesh]
type = FileMesh
file = simple_pb.e
[]
[Variables]
[./temp_wall]
block = 'left right'
[../]
[./temp_fluid]
block = 'center'
[../]
[]
[Kernels]
[./wall_conduction]
type = ADHeatConduction
variable = temp_wall
[../]
[./heat_source]
type = HeatSource
value = 1e3 # W/m^3
variable = temp_fluid
block = 'center'
[../]
[./center_conduction]
type = ADHeatConduction
variable = temp_fluid
block = 'center'
[../]
[]
[BCs]
[./right]
type = DirichletBC
variable = temp_wall
boundary = 'right'
value = 300
[../]
[./left]
type = DirichletBC
variable = temp_wall
boundary = 'left'
value = 100
[../]
[]
[Executioner]
type = Steady
solve_type = PJFNK
[]
[Outputs]
exodus = true
[]
[Materials]
[./walls]
type = ADHeatConductionMaterial
thermal_conductivity = 10 # W/m k
block = 'left right'
specific_heat = .49e3 # J/kg k
[../]
[./pb]
type = ADHeatConductionMaterial
thermal_conductivity = 1
specific_heat = .49e3 # J/kg K
block = 'center'
[../]
[./alpha_wall]
type = ADGenericConstantMaterial
prop_names = 'alpha_wall'
prop_values = '1'
block = 'center'
[../]
[]
[InterfaceKernels]
[./left_center_wrt_center]
type = ConjugateHeatTransfer
variable = temp_fluid
T_fluid = temp_fluid
neighbor_var = 'temp_wall'
boundary = 'left_center_wrt_center'
htc = 'alpha_wall'
[../]
[./right_center_wrt_center]
type = ConjugateHeatTransfer
variable = temp_fluid
T_fluid = temp_fluid
neighbor_var = 'temp_wall'
boundary = 'right_center_wrt_center'
htc = 'alpha_wall'
[../]
[]
[Preconditioning]
[./Hypre]
type = SMP
petsc_options_value = 'lu hypre'
full = true
petsc_options_iname = '-pc_type -pc_hypre_type'
[../]
[]
(tutorials/tutorial03_verification/app/test/tests/step04_mms/2d_mms_spatial.i)
[ICs]
active = 'mms'
[mms]
type = FunctionIC
variable = T
function = mms_exact
[]
[]
[BCs]
active = 'mms'
[mms]
type = FunctionDirichletBC
variable = T
boundary = 'left right top bottom'
function = mms_exact
[]
[]
[Kernels]
[mms]
type = HeatSource
variable = T
function = mms_force
[]
[]
[Functions]
[mms_force]
type = ParsedFunction
expression = 'cp*rho*sin(x*pi)*sin(5*y*pi) + 26*pi^2*k*t*sin(x*pi)*sin(5*y*pi) - shortwave*exp(y*kappa)*sin((1/2)*x*pi)*sin((1/3600)*pi*t/hours)'
symbol_names = 'rho cp k kappa shortwave hours'
symbol_values = '150 2000 0.01 40 650 9'
[]
[mms_exact]
type = ParsedFunction
expression = 't*sin(pi*x)*sin(5*pi*y)'
[]
[]
[Outputs]
csv = true
[]
[Postprocessors]
[error]
type = ElementL2Error
variable = T
function = mms_exact
[]
[h]
type = AverageElementSize
[]
[]
(modules/combined/test/tests/adaptive_timestepping/adapt_tstep_function_force_step.i)
# This is a test designed to evaluate the cabability of the
# IterationAdaptiveDT TimeStepper to adjust time step size according to
# a function. For example, if the power input function for a BISON
# simulation rapidly increases or decreases, the IterationAdaptiveDT
# TimeStepper should take time steps small enough to capture the
# oscillation.
[GlobalParams]
order = FIRST
family = LAGRANGE
block = 1
volumetric_locking_correction = true
displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
file = 1hex8_10mm_cube.e
[]
[Functions]
[./Fiss_Function]
type = PiecewiseLinear
data_file = blip.csv
format = columns
[../]
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[./temp]
initial_condition = 300.0
[../]
[]
[Modules/TensorMechanics/Master]
[./all]
strain = FINITE
incremental = true
eigenstrain_names = thermal_expansion
add_variables = true
generate_output = 'vonmises_stress'
temperature = temp
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = temp
[../]
[./heat_ie]
type = HeatConductionTimeDerivative
variable = temp
[../]
[./heat_source]
type = HeatSource
variable = temp
value = 1.0
function = Fiss_Function
[../]
[]
[BCs]
[./bottom_temp]
type = DirichletBC
variable = temp
boundary = 1
value = 300
[../]
[./top_bottom_disp_x]
type = DirichletBC
variable = disp_x
boundary = '1'
value = 0
[../]
[./top_bottom_disp_y]
type = DirichletBC
variable = disp_y
boundary = '1'
value = 0
[../]
[./top_bottom_disp_z]
type = DirichletBC
variable = disp_z
boundary = '1'
value = 0
[../]
[]
[Materials]
[./thermal]
type = HeatConductionMaterial
temp = temp
specific_heat = 1.0
thermal_conductivity = 1.0
[../]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 300e6
poissons_ratio = .3
[../]
[./stress]
type = ComputeFiniteStrainElasticStress
[../]
[./thermal_expansion]
type = ComputeThermalExpansionEigenstrain
thermal_expansion_coeff = 5e-6
stress_free_temperature = 300.0
temperature = temp
eigenstrain_name = thermal_expansion
[../]
[./density]
type = Density
density = 10963.0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
verbose = true
nl_abs_tol = 1e-10
start_time = 0.0
num_steps = 50000
end_time = 5.1e3
[./TimeStepper]
type = IterationAdaptiveDT
timestep_limiting_function = Fiss_Function
max_function_change = 3e20
force_step_every_function_point = true
dt = 1e2
[../]
[]
[Postprocessors]
[./Temperature_of_Block]
type = ElementAverageValue
variable = temp
execute_on = 'initial timestep_end'
[../]
[./vonMises]
type = ElementAverageValue
variable = vonmises_stress
execute_on = 'initial timestep_end'
[../]
[]
[Outputs]
[./out]
type = Exodus
elemental_as_nodal = true
[../]
[./console]
type = Console
max_rows = 10
[../]
[]
(modules/heat_transfer/test/tests/code_verification/cartesian_test_no1.i)
# Problem I.1
#
# An infinite plate with constant thermal conductivity k and
# internal heat generation q. It is exposed on each boundary
# to a constant temperature: u(0) = ui and u(L) = uo.
#
# REFERENCE:
# A. Toptan, et al. (Mar.2020). Tech. rep. CASL-U-2020-1939-000, SAND2020-3887 R. DOI:10.2172/1614683.
[Mesh]
[./geom]
type = GeneratedMeshGenerator
dim = 1
elem_type = EDGE2
nx = 1
[../]
[]
[Variables]
[./u]
order = FIRST
[../]
[]
[Functions]
[./exact]
type = ParsedFunction
symbol_names = 'q L k ui uo'
symbol_values = '1200 1 12 100 0'
expression = 'ui + (uo-ui)*x/L + (q/k) * x * (L-x) / 2'
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = u
[../]
[./heatsource]
type = HeatSource
function = 1200
variable = u
[../]
[]
[BCs]
[./ui]
type = DirichletBC
boundary = left
variable = u
value = 100
[../]
[./uo]
type = DirichletBC
boundary = right
variable = u
value = 0
[../]
[]
[Materials]
[./property]
type = GenericConstantMaterial
prop_names = 'density specific_heat thermal_conductivity'
prop_values = '1.0 1.0 12.0'
[../]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[./error]
type = ElementL2Error
function = exact
variable = u
[../]
[./h]
type = AverageElementSize
[]
[]
[Outputs]
csv = true
[]
(modules/combined/test/tests/adaptive_timestepping/adapt_tstep_function_change.i)
# This is a test designed to evaluate the cabability of the
# IterationAdaptiveDT TimeStepper to adjust time step size according to
# a function. For example, if the power input function for a BISON
# simulation rapidly increases or decreases, the IterationAdaptiveDT
# TimeStepper should take time steps small enough to capture the
# oscillation.
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
order = FIRST
family = LAGRANGE
block = 1
[]
[Mesh]
file = 1hex8_10mm_cube.e
[]
[Functions]
[./Fiss_Function]
type = PiecewiseLinear
x = '0 1e6 2e6 2.001e6 2.002e6'
y = '0 3e8 3e8 12e8 0'
[../]
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[./temp]
initial_condition = 300.0
[../]
[]
[Modules/TensorMechanics/Master]
[./all]
strain = FINITE
volumetric_locking_correction = true
incremental = true
eigenstrain_names = thermal_expansion
decomposition_method = EigenSolution
add_variables = true
generate_output = 'vonmises_stress'
temperature = temp
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = temp
[../]
[./heat_ie]
type = HeatConductionTimeDerivative
variable = temp
[../]
[./heat_source]
type = HeatSource
variable = temp
value = 1.0
function = Fiss_Function
[../]
[]
[BCs]
[./bottom_temp]
type = DirichletBC
variable = temp
boundary = 1
value = 300
[../]
[./top_bottom_disp_x]
type = DirichletBC
variable = disp_x
boundary = '1'
value = 0
[../]
[./top_bottom_disp_y]
type = DirichletBC
variable = disp_y
boundary = '1'
value = 0
[../]
[./top_bottom_disp_z]
type = DirichletBC
variable = disp_z
boundary = '1'
value = 0
[../]
[]
[Materials]
[./thermal]
type = HeatConductionMaterial
temp = temp
specific_heat = 1.0
thermal_conductivity = 1.0
[../]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 300e6
poissons_ratio = .3
[../]
[./stress]
type = ComputeFiniteStrainElasticStress
[../]
[./thermal_expansion]
type = ComputeThermalExpansionEigenstrain
thermal_expansion_coeff = 5e-6
stress_free_temperature = 300.0
temperature = temp
eigenstrain_name = thermal_expansion
[../]
[./density]
type = Density
density = 10963.0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
verbose = true
nl_abs_tol = 1e-10
start_time = 0.0
num_steps = 50000
end_time = 2.002e6
[./TimeStepper]
type = IterationAdaptiveDT
timestep_limiting_function = Fiss_Function
max_function_change = 3e7
dt = 1e6
[../]
[]
[Postprocessors]
[./Temperature_of_Block]
type = ElementAverageValue
variable = temp
execute_on = 'initial timestep_end'
[../]
[./vonMises]
type = ElementAverageValue
variable = vonmises_stress
execute_on = 'initial timestep_end'
[../]
[]
[Outputs]
[./out]
type = Exodus
elemental_as_nodal = true
[../]
[./console]
type = Console
max_rows = 10
[../]
[]
(modules/heat_transfer/test/tests/code_verification/spherical_test_no4.i)
# Problem III.4
#
# A spherical shell has thermal conductivity k and heat generation q.
# It has an inner radius ri and outer radius ro. A constant heat flux is
# applied to the inside surface qin and the outside surface is exposed
# to a fluid temperature uf and heat transfer coefficient h.
#
# REFERENCE:
# A. Toptan, et al. (Mar.2020). Tech. rep. CASL-U-2020-1939-000, SAND2020-3887 R. DOI:10.2172/1614683.
[Mesh]
[./geom]
type = GeneratedMeshGenerator
dim = 1
elem_type = EDGE2
xmin = 0.2
nx = 4
[../]
[]
[Variables]
[./u]
order = FIRST
[../]
[]
[Problem]
coord_type = RSPHERICAL
[]
[Functions]
[./exact]
type = ParsedFunction
symbol_names = 'qin q k ri ro uf h'
symbol_values = '100 1200 1.0 0.2 1 100 10'
expression = 'uf+ (q/(6*k)) * ( ro^2-x^2 + 2*k*(ro^3-ri^3)/(h*ro^2) + 2 * ri^3 * (1/ro-1/x) ) + (1/x-1/ro+k/(h*ro^2)) * qin * ri^2 / k'
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = u
[../]
[./heatsource]
type = HeatSource
function = 1200
variable = u
[../]
[]
[BCs]
[./ui]
type = NeumannBC
boundary = left
variable = u
value = 100
[../]
[./uo]
type = CoupledConvectiveHeatFluxBC
boundary = right
variable = u
htc = 10.0
T_infinity = 100
[../]
[]
[Materials]
[./property]
type = GenericConstantMaterial
prop_names = 'density specific_heat thermal_conductivity'
prop_values = '1.0 1.0 1.0'
[../]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[./error]
type = ElementL2Error
function = exact
variable = u
[../]
[./h]
type = AverageElementSize
[]
[]
[Outputs]
csv = true
[]
(modules/combined/test/tests/optimization/thermal_sensitivity/2d_root.i)
vol_frac = 0.5
E0 = 1
Emin = 1e-4
power = 1
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 2
nx = 20
ny = 20
xmin = 0
xmax = 40
ymin = 0
ymax = 40
[]
[]
[Variables]
[T]
initial_condition = 100
[]
[]
[AuxVariables]
[Dc]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = ${vol_frac}
[]
[]
[Kernels]
[heat]
type = HeatConduction
diffusion_coefficient = k
variable = T
[]
[heat_source]
type = HeatSource
function = 1e-2
variable = T
[]
[]
[DiracKernels]
[src]
type = ConstantPointSource
variable = T
point = '0 5 0'
value = 10
[]
[]
[BCs]
[no_x]
type = DirichletBC
variable = T
boundary = 'right top bottom'
value = 0.0
[]
[]
[Materials]
[k]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
coupled_variables = 'mat_den'
property_name = k
[]
[dc]
type = ThermalSensitivity
temperature = T
design_density = mat_den
thermal_conductivity = k
[]
#only needed for objective function output in postprocessor
[thermal_compliance]
type = ThermalCompliance
temperature = T
thermal_conductivity = k
[]
[]
[UserObjects]
[rad_avg]
type = RadialAverage
radius = 3
weights = linear
prop_name = thermal_sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[update]
type = DensityUpdate
density_sensitivity = Dc
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = TIMESTEP_BEGIN
[]
[calc_sense]
type = SensitivityFilter
density_sensitivity = Dc
design_density = mat_den
filter_UO = rad_avg
execute_on = TIMESTEP_END
force_postaux = true
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-8
dt = 1.0
dtmin = 1.0
num_steps = 20
[]
[Outputs]
[out]
type = CSV
execute_on = 'FINAL'
[]
print_linear_residuals = false
[]
[Postprocessors]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
function = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = thermal_sensitivity
[]
[objective_thermal]
type = ElementIntegralMaterialProperty
mat_prop = thermal_compliance
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
(tutorials/tutorial03_verification/app/test/tests/step04_mms/2d_mms_temporal.i)
[ICs]
active = 'mms'
[mms]
type = FunctionIC
variable = T
function = mms_exact
[]
[]
[BCs]
active = 'mms'
[mms]
type = FunctionDirichletBC
variable = T
boundary = 'left right top bottom'
function = mms_exact
[]
[]
[Kernels]
[mms]
type = HeatSource
variable = T
function = mms_force
[]
[]
[Functions]
[mms_force]
type = ParsedFunction
expression = '-3.08641975308642e-5*x*y*cp*rho*exp(-3.08641975308642e-5*t) - shortwave*exp(y*kappa)*sin((1/2)*x*pi)*sin((1/3600)*pi*t/hours)'
symbol_names = 'rho cp k kappa shortwave hours'
symbol_values = '150 2000 0.01 40 650 9'
[]
[mms_exact]
type = ParsedFunction
expression = 'x*y*exp(-3.08641975308642e-5*t)'
[]
[]
[Outputs]
csv = true
[]
[Postprocessors]
[error]
type = ElementL2Error
variable = T
function = mms_exact
[]
[delta_t]
type = TimestepSize
[]
[]
(modules/heat_transfer/test/tests/code_verification/cylindrical_test_no4.i)
# Problem II.4
#
# An infinitely long hollow cylinder has thermal conductivity k and internal
# heat generation q. Its inner radius is ri and outer radius is ro.
# A constant heat flux is applied to the inside surface qin and
# the outside surface is exposed to a fluid temperature T and heat transfer
# coefficient h, which results in the convective boundary condition.
#
# REFERENCE:
# A. Toptan, et al. (Mar.2020). Tech. rep. CASL-U-2020-1939-000, SAND2020-3887 R. DOI:10.2172/1614683.
[Mesh]
[./geom]
type = GeneratedMeshGenerator
dim = 1
elem_type = EDGE2
xmin = 0.2
nx = 4
[../]
[]
[Variables]
[./u]
order = FIRST
[../]
[]
[Problem]
coord_type = RZ
[]
[Functions]
[./exact]
type = ParsedFunction
symbol_names = 'qin q k ri ro uf h'
symbol_values = '100 1200 1.0 0.2 1 100 10'
expression = 'uf+ (0.25*q/k) * ( 2*k*(ro^2-ri^2)/(h*ro) + ro^2-x^2 + 2*ri^2*log(x/ro)) + (k/(h*ro) - log(x/ro)) * qin * ri / k'
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = u
[../]
[./heatsource]
type = HeatSource
function = 1200
variable = u
[../]
[]
[BCs]
[./ui]
type = NeumannBC
boundary = left
variable = u
value = 100
[../]
[./uo]
type = CoupledConvectiveHeatFluxBC
boundary = right
variable = u
htc = 10.0
T_infinity = 100
[../]
[]
[Materials]
[./property]
type = GenericConstantMaterial
prop_names = 'density specific_heat thermal_conductivity'
prop_values = '1.0 1.0 1.0'
[../]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[./error]
type = ElementL2Error
function = exact
variable = u
[../]
[./h]
type = AverageElementSize
[]
[]
[Outputs]
csv = true
[]
(modules/combined/test/tests/adaptive_timestepping/adapt_tstep_function_change_restart1.i)
# This is a test designed to evaluate the cabability of the
# IterationAdaptiveDT TimeStepper to adjust time step size according to
# a function. For example, if the power input function for a BISON
# simulation rapidly increases or decreases, the IterationAdaptiveDT
# TimeStepper should take time steps small enough to capture the
# oscillation.
[GlobalParams]
order = FIRST
family = LAGRANGE
block = 1
displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
file = 1hex8_10mm_cube.e
[]
[Functions]
[./Fiss_Function]
type = PiecewiseLinear
x = '0 1e6 2e6 2.001e6 2.002e6'
y = '0 3e8 3e8 12e8 0'
[../]
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[./temp]
initial_condition = 300.0
[../]
[]
[Modules/TensorMechanics/Master]
[./all]
strain = FINITE
incremental = true
volumetric_locking_correction = true
eigenstrain_names = thermal_expansion
decomposition_method = EigenSolution
add_variables = true
generate_output = 'vonmises_stress'
temperature = temp
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = temp
[../]
[./heat_ie]
type = HeatConductionTimeDerivative
variable = temp
[../]
[./heat_source]
type = HeatSource
variable = temp
value = 1.0
function = Fiss_Function
[../]
[]
[BCs]
[./bottom_temp]
type = DirichletBC
variable = temp
boundary = 1
value = 300
[../]
[./top_bottom_disp_x]
type = DirichletBC
variable = disp_x
boundary = '1'
value = 0
[../]
[./top_bottom_disp_y]
type = DirichletBC
variable = disp_y
boundary = '1'
value = 0
[../]
[./top_bottom_disp_z]
type = DirichletBC
variable = disp_z
boundary = '1'
value = 0
[../]
[]
[Materials]
[./thermal]
type = HeatConductionMaterial
temp = temp
specific_heat = 1.0
thermal_conductivity = 1.0
[../]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 300e6
poissons_ratio = .3
[../]
[./stress]
type = ComputeFiniteStrainElasticStress
[../]
[./thermal_expansion]
type = ComputeThermalExpansionEigenstrain
thermal_expansion_coeff = 5e-6
stress_free_temperature = 300.0
temperature = temp
eigenstrain_name = thermal_expansion
[../]
[./density]
type = Density
density = 10963.0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
verbose = true
nl_abs_tol = 1e-10
start_time = 0.0
num_steps = 65
end_time = 2.002e6
[./TimeStepper]
type = IterationAdaptiveDT
timestep_limiting_function = Fiss_Function
max_function_change = 3e7
dt = 1e6
[../]
[]
[Postprocessors]
[./Temperature_of_Block]
type = ElementAverageValue
variable = temp
execute_on = 'initial timestep_end'
[../]
[./vonMises]
type = ElementAverageValue
variable = vonmises_stress
execute_on = 'initial timestep_end'
[../]
[]
[Outputs]
[./out]
type = Exodus
elemental_as_nodal = true
[../]
[./console]
type = Console
max_rows = 10
[../]
[./checkpoint]
type = Checkpoint
num_files = 1
[../]
[]
(modules/heat_transfer/tutorials/introduction/therm_step03a.i)
#
# Single block thermal input with time derivative and volumetric heat source terms
# https://mooseframework.inl.gov/modules/heat_transfer/tutorials/introduction/therm_step03.html
#
[Mesh]
[generated]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmax = 2
ymax = 1
[]
[]
[Variables]
[T]
initial_condition = 300.0
[]
[]
[Kernels]
[heat_conduction]
type = HeatConduction
variable = T
[]
[time_derivative]
type = HeatConductionTimeDerivative
variable = T
[]
[heat_source]
type = HeatSource
variable = T
value = 1e4
[]
[]
[Materials]
[thermal]
type = HeatConductionMaterial
thermal_conductivity = 45.0
specific_heat = 0.5
[]
[density]
type = GenericConstantMaterial
prop_names = 'density'
prop_values = 8000.0
[]
[]
[BCs]
[t_left]
type = DirichletBC
variable = T
value = 300
boundary = 'left'
[]
[t_right]
type = FunctionDirichletBC
variable = T
function = '300+5*t'
boundary = 'right'
[]
[]
[Executioner]
type = Transient
end_time = 5
dt = 1
[]
[VectorPostprocessors]
[t_sampler]
type = LineValueSampler
variable = T
start_point = '0 0.5 0'
end_point = '2 0.5 0'
num_points = 20
sort_by = x
[]
[]
[Outputs]
exodus = true
[csv]
type = CSV
file_base = therm_step03a_out
execute_on = final
[]
[]
(modules/heat_transfer/test/tests/heat_source_bar/heat_source_bar.i)
# This is a simple 1D test of the volumetric heat source with material properties
# of a representative ceramic material. A bar is uniformly heated, and a temperature
# boundary condition is applied to the left side of the bar.
# Important properties of problem:
# Length: 0.01 m
# Thermal conductivity = 3.0 W/(mK)
# Specific heat = 300.0 J/K
# density = 10431.0 kg/m^3
# Prescribed temperature on left side: 600 K
# When it has reached steady state, the temperature as a function of position is:
# T = -q/(2*k) (x^2 - 2*x*length) + 600
# or
# T = -6.3333e+7 * (x^2 - 0.02*x) + 600
# on left side: T=600, on right side, T=6933.3
[Mesh]
type = GeneratedMesh
dim = 1
xmax = 0.01
nx = 20
[]
[Variables]
[./temp]
initial_condition = 300.0
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = temp
[../]
[./heatsource]
type = HeatSource
function = volumetric_heat
variable = temp
[../]
[]
[BCs]
[./lefttemp]
type = DirichletBC
boundary = left
variable = temp
value = 600
[../]
[]
[Materials]
[./density]
type = GenericConstantMaterial
prop_names = 'density thermal_conductivity'
prop_values = '10431.0 3.0'
[../]
[]
[Functions]
[./volumetric_heat]
type = ParsedFunction
expression = 3.8e+8
[../]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[./right]
type = SideAverageValue
variable = temp
boundary = right
[../]
[./error]
type = NodalL2Error
function = '-3.8e+8/(2*3) * (x^2 - 2*x*0.01) + 600'
variable = temp
[../]
[]
[Outputs]
execute_on = FINAL
exodus = true
[]
(modules/heat_transfer/test/tests/code_verification/cartesian_test_no4.i)
# Problem I.4
#
# An infinite plate with constant thermal conductivity k and internal
# heat generation q. The left boundary is exposed to a constant heat flux q0.
# The right boundary is exposed to a fluid with constant temperature uf and
# heat transfer coefficient h, which results in the convective boundary condition.
#
# REFERENCE:
# A. Toptan, et al. (Mar.2020). Tech. rep. CASL-U-2020-1939-000, SAND2020-3887 R. DOI:10.2172/1614683.
[Mesh]
[./geom]
type = GeneratedMeshGenerator
dim = 1
elem_type = EDGE2
nx = 1
[../]
[]
[Variables]
[./u]
order = FIRST
[../]
[]
[Functions]
[./exact]
type = ParsedFunction
symbol_names = 'q q0 k L uf h'
symbol_values = '1200 200 1 1 100 10.0'
expression = 'uf + (q0 + L * q)/h + 0.5 * ( 2 * q0 + q * (L + x)) * (L-x) / k'
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = u
[../]
[./heatsource]
type = HeatSource
function = 1200
variable = u
[../]
[]
[BCs]
[./ui]
type = NeumannBC
boundary = left
variable = u
value = 200
[../]
[./uo]
type = CoupledConvectiveHeatFluxBC
boundary = right
variable = u
htc = 10.0
T_infinity = 100
[../]
[]
[Materials]
[./property]
type = GenericConstantMaterial
prop_names = 'density specific_heat thermal_conductivity'
prop_values = '1.0 1.0 1.0'
[../]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[./error]
type = ElementL2Error
function = exact
variable = u
[../]
[./h]
type = AverageElementSize
[]
[]
[Outputs]
csv = true
[]
(modules/heat_transfer/test/tests/code_verification/spherical_test_no3.i)
# Problem III.3
#
# The thermal conductivity of a spherical shell varies linearly with
# temperature: k = k0(1+beta* u). The inside radius is ri and the outside radius
# is ro. It has a constant internal heat generation q and is exposed to
# the same constant temperature on both surfaces: u(ri) = u(ro) = uo.
#
# REFERENCE:
# A. Toptan, et al. (Mar.2020). Tech. rep. CASL-U-2020-1939-000, SAND2020-3887 R. DOI:10.2172/1614683.
[Mesh]
[./geom]
type = GeneratedMeshGenerator
dim = 1
elem_type = EDGE2
nx = 4
xmin = 0.2
[../]
[]
[Variables]
[./u]
order = FIRST
[../]
[]
[Problem]
coord_type = RSPHERICAL
[]
[Functions]
[./exact]
type = ParsedFunction
symbol_names = 'q k0 ri ro beta u0'
symbol_values = '1200 1 0.2 1.0 1e-3 0'
expression = 'u0+(1/beta)*( ( 1 + (1/3)*beta*((ro^2-x^2)-(ro^2-ri^2) * (1/x-1/ro)/(1/ri-1/ro))*q/k0 )^0.5 - 1)'
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = u
[../]
[./heatsource]
type = HeatSource
function = 1200
variable = u
[../]
[]
[BCs]
[./uo]
type = DirichletBC
boundary = 'left right'
variable = u
value = 0
[../]
[]
[Materials]
[./property]
type = GenericConstantMaterial
prop_names = 'density specific_heat'
prop_values = '1.0 1.0'
[../]
[./thermal_conductivity]
type = ParsedMaterial
property_name = 'thermal_conductivity'
coupled_variables = u
expression = '1 * (1 + 1e-3*u)'
[../]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[./error]
type = ElementL2Error
function = exact
variable = u
[../]
[./h]
type = AverageElementSize
[]
[]
[Outputs]
csv = true
[]
(modules/combined/test/tests/optimization/compliance_sensitivity/three_materials_thermal.i)
vol_frac = 0.4
cost_frac = 0.4
power = 4
# Stiffness (not optimized in this test)
E0 = 1.0e-6
E1 = 0.2
E2 = 0.6
E3 = 1.0
# Densities
rho0 = 1.0e-6
rho1 = 0.4
rho2 = 0.7
rho3 = 1.0
# Costs
C0 = 1.0e-6
C1 = 0.5
C2 = 0.8
C3 = 1.0
# Thermal conductivity
TC0 = 1.0e-6
TC1 = 0.2
TC2 = 0.6
TC3 = 1.0
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 2
nx = 40
ny = 40
xmin = 0
xmax = 40
ymin = 0
ymax = 40
[]
[node]
type = ExtraNodesetGenerator
input = MeshGenerator
new_boundary = hold
nodes = 0
[]
[push_left]
type = ExtraNodesetGenerator
input = node
new_boundary = push_left
coord = '20 0 0'
[]
[push_center]
type = ExtraNodesetGenerator
input = push_left
new_boundary = push_center
coord = '40 0 0'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[temp]
initial_condition = 100.0
[]
[]
[AuxVariables]
[Dc]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[Cc]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[Tc]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[Cost]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = ${vol_frac}
[]
[]
# [ICs]
# [mat_den]
# type = RandomIC
# seed = 4
# variable = mat_den
# max = '${fparse vol_frac+0.25}'
# min = '${fparse vol_frac-0.25}'
# []
# []
[AuxKernels]
[Cost]
type = MaterialRealAux
variable = Cost
property = Cost_mat
[]
[]
[Kernels]
[heat_conduction]
type = HeatConduction
variable = temp
diffusion_coefficient = thermal_cond
[]
[heat_source]
type = HeatSource
value = 1e-2 # W/m^3
variable = temp
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = hold
value = 0.0
[]
[no_x_symm]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[]
[top]
type = DirichletBC
variable = temp
boundary = top
value = 0
[]
[bottom]
type = DirichletBC
variable = temp
boundary = bottom
value = 0
[]
[right]
type = DirichletBC
variable = temp
boundary = right
value = 0
[]
[left]
type = DirichletBC
variable = temp
boundary = left
value = 0
[]
[]
[NodalKernels]
[push_left]
type = NodalGravity
variable = disp_y
boundary = push_left
gravity_value = -1e-6 # -3
mass = 1
[]
[push_center]
type = NodalGravity
variable = disp_y
boundary = push_center
gravity_value = -1e-6 # -3
mass = 1
[]
[]
[Materials]
[thermal_cond]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${TC0}-${TC1})/(${rho0}^${power}-${rho1}^${power}); "
"B1:=${TC0}-A1*${rho0}^${power}; TC1:=A1*mat_den^${power}+B1; "
"A2:=(${TC1}-${TC2})/(${rho1}^${power}-${rho2}^${power}); "
"B2:=${TC1}-A2*${rho1}^${power}; TC2:=A2*mat_den^${power}+B2; "
"A3:=(${TC2}-${TC3})/(${rho2}^${power}-${rho3}^${power}); "
"B3:=${TC2}-A3*${rho2}^${power}; TC3:=A3*mat_den^${power}+B3; "
"if(mat_den<${rho1},TC1,if(mat_den<${rho2},TC2,TC3))"
coupled_variables = 'mat_den'
property_name = thermal_cond
outputs = 'exodus'
[]
[thermal_compliance]
type = ThermalCompliance
temperature = temp
thermal_conductivity = thermal_cond
outputs = 'exodus'
[]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${E0}-${E1})/(${rho0}^${power}-${rho1}^${power}); "
"B1:=${E0}-A1*${rho0}^${power}; E1:=A1*mat_den^${power}+B1; "
"A2:=(${E1}-${E2})/(${rho1}^${power}-${rho2}^${power}); "
"B2:=${E1}-A2*${rho1}^${power}; E2:=A2*mat_den^${power}+B2; "
"A3:=(${E2}-${E3})/(${rho2}^${power}-${rho3}^${power}); "
"B3:=${E2}-A3*${rho2}^${power}; E3:=A3*mat_den^${power}+B3; "
"if(mat_den<${rho1},E1,if(mat_den<${rho2},E2,E3))"
coupled_variables = 'mat_den'
property_name = E_phys
[]
[Cost_mat]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${C0}-${C1})/(${rho0}^(1/${power})-${rho1}^(1/${power})); "
"B1:=${C0}-A1*${rho0}^(1/${power}); C1:=A1*mat_den^(1/${power})+B1; "
"A2:=(${C1}-${C2})/(${rho1}^(1/${power})-${rho2}^(1/${power})); "
"B2:=${C1}-A2*${rho1}^(1/${power}); C2:=A2*mat_den^(1/${power})+B2; "
"A3:=(${C2}-${C3})/(${rho2}^(1/${power})-${rho3}^(1/${power})); "
"B3:=${C2}-A3*${rho2}^(1/${power}); C3:=A3*mat_den^(1/${power})+B3; "
"if(mat_den<${rho1},C1,if(mat_den<${rho2},C2,C3))"
coupled_variables = 'mat_den'
property_name = Cost_mat
[]
[CostDensity]
type = ParsedMaterial
property_name = CostDensity
coupled_variables = 'mat_den Cost'
expression = 'mat_den*Cost'
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
[]
[cc]
type = CostSensitivity
design_density = mat_den
cost = Cost_mat
outputs = 'exodus'
[]
[tc]
type = ThermalSensitivity
design_density = mat_den
thermal_conductivity = thermal_cond
temperature = temp
outputs = 'exodus'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[rad_avg]
type = RadialAverage
radius = 4
weights = linear
prop_name = sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[rad_avg_cost]
type = RadialAverage
radius = 4
weights = linear
prop_name = cost_sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[rad_avg_thermal]
type = RadialAverage
radius = 4
weights = linear
prop_name = thermal_sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[update]
type = DensityUpdateTwoConstraints
density_sensitivity = Dc
cost_density_sensitivity = Cc
cost = Cost
cost_fraction = ${cost_frac}
design_density = mat_den
volume_fraction = ${vol_frac}
bisection_lower_bound = 0
bisection_upper_bound = 1.0e12 # 100
use_thermal_compliance = true
thermal_sensitivity = Tc
# Only account for thermal optimizxation
weight_mechanical_thermal = '0 1'
relative_tolerance = 1.0e-8
bisection_move = 0.05
adaptive_move = false
execute_on = TIMESTEP_BEGIN
[]
# Provides Dc
[calc_sense]
type = SensitivityFilter
density_sensitivity = Dc
design_density = mat_den
filter_UO = rad_avg
execute_on = TIMESTEP_END
force_postaux = true
[]
# Provides Cc
[calc_sense_cost]
type = SensitivityFilter
density_sensitivity = Cc
design_density = mat_den
filter_UO = rad_avg_cost
execute_on = TIMESTEP_END
force_postaux = true
[]
# Provides Tc
[calc_sense_thermal]
type = SensitivityFilter
density_sensitivity = Tc
design_density = mat_den
filter_UO = rad_avg_thermal
execute_on = TIMESTEP_END
force_postaux = true
[]
[]
[Executioner]
type = Transient
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-10
dt = 1.0
num_steps = 12
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[right_flux]
type = SideDiffusiveFluxAverage
variable = temp
boundary = right
diffusivity = 10
[]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
function = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
[]
[cost_sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = cost_sensitivity
[]
[cost]
type = ElementIntegralMaterialProperty
mat_prop = CostDensity
[]
[cost_frac]
type = ParsedPostprocessor
function = 'cost / mesh_volume'
pp_names = 'cost mesh_volume'
[]
[objective]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
[]
[objective_thermal]
type = ElementIntegralMaterialProperty
mat_prop = thermal_compliance
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
(tutorials/tutorial03_verification/app/test/tests/step04_mms/2d_main.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
ymax = 0
ymin = -0.2
nx = 20
ny = 4
[]
[]
[Variables]
[T]
[]
[]
[ICs]
[T_O]
type = ConstantIC
variable = T
value = 263.15
[]
[]
[Functions]
[source]
type = ParsedFunction
symbol_names = 'hours shortwave kappa'
symbol_values = '9 650 40'
expression = 'shortwave*sin(0.5*x*pi)*exp(kappa*y)*sin(1/(hours*3600)*pi*t)'
[]
[]
[Kernels]
[T_time]
type = HeatConductionTimeDerivative
variable = T
density_name = 150
specific_heat = 2000
[]
[T_cond]
type = HeatConduction
variable = T
diffusion_coefficient = 0.01
[]
[T_source]
type = HeatSource
variable = T
function = source
[]
[]
[BCs]
[top]
type = NeumannBC
boundary = top
variable = T
value = -5
[]
[bottom]
type = DirichletBC
boundary = bottom
variable = T
value = 263.15
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
dt = 600 # 10 min
end_time = 32400 # 9 hour
[]
[Outputs]
exodus = true
[]
(modules/combined/test/tests/optimization/compliance_sensitivity/thermal_test.i)
vol_frac = 0.4
cost_frac = 10.0
power = 2.0
E0 = 1.0e-6
E1 = 1.0
rho0 = 0.0
rho1 = 1.0
C0 = 1.0e-6
C1 = 1.0
TC0 = 1.0e-16
TC1 = 1.0
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmin = 0
xmax = 40
ymin = 0
ymax = 40
[]
[node]
type = ExtraNodesetGenerator
input = MeshGenerator
new_boundary = hold
nodes = 0
[]
[push_left]
type = ExtraNodesetGenerator
input = node
new_boundary = push_left
coord = '16 0 0'
[]
[push_center]
type = ExtraNodesetGenerator
input = push_left
new_boundary = push_center
coord = '24 0 0'
[]
[extra]
type = SideSetsFromBoundingBoxGenerator
input = push_center
bottom_left = '-0.01 17.999 0'
top_right = '5 22.001 0'
boundary_new = n1
included_boundaries = left
[]
[dirichlet_bc]
type = SideSetsFromNodeSetsGenerator
input = extra
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[temp]
initial_condition = 100.0
[]
[]
[AuxVariables]
[Dc]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[Cc]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[Tc]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[Cost]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = FIRST
initial_condition = ${vol_frac}
[]
[]
[AuxKernels]
[Cost]
type = MaterialRealAux
variable = Cost
property = Cost_mat
[]
[]
[Kernels]
[heat_conduction]
type = HeatConduction
variable = temp
diffusion_coefficient = thermal_cond
[]
[heat_source]
type = HeatSource
value = 1e-2 # W/m^3
variable = temp
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = hold
value = 0.0
[]
[no_x_symm]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[]
[left_n1]
type = DirichletBC
variable = temp
boundary = n1
value = 0.0
[]
[top]
type = NeumannBC
variable = temp
boundary = top
value = 0
[]
[bottom]
type = NeumannBC
variable = temp
boundary = bottom
value = 0
[]
[right]
type = NeumannBC
variable = temp
boundary = right
value = 0
[]
[left]
type = NeumannBC
variable = temp
boundary = left
value = 0
[]
[]
[NodalKernels]
[push_left]
type = NodalGravity
variable = disp_y
boundary = push_left
gravity_value = 0.0 # -1e-8
mass = 1
[]
[push_center]
type = NodalGravity
variable = disp_y
boundary = push_center
gravity_value = 0.0 # -1e-8
mass = 1
[]
[]
[Materials]
[thermal_cond]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${TC0}-${TC1})/(${rho0}^${power}-${rho1}^${power}); "
"B1:=${TC0}-A1*${rho0}^${power}; TC1:=A1*mat_den^${power}+B1; TC1"
coupled_variables = 'mat_den'
property_name = thermal_cond
outputs = 'exodus'
[]
[thermal_compliance]
type = ThermalCompliance
temperature = temp
thermal_conductivity = thermal_cond
outputs = 'exodus'
[]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${E0}-${E1})/(${rho0}^${power}-${rho1}^${power}); "
"B1:=${E0}-A1*${rho0}^${power}; E1:=A1*mat_den^${power}+B1; E1"
coupled_variables = 'mat_den'
property_name = E_phys
[]
[Cost_mat]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${C0}-${C1})/(${rho0}^(1/${power})-${rho1}^(1/${power})); "
"B1:=${C0}-A1*${rho0}^(1/${power}); C1:=A1*mat_den^(1/${power})+B1; C1"
coupled_variables = 'mat_den'
property_name = Cost_mat
[]
[CostDensity]
type = ParsedMaterial
property_name = CostDensity
coupled_variables = 'mat_den Cost'
expression = 'mat_den*Cost'
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
[]
[cc]
type = CostSensitivity
design_density = mat_den
cost = Cost_mat
outputs = 'exodus'
[]
[tc]
type = ThermalSensitivity
design_density = mat_den
thermal_conductivity = thermal_cond
temperature = temp
outputs = 'exodus'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[rad_avg]
type = RadialAverage
radius = 0.1
weights = linear
prop_name = sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[rad_avg_cost]
type = RadialAverage
radius = 0.1
weights = linear
prop_name = cost_sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[rad_avg_thermal]
type = RadialAverage
radius = 0.1
weights = linear
prop_name = thermal_sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[update]
type = DensityUpdateTwoConstraints
density_sensitivity = Dc
cost_density_sensitivity = Cc
cost = Cost
cost_fraction = ${cost_frac}
design_density = mat_den
volume_fraction = ${vol_frac}
bisection_lower_bound = 0
bisection_upper_bound = 1.0e12 # 100
use_thermal_compliance = true
thermal_sensitivity = Tc
weight_mechanical_thermal = '0 1'
relative_tolerance = 1.0e-12
bisection_move = 0.015
adaptive_move = false
execute_on = TIMESTEP_BEGIN
[]
# Provides Dc
[calc_sense]
type = SensitivityFilter
density_sensitivity = Dc
design_density = mat_den
filter_UO = rad_avg
execute_on = TIMESTEP_END
force_postaux = true
[]
# Provides Cc
[calc_sense_cost]
type = SensitivityFilter
density_sensitivity = Cc
design_density = mat_den
filter_UO = rad_avg_cost
execute_on = TIMESTEP_END
force_postaux = true
[]
# Provides Tc
[calc_sense_thermal]
type = SensitivityFilter
density_sensitivity = Tc
design_density = mat_den
filter_UO = rad_avg_thermal
execute_on = TIMESTEP_END
force_postaux = true
[]
[]
[Executioner]
type = Transient
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-12
dt = 1.0
num_steps = 5
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[right_flux]
type = SideDiffusiveFluxAverage
variable = temp
boundary = right
diffusivity = 10
[]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
function = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
[]
[cost_sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = cost_sensitivity
[]
[cost]
type = ElementIntegralMaterialProperty
mat_prop = CostDensity
[]
[cost_frac]
type = ParsedPostprocessor
function = 'cost / mesh_volume'
pp_names = 'cost mesh_volume'
[]
[objective]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
[]
[objective_thermal]
type = ElementIntegralMaterialProperty
mat_prop = thermal_compliance
execute_on = 'INITIAL TIMESTEP_END'
[]
[]