-
Notifications
You must be signed in to change notification settings - Fork 275
Running an example from GiD
This first tutorial is intended to serve as a base for the rest of practical exercises of the course. Based on a simplified high-rise building design, a Computational Fluid Dynamics (CFD) case solving the flow around the building, a Computational Structural Mechanics (CSM) case solving the mechanics of an ideal representation of the building and a Fluid-Structure Interaction (FSI) coupling are presented.
To do that, the GiD pre and post-processor together with its Kratos Multiphysics Graphical User Interface (GUI) are used.
Since the aim of this Workshop course is to learn the basics Kratos Multiphysics usage all the examples required to follow this tutorial have been already included as a part of the interface so they can be automatically generated by just clicking on its corresponding button.
First of all it is needed to have GiD installed in your machine. The installer of Windows and Linux official versions can be downloaded from this link.
Provided that you have already installed GiD, Kratos Multiphysics can be obtained using GiD internet retrieve tool. To do that, search for Data tab in the top toolbar and click on Data → Problem type → Kratos to start the download.
Once it is finished, you will have the Kratos Multiphysics GiD GUI together with a pre-compiled version of the current release, which allows to run the cases directly from GiD.
To set a CFD problem we firstly need to load the Kratos GiD GUI. This is done by doing the previous sequence of commands Data → Problem type → Kratos in the top toolbar. Then the Kratos application market will appear in where the Fluid application must be selected.
After this, the fluid dynamics application market will appear. Among all the fluid related applications in Kratos, we will select the standard body-fitted Navier-Stokes CFD application by clicking on the Fluid button again.
Finally we select the domain size by clicking on the 2D icon.
Now that we are in the 2D CFD interface we can load the predefined high-rise building example. To do that, it is only needed to click on the image below highlighted button to automatically generate the case.
(this case can be also retrieved from this link)
After loading the case, the interface will look as the image below.
The most important features in the previous image are:
LEFT SIDE:
- Strategy selection: Monolithic or Fractional Step (in CSM problems dynamic, quasi-static, static)
- Material settings: Selection of the fluid domain surface and its physical properties
- Boundary Conditions time intervals: Default and custom time intervals for the BCs application
- Boundary Conditions: List of BCs (varies depending on the problem to solve)
- Solver settings: Problem settings according to the selected strategy (e.g. convergence criteria, maximum iterations, linear solver type, time step, ...)
RIGHT SIDE:
- Groups list: Can be brought up by clicking the groups tab. It lists the groups, which contain the geometrical entities that define the problem domain and BCs (be careful are not the same as layers!)
- Group check: By clicking this button the contained entities in the selected group are highlighted.
Before meshing the problem, GiD will ask to save it, so save the case as usual by doing Files → Save.
Once the case has been saved, it is time to mesh it. To simplify things, this predefined example already contains suitable mesh settings, which can be of course customized. The default mesh settings can be checked by doing Mesh → Draw → Sizes → All types.
For the sake of simplicity, we will assume this predefined mesh settings to be good enough. Thus, the problem can be meshed by doing Mesh → Generate mesh (Ctrl + G). A pop-up window asking for the mesh size will appear. Since we have the predefined mesh sizes, any number can be put in this window as such predefined settings prevail over it.
Finally, the problem is run by clicking on the rocket button (or Calculate → Calculate (F5)). In the folder in where we have saved the case, the next Kratos source files will appear:
- *.mdpa: File containing the mesh geometry
- ProjectParameters.json: File containing the problem settings and BCs
- MainKratos.py: Main script to run the simulation
- (eventually *Materials.json: File containing the material properties. Only used in some applications (e.g. StructuralMechanicsAplication)
(in the next exercises of the course we will play around with these source files)
The terminal output can be check by clicking the i button below the rocket (or Calculate → View process info..). In case it is needed, the simulation can be interrupted by clicking the red cross button (or Calculate → Cancel process).
Once the simulation is finished, a new pop-up window reporting it will appear. We can directly access to the post-process by clicking on either the Postprocess button of such pop-up window or the rainbow button in the top right part of the screen (see the image below).
- Say how to see contour fields and vector fields
(briefly since it is similar to the previous)
- Use the predefined example
- Explain the geometry and domain parts
- Explain the boundary conditions
- Explain the solver settings
(briefly since it is similar to the previous)
- Use the predefined example
- Explain the tree as a coupling of both previous tree plus the coupling stuff
We have shown how to set some examples with the GiD GUI. There are more predefined examples to serve as example of other multiphysics problems in the GUI. To set or import custom geometries, we refer to GiD user manual (put the link) There are other post processors that can be used.
- 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