How To: Simulation Scenarios¶
Simulation Setup¶
Scenario Setup using
ScenarioDescriptorLinear Elasticity scenario is created using
LinearElasticScenarioDescriptor. It takes the following inputs:boundary_conditions, a list of boundary conditionsinternal_conditions, a list of internal conditions (body loads)
Scenario Metadata,
metadata, a set of solver parameters to control the accuracy and speed of the simulation:resolutionis the target number of finite elements. An iterative process determines acell_sizethat achieves approximately the specified number of elements. You can directly specify thecell_sizeinstead ofresolution. Note that decreasingcell_sizecan quickly result in large numbers of finite elements and long solve times.resolutionis recommended for most cases.unitssets the unit of the scenario (geometry and results will be in this unit) for example, a geometry in ‘MKS’ that is 6 m long would be 6 mm long when set to ‘MMS’basis_orderis the type of finite element used. The default is 1, which would be linear elements. 2 is for quadratic elements.solver_typeis the solver type used in the simulation with the following options:MKL_PardisoLDLT(default) is the direct solver and is typically faster for lower resolution (< 200K cells on 32 GB memory), but gets slower and consumes more memory at higher resolutionsAMGCL_amg_rigid_bodyis the iterative solver which is typically faster at high resolution.
Intact::LinearElasticScenarioDescriptor scenario; scenario.materials = {{"Aluminum 6061-T6": material}}; scenario.boundary_conditions = {fixed_boundary, vector_load, torque_load}; scenario.internal_conditions = {body_load}; scenario.metadata.resolution = 10000; scenario.metadata.units = Intact::UnitSystem::MeterKilogramSecond; // Optional settings scenario.metadata.basis_order = 2; // 2 = quadratic elements scenario.metadata.solver_override = Intact::SolverType::AMGCL_amg_rigid_body; // iterative solver
Similarly, Modal scenario is created using
ModalScenarioDescriptorwhich takesboundary_conditions, a list of boundary conditions, as input.The
metadatais the same as for the linear elastic scenario except there is necessary inputmetadata.desired_eigenvaluesthat takes in an integer for the number of eigenvalues.
// Setup the modal simulation scenario Intact::ModalScenarioDescriptor modal_scenario; modal_scenario.materials = {{"Aluminum 6061-T6": material}}; modal_scenario.boundary_conditions = {fixed_boundary}; modal_scenario.metadata.resolution = 10000; modal_scenario.modal_metadata.desired_eigenvalues = 10; // Optional settings modal_scenario.metadata.basis_order = 2; // 2 = quadratic elements modal_scenario.metadata.solver_override = Intact::SolverType::AMGCL_amg_rigid_body; // iterative solver
Similarly, Linear Buckling scenario is created using
LinearBucklingScenarioDescriptorwhich takesboundary_conditions, a list of boundary conditions, as input.The
metadatais the same as for the linear elastic scenario except there is necessary inputbuckling_metadata.desired_eigenvaluesthat takes in an integer for the number of eigenvalues. Typically, the number of desired eigenvalues is small, less than 5. A linear buckling scenario first performs a linear elasticity simulation, and then solves a generalized eigenvalue problem to determine the critical load factors.
// Setup the linear buckling simulation scenario Intact::LinearBucklingScenarioDescriptor buckling_scenario; buckling_scenario.materials = {{"Aluminum 6061-T6": material}}; buckling_scenario.boundary_conditions = {fixed_boundary, vector_load}; buckling_scenario.metadata.resolution = 10000; buckling_scenario.buckling_metadata.desired_eigenvalues = 10; // Optional settings buckling_scenario.metadata.basis_order = 1; // linear elements buckling_scenario.metadata.solver_override = Intact::SolverType::AMGCL_amg_rigid_body; // iterative solver
Similarly, a thermal scenario is created using
StaticThermalScenarioDescriptorwhich takes a list ofboundary_conditionsand a list ofinternal_conditionsas input. Note that thematerialmust be a thermal material for this scenario type.The
metadatais the same as for the linear elastic scenario with additional inputmetadata.environment_temperaturewhich specifies the temperature of the environment.
// Setup the thermal simulation scenario StaticThermalScenarioDescriptor thermal_scenario; thermal_scenario.materials = {{"Aluminum 6061-T6": material}}; thermal_scenario.boundary_conditions = {fixed_temp, convection}; thermal_scenario.internal_conditions = {constant_heat}; thermal_scenario.thermal_metadata.environment_temperature = 300.0; thermal_scenario.metadata.resolution = 10000; // Optional settings thermal_scenario.metadata.basis_order = 2; // 2 = quadratic elements thermal_scenario.metadata.solver_override = Intact::SolverType::AMGCL_amg; // iterative solver for thermal scenarios.
A thermoelasticity scenario is created by creating a
StaticThermalScenarioDescriptor, solving the static thermal scenario using aStaticThermalSimulator, then creating aLinearElasticScenarioDescriptorand solving the thermoelasticity scenario using aStressSimulatorthat takes aStaticThermalSimulatorargument, as shown in the following snippet:
static const int RESOLUTION = 10000; // Setup the thermal simulation scenario StaticThermalScenarioDescriptor thermal_scenario; thermal_scenario.materials = {{"Aluminum 6061-T6": material}}; thermal_scenario.boundary_conditions = {fixed_temp, convection}; thermal_scenario.internal_conditions = {constant_heat}; thermal_scenario.thermal_metadata.environment_temperature = 300.0; thermal_scenario.metadata.resolution = RESOLUTION; // Solve the static thermal scenario Intact::StaticThermalSimulator thermal_simulator = StaticThermalSimulator(assembly, thermal_scenario); thermal_simulator.solve(); // Set up the elastic scenario Intact::LinearElasticScenarioDescriptor scenario; scenario.materials = {{"Aluminum 6061-T6": material}}; scenario.boundary_conditions = {fixed_boundary, vector_load, torque_load}; scenario.internal_conditions = {body_load}; scenario.metadata.resolution = RESOLUTION; // Solve the thermoelasticity scenario Intact::StressSimulator simulator = StressSimulator(assembly, scenario, thermal_simulator); simulator.solve();
For best results, the thermal scenario resolution should be the same or less than the stress scenario resolution. Using the same resolution ensures that the thermal fields are defined every where the stress simulation will be performed.
Simulation Solution¶
Stress Simulation is created using
StressSimulator. It takes the following inputs:An
assemblyor the list ofMaterialDomainsLinearElasticScenarioDescriptorthat describes the simulation scenario
// Initialize and run the linear elastic scenario Intact::StressSimulator simulator = StressSimulator(assembly, scenario); simulator.solve();
Modal Simulation is created using
ModalSimulator. It takes the following inputs:An
assemblyor the list ofMaterialDomainsModalScenarioDescriptorthat describes the simulation scenario
// Initialize and run the modal scenario Intact::ModalSimulator modal_simulator = ModalSimulator(assembly, modal_scenario); modal_simulator.solve();
Linear Buckling Simulation is created using
LinearBucklingSimulator. It takes the following inputs:An
assemblyor the list ofMaterialDomainsLinearBucklingScenarioDescriptorthat describes the simulation scenario
// Initialize and run the linear buckling scenario Intact::LinearBucklingSimulator buckling_simulator = LinearBucklingSimulator(assembly, buckling_scenario); buckling_simulator.solve();
Static Thermal Simulation is created using
StaticThermalSimulator. It takes the following inputs:An
assemblyor the list ofMaterialDomainsStaticThermalScenarioDescriptorthat describes the simulation scenario
// Initialize and run the static thermal scenario Intact::StaticThermalSimulator thermal_simulator = StaticThermalSimulator(assembly, thermal_scenario); thermal_simulator.solve();