Step 1 - Basic Thermal/Mechanical Coupling
In the tutorials for the Heat Transfer and Solid Mechanics modules, basic thermal and mechanical problems were developed. The Heat Transfer tutorial culminated with a model that solves the heat equation on a simple rectangular domain, including terms for heat conduction, time-dependent effects, and volumetric heating.
The Solid Mechanics tutorial includes a model that shows how thermal expansion can be accounted for using a prescribed temperature field.
The model shown here builds on these thermal and mechanical models by simultaneously solving for the thermal and mechanical response. As will be evident from examining this file, coupled physics models are defined by combining the components from all of the physics in a single input file, and defining interactions between the physics.
#
# Single block coupled thermal/mechanical
# https://mooseframework.inl.gov/modules/combined/tutorials/introduction/thermoech_step01.html
#
[GlobalParams<<<{"href": "../../../../syntax/GlobalParams/index.html"}>>>]
displacements = 'disp_x disp_y'
[]
[Mesh<<<{"href": "../../../../syntax/Mesh/index.html"}>>>]
[generated]
type = GeneratedMeshGenerator<<<{"description": "Create a line, square, or cube mesh with uniformly spaced or biased elements.", "href": "../../../../source/meshgenerators/GeneratedMeshGenerator.html"}>>>
dim<<<{"description": "The dimension of the mesh to be generated"}>>> = 2
nx<<<{"description": "Number of elements in the X direction"}>>> = 10
ny<<<{"description": "Number of elements in the Y direction"}>>> = 10
xmax<<<{"description": "Upper X Coordinate of the generated mesh"}>>> = 2
ymax<<<{"description": "Upper Y Coordinate of the generated mesh"}>>> = 1
[]
[pin]
type = ExtraNodesetGenerator<<<{"description": "Creates a new node set and a new boundary made with the nodes the user provides.", "href": "../../../../source/meshgenerators/ExtraNodesetGenerator.html"}>>>
input<<<{"description": "The mesh we want to modify"}>>> = generated
new_boundary<<<{"description": "The names of the boundaries to create"}>>> = pin
coord<<<{"description": "The nodes with coordinates you want to be in the nodeset. Separate multple coords with ';' (Either this parameter or \"nodes\" must be supplied)."}>>> = '0 0 0'
[]
[]
[Variables<<<{"href": "../../../../syntax/Variables/index.html"}>>>]
[T]
initial_condition<<<{"description": "Specifies a constant initial condition for this variable"}>>> = 300.0
[]
[]
[Kernels<<<{"href": "../../../../syntax/Kernels/index.html"}>>>]
[heat_conduction]
type = HeatConduction<<<{"description": "Diffusive heat conduction term $-\\nabla\\cdot(k\\nabla T)$ of the thermal energy conservation equation", "href": "../../../../source/kernels/HeatConduction.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = T
[]
[time_derivative]
type = HeatConductionTimeDerivative<<<{"description": "Time derivative term $\\rho c_p \\frac{\\partial T}{\\partial t}$ of the thermal energy conservation equation.", "href": "../../../../source/kernels/HeatConductionTimeDerivative.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = T
[]
[heat_source]
type = HeatSource<<<{"description": "Demonstrates the multiple ways that scalar values can be introduced into kernels, e.g. (controllable) constants, functions, and postprocessors. Implements the weak form $(\\psi_i, -f)$.", "href": "../../../../source/kernels/HeatSource.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = T
value<<<{"description": "Value of heat source. Multiplied by function if present."}>>> = 5e4
[]
[]
[Physics<<<{"href": "../../../../syntax/Physics/index.html"}>>>/SolidMechanics<<<{"href": "../../../../syntax/Physics/SolidMechanics/index.html"}>>>/QuasiStatic<<<{"href": "../../../../syntax/Physics/SolidMechanics/QuasiStatic/index.html"}>>>]
[all]
add_variables<<<{"description": "Add the displacement variables"}>>> = true
strain<<<{"description": "Strain formulation"}>>> = FINITE
automatic_eigenstrain_names<<<{"description": "Collects all material eigenstrains and passes to required strain calculator within TMA internally."}>>> = true
generate_output<<<{"description": "Add scalar quantity output for stress and/or strain"}>>> = 'vonmises_stress'
[]
[]
[Materials<<<{"href": "../../../../syntax/Materials/index.html"}>>>]
[thermal]
type = HeatConductionMaterial<<<{"description": "General-purpose material model for heat conduction", "href": "../../../../source/materials/HeatConductionMaterial.html"}>>>
thermal_conductivity<<<{"description": "The thermal conductivity value"}>>> = 45.0
specific_heat<<<{"description": "The specific heat value"}>>> = 0.5
[]
[density]
type = GenericConstantMaterial<<<{"description": "Declares material properties based on names and values prescribed by input parameters.", "href": "../../../../source/materials/GenericConstantMaterial.html"}>>>
prop_names<<<{"description": "The names of the properties this material will have"}>>> = 'density'
prop_values<<<{"description": "The values associated with the named properties"}>>> = 8000.0
[]
[elasticity]
type = ComputeIsotropicElasticityTensor<<<{"description": "Compute a constant isotropic elasticity tensor.", "href": "../../../../source/materials/ComputeIsotropicElasticityTensor.html"}>>>
youngs_modulus<<<{"description": "Young's modulus of the material."}>>> = 1e9
poissons_ratio<<<{"description": "Poisson's ratio for the material."}>>> = 0.3
[]
[expansion1]
type = ComputeThermalExpansionEigenstrain<<<{"description": "Computes eigenstrain due to thermal expansion with a constant coefficient", "href": "../../../../source/materials/ComputeThermalExpansionEigenstrain.html"}>>>
temperature<<<{"description": "Coupled temperature"}>>> = T
thermal_expansion_coeff<<<{"description": "Thermal expansion coefficient"}>>> = 0.001
stress_free_temperature<<<{"description": "Reference temperature at which there is no thermal expansion for thermal eigenstrain calculation"}>>> = 300
eigenstrain_name<<<{"description": "Material property name for the eigenstrain tensor computed by this model. IMPORTANT: The name of this property must also be provided to the strain calculator."}>>> = thermal_expansion
[]
[stress]
type = ComputeFiniteStrainElasticStress<<<{"description": "Compute stress using elasticity for finite strains", "href": "../../../../source/materials/ComputeFiniteStrainElasticStress.html"}>>>
[]
[]
[BCs<<<{"href": "../../../../syntax/BCs/index.html"}>>>]
[t_left]
type = DirichletBC<<<{"description": "Imposes the essential boundary condition $u=g$, where $g$ is a constant, controllable value.", "href": "../../../../source/bcs/DirichletBC.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = T
value<<<{"description": "Value of the BC"}>>> = 300
boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = 'left'
[]
[t_right]
type = FunctionDirichletBC<<<{"description": "Imposes the essential boundary condition $u=g(t,\\vec{x})$, where $g$ is a (possibly) time and space-dependent MOOSE Function.", "href": "../../../../source/bcs/FunctionDirichletBC.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = T
function<<<{"description": "The forcing function."}>>> = '300+5*t'
boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = 'right'
[]
[pin_x]
type = DirichletBC<<<{"description": "Imposes the essential boundary condition $u=g$, where $g$ is a constant, controllable value.", "href": "../../../../source/bcs/DirichletBC.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = disp_x
boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = pin
value<<<{"description": "Value of the BC"}>>> = 0
[]
[bottom_y]
type = DirichletBC<<<{"description": "Imposes the essential boundary condition $u=g$, where $g$ is a constant, controllable value.", "href": "../../../../source/bcs/DirichletBC.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = disp_y
boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = bottom
value<<<{"description": "Value of the BC"}>>> = 0
[]
[]
[Preconditioning<<<{"href": "../../../../syntax/Preconditioning/index.html"}>>>]
[smp]
type = SMP<<<{"description": "Single matrix preconditioner (SMP) builds a preconditioner using user defined off-diagonal parts of the Jacobian.", "href": "../../../../source/preconditioners/SingleMatrixPreconditioner.html"}>>>
full<<<{"description": "Set to true if you want the full set of couplings between variables simply for convenience so you don't have to set every off_diag_row and off_diag_column combination."}>>> = true
[]
[]
[Executioner<<<{"href": "../../../../syntax/Executioner/index.html"}>>>]
type = Transient
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
end_time = 5
dt = 1
[]
[Outputs<<<{"href": "../../../../syntax/Outputs/index.html"}>>>]
exodus<<<{"description": "Output the results using the default settings for Exodus output."}>>> = true
[]
(modules/combined/tutorials/introduction/thermal_mechanical/thermomech_step01.i)Input file
Variables
The Variables
block in this input files looks just like it does for a thermal-only problem. A single variable,T
, is defined, with an initial condition of 300 Kelvin. An obvious question is why no variables are defined for mechanics. Coupled physics problems are usually defined in MOOSE by defining multiple variables and their associated Kernels. This is actually done in this model, but the Physics/SolidMechanics/QuasiStatic
Action block automatically sets up the displacement variables, so they don't explicitly appear in the Variables
block in the input file. That Action sets up variables with the names defined by the displacements
parameter, which is defined in GlobalParams
. In this case, there are thus three solution variables: T
, disp_x
, and disp_y
.
[Variables<<<{"href": "../../../../syntax/Variables/index.html"}>>>]
[T]
initial_condition<<<{"description": "Specifies a constant initial condition for this variable"}>>> = 300.0
[]
[]
(modules/combined/tutorials/introduction/thermal_mechanical/thermomech_step01.i)Kernels
Similar to the Variables
block, only the kernels related to the temperature solution are defined in the Kernels
block in this case. This is again due to the fact that the Physics/SolidMechanics/QuasiStatic
Action automates setting up the Kernels associated with the displacement variables, so they don't explicitly appear in the input file. This model includes kernels for the conduction, time derivative, and volumetric terms in the heat equation.
[Kernels<<<{"href": "../../../../syntax/Kernels/index.html"}>>>]
[heat_conduction]
type = HeatConduction<<<{"description": "Diffusive heat conduction term $-\\nabla\\cdot(k\\nabla T)$ of the thermal energy conservation equation", "href": "../../../../source/kernels/HeatConduction.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = T
[]
[time_derivative]
type = HeatConductionTimeDerivative<<<{"description": "Time derivative term $\\rho c_p \\frac{\\partial T}{\\partial t}$ of the thermal energy conservation equation.", "href": "../../../../source/kernels/HeatConductionTimeDerivative.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = T
[]
[heat_source]
type = HeatSource<<<{"description": "Demonstrates the multiple ways that scalar values can be introduced into kernels, e.g. (controllable) constants, functions, and postprocessors. Implements the weak form $(\\psi_i, -f)$.", "href": "../../../../source/kernels/HeatSource.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = T
value<<<{"description": "Value of heat source. Multiplied by function if present."}>>> = 5e4
[]
[]
(modules/combined/tutorials/introduction/thermal_mechanical/thermomech_step01.i)Physics/SolidMechanics/QuasiStatic
This block automates the process of setting up multiple objects related to solution of a mechanics problem. The objects set up by this block include the Variables and Kernels for the displacement solution, the Material that computes the strain, and objects associated with outputting stresses. In addition to simplifying the input, this ensures that a consistent set of options are selected for the desired formulation.
[Physics<<<{"href": "../../../../syntax/Physics/index.html"}>>>]
[SolidMechanics<<<{"href": "../../../../syntax/Physics/SolidMechanics/index.html"}>>>]
[QuasiStatic<<<{"href": "../../../../syntax/Physics/SolidMechanics/QuasiStatic/index.html"}>>>]
[all]
add_variables<<<{"description": "Add the displacement variables"}>>> = true
strain<<<{"description": "Strain formulation"}>>> = FINITE
automatic_eigenstrain_names<<<{"description": "Collects all material eigenstrains and passes to required strain calculator within TMA internally."}>>> = true
generate_output<<<{"description": "Add scalar quantity output for stress and/or strain"}>>> = 'vonmises_stress'
[]
[]
[]
[]
(modules/combined/tutorials/introduction/thermal_mechanical/thermomech_step01.i)Materials
Material properties must be defined for both the thermal and mechanical models. For the thermal model, the thermal conductivity, specific heat, and density are needed. For the mechanical model, the elasticity tensor, thermal eigenstrain, and stress are computed. The models listed here are essentially a combination of the models that were used for the single-physics thermal and mechanical models.
[Materials<<<{"href": "../../../../syntax/Materials/index.html"}>>>]
[thermal]
type = HeatConductionMaterial<<<{"description": "General-purpose material model for heat conduction", "href": "../../../../source/materials/HeatConductionMaterial.html"}>>>
thermal_conductivity<<<{"description": "The thermal conductivity value"}>>> = 45.0
specific_heat<<<{"description": "The specific heat value"}>>> = 0.5
[]
[density]
type = GenericConstantMaterial<<<{"description": "Declares material properties based on names and values prescribed by input parameters.", "href": "../../../../source/materials/GenericConstantMaterial.html"}>>>
prop_names<<<{"description": "The names of the properties this material will have"}>>> = 'density'
prop_values<<<{"description": "The values associated with the named properties"}>>> = 8000.0
[]
[elasticity]
type = ComputeIsotropicElasticityTensor<<<{"description": "Compute a constant isotropic elasticity tensor.", "href": "../../../../source/materials/ComputeIsotropicElasticityTensor.html"}>>>
youngs_modulus<<<{"description": "Young's modulus of the material."}>>> = 1e9
poissons_ratio<<<{"description": "Poisson's ratio for the material."}>>> = 0.3
[]
[expansion1]
type = ComputeThermalExpansionEigenstrain<<<{"description": "Computes eigenstrain due to thermal expansion with a constant coefficient", "href": "../../../../source/materials/ComputeThermalExpansionEigenstrain.html"}>>>
temperature<<<{"description": "Coupled temperature"}>>> = T
thermal_expansion_coeff<<<{"description": "Thermal expansion coefficient"}>>> = 0.001
stress_free_temperature<<<{"description": "Reference temperature at which there is no thermal expansion for thermal eigenstrain calculation"}>>> = 300
eigenstrain_name<<<{"description": "Material property name for the eigenstrain tensor computed by this model. IMPORTANT: The name of this property must also be provided to the strain calculator."}>>> = thermal_expansion
[]
[stress]
type = ComputeFiniteStrainElasticStress<<<{"description": "Compute stress using elasticity for finite strains", "href": "../../../../source/materials/ComputeFiniteStrainElasticStress.html"}>>>
[]
[]
(modules/combined/tutorials/introduction/thermal_mechanical/thermomech_step01.i)BCs
Boundary conditions must be prescribed for the individual physics in the same way that they are for single-physics models. The variable
parameter in each of these boundary condition blocks defines the variable that the boundary condition is applied to.
[BCs<<<{"href": "../../../../syntax/BCs/index.html"}>>>]
[t_left]
type = DirichletBC<<<{"description": "Imposes the essential boundary condition $u=g$, where $g$ is a constant, controllable value.", "href": "../../../../source/bcs/DirichletBC.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = T
value<<<{"description": "Value of the BC"}>>> = 300
boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = 'left'
[]
[t_right]
type = FunctionDirichletBC<<<{"description": "Imposes the essential boundary condition $u=g(t,\\vec{x})$, where $g$ is a (possibly) time and space-dependent MOOSE Function.", "href": "../../../../source/bcs/FunctionDirichletBC.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = T
function<<<{"description": "The forcing function."}>>> = '300+5*t'
boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = 'right'
[]
[pin_x]
type = DirichletBC<<<{"description": "Imposes the essential boundary condition $u=g$, where $g$ is a constant, controllable value.", "href": "../../../../source/bcs/DirichletBC.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = disp_x
boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = pin
value<<<{"description": "Value of the BC"}>>> = 0
[]
[bottom_y]
type = DirichletBC<<<{"description": "Imposes the essential boundary condition $u=g$, where $g$ is a constant, controllable value.", "href": "../../../../source/bcs/DirichletBC.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = disp_y
boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = bottom
value<<<{"description": "Value of the BC"}>>> = 0
[]
[]
(modules/combined/tutorials/introduction/thermal_mechanical/thermomech_step01.i)Preconditioning
The Preconditioning
block is used here to define that a full matrix with coupling between all variables is used for preconditioning. This is more memory intensive than the default block-diagonal matrix, but typically results in improved convergence for multiphysics models.
The remaining blocks (Executioner
and Outputs
) are the same as they would be for single-physics models in this case.
Questions
Where is coupling introduced between the thermal and mechanical solutions in this model?
Once you've answered the questions and run this example we will move on to Step 2 in which we introduce a third block participating in the contact problem.