Smith  0.1
Smith is an implicit thermal structural mechanics simulation code.
Public Types | Public Member Functions | Public Attributes | List of all members
smith::ThermalSystem< dim, temp_order, TemperatureTimeRule, Coupling > Struct Template Reference

Container for a thermal system with configurable time integration. More...

#include <thermal_system.hpp>

Collaboration diagram for smith::ThermalSystem< dim, temp_order, TemperatureTimeRule, Coupling >:
Collaboration graph
[legend]

Public Types

using ThermalWeakFormType = FunctionalWeakForm< dim, H1< temp_order >, detail::TimeRuleParams< TemperatureTimeRule, H1< temp_order >, Coupling > >
 Thermal weak form: (temp, temp_old, coupling_fields..., params...)
 

Public Member Functions

template<typename MaterialType >
void setMaterial (const MaterialType &material, const std::string &domain_name)
 Set the thermal material model for a domain. More...
 
template<typename MaterialType >
void setMaterialAndHeatSource (const MaterialType &material, const std::string &domain_name)
 Set thermal material and a coincident body heat source from a single callable. More...
 
template<typename HeatSourceType >
void addHeatSource (const std::string &domain_name, HeatSourceType source_function)
 Add a body heat source that depends on all state and parameter fields. More...
 
template<typename HeatFluxType >
void addHeatFlux (const std::string &boundary_name, HeatFluxType flux_function)
 Add a boundary heat flux that depends on all state and parameter fields. More...
 
void setTemperatureBC (const Domain &domain)
 Set zero-temperature Dirichlet BC.
 
template<typename AppliedTemperatureFunction >
void setTemperatureBC (const Domain &domain, AppliedTemperatureFunction f)
 Set temperature BC with a prescribed function.
 
 SystemBase ()=default
 Construct an empty system shell.
 
 SystemBase (std::shared_ptr< FieldStore > fs, std::shared_ptr< SystemSolver > sol=nullptr, std::vector< std::shared_ptr< WeakForm >> wfs={})
 Construct a system from a field store, solver, and weak forms. More...
 
- Public Member Functions inherited from smith::SystemBase
 SystemBase ()=default
 Construct an empty system shell.
 
 SystemBase (std::shared_ptr< FieldStore > fs, std::shared_ptr< SystemSolver > sol=nullptr, std::vector< std::shared_ptr< WeakForm >> wfs={})
 Construct a system from a field store, solver, and weak forms. More...
 
virtual std::vector< FieldStatesolve (const TimeInfo &time_info) const
 Solve the system using the internal weak_forms and solver. More...
 
virtual std::vector< ReactionStatecomputeReactions (const TimeInfo &time_info, const std::vector< FieldState > &states_for_reactions) const
 Compute reactions after solving the main state. More...
 

Public Attributes

std::shared_ptr< ThermalWeakFormTypethermal_weak_form
 Thermal weak form.
 
std::shared_ptr< DirichletBoundaryConditionstemperature_bc
 Temperature boundary conditions.
 
std::shared_ptr< TemperatureTimeRule > temperature_time_rule
 Time integration for temperature.
 
std::shared_ptr< const Coupling > coupling
 Coupling metadata for callback interpolation.
 
- Public Attributes inherited from smith::SystemBase
std::vector< std::shared_ptr< WeakForm > > weak_forms
 Weak forms solved together by this system.
 
std::shared_ptr< FieldStorefield_store
 Field store managing the system's fields.
 
std::shared_ptr< SystemSolversolver
 The solver for the system.
 
std::vector< std::shared_ptr< SystemBase > > cycle_zero_systems
 
std::vector< std::shared_ptr< SystemBase > > post_solve_systems
 Optional systems solved after main state update.
 
std::vector< std::string > solve_result_field_names
 Optional per-weak-form fields to solve/update instead of reaction fields.
 
std::vector< std::vector< std::string > > solve_input_field_names
 Optional per-weak-form input field ordering used during solve.
 

Detailed Description

template<int dim, int temp_order, typename TemperatureTimeRule = QuasiStaticFirstOrderTimeIntegrationRule, typename Coupling = std::tuple<>>
struct smith::ThermalSystem< dim, temp_order, TemperatureTimeRule, Coupling >

Container for a thermal system with configurable time integration.

Always uses a 2-state field layout (temperature_solve_state, temperature). Use QuasiStaticFirstOrderTimeIntegrationRule for steady-state problems, or BackwardEulerFirstOrderTimeIntegrationRule for transient problems.

Template Parameters
dimSpatial dimension.
temp_orderOrder of the temperature basis.
TemperatureTimeRuleTime integration rule type (must have num_states == 2).
CouplingTuple of coupling and parameter packs (default: none). Coupling fields occupy leading positions in the tail after the 2 time-rule state fields, before user parameter_space fields.

Definition at line 43 of file thermal_system.hpp.

Member Function Documentation

◆ addHeatFlux()

template<int dim, int temp_order, typename TemperatureTimeRule = QuasiStaticFirstOrderTimeIntegrationRule, typename Coupling = std::tuple<>>
template<typename HeatFluxType >
void smith::ThermalSystem< dim, temp_order, TemperatureTimeRule, Coupling >::addHeatFlux ( const std::string &  boundary_name,
HeatFluxType  flux_function 
)
inline

Add a boundary heat flux that depends on all state and parameter fields.

Parameters
boundary_nameThe name of the boundary where the heat flux is applied.
flux_function(t_info, X, n, T, params...) -> heat_flux.

Definition at line 146 of file thermal_system.hpp.

◆ addHeatSource()

template<int dim, int temp_order, typename TemperatureTimeRule = QuasiStaticFirstOrderTimeIntegrationRule, typename Coupling = std::tuple<>>
template<typename HeatSourceType >
void smith::ThermalSystem< dim, temp_order, TemperatureTimeRule, Coupling >::addHeatSource ( const std::string &  domain_name,
HeatSourceType  source_function 
)
inline

Add a body heat source that depends on all state and parameter fields.

Parameters
domain_nameThe name of the domain where the heat source is applied.
source_function(t_info, X, T, params...) -> heat_source.

Definition at line 126 of file thermal_system.hpp.

◆ setMaterial()

template<int dim, int temp_order, typename TemperatureTimeRule = QuasiStaticFirstOrderTimeIntegrationRule, typename Coupling = std::tuple<>>
template<typename MaterialType >
void smith::ThermalSystem< dim, temp_order, TemperatureTimeRule, Coupling >::setMaterial ( const MaterialType &  material,
const std::string &  domain_name 
)
inline

Set the thermal material model for a domain.

Material is called as material(t_info, temperature, grad_temperature, params...) and must return smith::tuple{heat_capacity, heat_flux}. Consistent with heat_transfer.hpp convention.

The system forms the residual as: heat_capacity * dT/dt for the source term, and -heat_flux for the flux term.

Template Parameters
MaterialTypeThe thermal material type.
Parameters
materialThe material model instance.
domain_nameThe name of the domain to apply the material to.

Definition at line 71 of file thermal_system.hpp.

◆ setMaterialAndHeatSource()

template<int dim, int temp_order, typename TemperatureTimeRule = QuasiStaticFirstOrderTimeIntegrationRule, typename Coupling = std::tuple<>>
template<typename MaterialType >
void smith::ThermalSystem< dim, temp_order, TemperatureTimeRule, Coupling >::setMaterialAndHeatSource ( const MaterialType &  material,
const std::string &  domain_name 
)
inline

Set thermal material and a coincident body heat source from a single callable.

The callable is invoked once per quadrature point and must return smith::tuple{heat_capacity, heat_flux, heat_source}. Used by coupled physics (e.g. thermo-mechanics) where one material evaluation produces all three contributions and we want to avoid re-evaluating the material for each piece.

Residual contribution: (heat_capacity * dT/dt - heat_source, -heat_flux).

Template Parameters
MaterialTypeThe thermal material type.
Parameters
materialThe material model instance returning {C_v, q, s}.
domain_nameThe name of the domain to apply the material to.

Definition at line 103 of file thermal_system.hpp.

◆ SystemBase()

template<int dim, int temp_order, typename TemperatureTimeRule = QuasiStaticFirstOrderTimeIntegrationRule, typename Coupling = std::tuple<>>
smith::SystemBase::SystemBase
inlineexplicit

Construct a system from a field store, solver, and weak forms.

Parameters
fsField store shared by all weak forms.
solSolver used for solve.
wfsWeak forms owned by this system.

Definition at line 76 of file system_base.hpp.


The documentation for this struct was generated from the following file: