-
Notifications
You must be signed in to change notification settings - Fork 247
Multiphysics example
The main goal is to become familiar with key aspects of multiphysics simulations using a prototypical example. The chosen problem is a case of fluid-structure interaction. One should become familiar with the various components involved in setting up and running such simulations, as well as the necessary steps to ensure the quality and physical relevance of results.
The first example will be used in a black-box manner to discuss the most important details related to setting up such cases and the corresponding parameters. The second example depicts how one could create own - so customized - mapping and solvers to further enhance existing capabilities.
Suggestion: as soon as you are here, you should download the source files and start running the respective simulations from the command line as explained in Kratos input files and IO (section 2.2: Run Kratos from the command line) . As there are 2 examples intended to be shown, it would be sufficient if every other person would run one and the remaining participants the other, preferably in groups of two.
- Simulation 1: in '6_multiphysics\FSIBlackboxGeneric\MainKratos.py'
- Simulation 2: in '6_multiphysics\FSICustomizedSDoFVortexShedding\MainKratosFSI.py'
The discussion relies on the examples discussed in Running an example from GiD. Here it was shown how a CFD (section 3) and a CSM (section 4) can be set up and run. Additionally, in section 5 an FSI example was provided which builds upon the CFD and CSM setups.
For this you should download and refer to the input files for the respective case.
The main components of this certain multiphysics case - an FSI simulation - are:
- the CFD "simulation": model part
KratosWorkshop2019_high_rise_building_FSI_Fluid.mdpa
and respective settings"structure_solver_settings"
- the CSM "simulation" : model part
KratosWorkshop2019_high_rise_building_FSI_Structural.mdpa
and respective settings"fluid_solver_settings"
The settings are now all contained in one file, the ProjectParameters.json
:
"solver_settings" : {
"solver_type" : "Partitioned",
"coupling_scheme" : "DirichletNeumann",
"echo_level" : 1,
"structure_solver_settings" : {...},
"fluid_solver_settings" : {...},
"mesh_solver_settings" : {...},
"coupling_settings" : {...}
As it can be observed that there are more settings blocks, as additional components are needed to enable the proper functioning.
- the solver type: when referring to multiphysics simulations, one generally tries to deal with a complex problem, which can be solved in various manners: either monolithic (which leads to one large system to be solved) or partitioned (which implies splitting up the problem into dedicated fields, dealing with these separately and ensuring proper data transfer and convergence
adapted from: W.G. Dettmer: On Partitioned Solution Strategies for Computational Fluid-Structure Interaction
- the coupling scheme: here a Dirichlet-Neumann-type coupling is used, which specifies which values are affected by the mapping, more precisely for this case: the CFD simulation results in fluid forces on the respective structure interface, these forces being transferred (mapped) onto the structure and serving as the right hand side (RHS - or force vector), so as a Neumann boundary condition for the CSM; the CSM solve results in the deformation of the structural model, the deformations from the boundary to the fluid are transferred (mapped) onto the CFD domain, these deformations serving affecting the left hand side (LHS - or the vector of primary variables) for the pseudo-structural problem (refer to the next point of the mesh solver), constituting a Dirichlet boundary condition
- the mesh solver and its settings: this builds upon the existing parts of the CFD (see the provided
"model_part_name"
) and is responsible for deforming the CFD mesh in order to consistently match the deformations on the interface of the fluid to the structure, which is done using a pseudo-structural formulation (hinted by the naming of the"solver_type"
) , as the mesh deformations are solved as if this was a structural mechanics problem with prescribed deformations on the respective boundary
"mesh_solver_settings" : {
"echo_level" : 0,
"domain_size" : 2,
"model_part_name" : "FluidModelPart",
"solver_type" : "structural_similarity"
},
- the coupling and its settings: coupling the above solver is done in an partitioned manner using iterations to lead to convergence; it is important to note the
"mapper_settings"
, which is responsible for providing the necessary information to setup and carry out the mapping (transfer) of necessary data fields;"coupling_strategy_settings"
defines the way the inner iterations are done to achieve convergence at the interface; additionally the correct sub model parts need to provided -"structure_interfaces_list"
and"fluid_interfaces_list"
"coupling_settings" : {
"nl_tol" : 1e-6,
"nl_max_it" : 15,
"solve_mesh_at_each_iteration" : true,
"mapper_settings" : [{
"mapper_face" : "unique",
"fluid_interface_submodelpart_name" : "FluidNoSlipInterface2D_InterfaceFluid",
"structure_interface_submodelpart_name" : "StructureInterface2D_InterfaceStructure"
}],
"coupling_strategy_settings" : {
"solver_type" : "Relaxation",
"acceleration_type" : "Aitken",
"w_0" : 0.825
},
"structure_interfaces_list" : ["StructureInterface2D_InterfaceStructure"],
"fluid_interfaces_list" : ["FluidNoSlipInterface2D_InterfaceFluid"]
}
- Getting Kratos (Last compiled Release)
- Compiling Kratos
- Running an example from GiD
- Kratos input files and I/O
- Data management
- Solving strategies
- Manipulating solution values
- Multiphysics
- Video tutorials
- Style Guide
- Authorship of Kratos files
- Configure .gitignore
- How to configure clang-format
- How to use smart pointer in Kratos
- How to define adjoint elements and response functions
- Visibility and Exposure
- Namespaces and Static Classes
Kratos structure
Conventions
Solvers
Debugging, profiling and testing
- Compiling Kratos in debug mode
- Debugging Kratos using GDB
- Cross-debugging Kratos under Windows
- Debugging Kratos C++ under Windows
- Checking memory usage with Valgind
- Profiling Kratos with MAQAO
- Creating unitary tests
- Using ThreadSanitizer to detect OMP data race bugs
- Debugging Memory with ASAN
HOW TOs
- How to create applications
- Python Tutorials
- Kratos For Dummies (I)
- List of classes and variables accessible via python
- How to use Logger
- How to Create a New Application using cmake
- How to write a JSON configuration file
- How to Access DataBase
- How to use quaternions in Kratos
- How to do Mapping between nonmatching meshes
- How to use Clang-Tidy to automatically correct code
- How to use the Constitutive Law class
- How to use Serialization
- How to use GlobalPointerCommunicator
- How to use PointerMapCommunicator
- How to use the Geometry
- How to use processes for BCs
- How to use Parallel Utilities in futureproofing the code
- Porting to Pybind11 (LEGACY CODE)
- Porting to AMatrix
- How to use Cotire
- Applications: Python-modules
- How to run multiple cases using PyCOMPSs
- How to apply a function to a list of variables
- How to use Kratos Native sparse linear algebra
Utilities
Kratos API
Kratos Structural Mechanics API