Skip to content

Implementing thermal solver

Vicente Mataix Ferrándiz edited this page Jun 5, 2018 · 16 revisions

The following tutorial will explain how to implement a Solver from scratch, in this case applied to the particular case of the thermal problem, following the lines of the already presented on the other tutorials. We will skip the most advanced points of the construction of the Solver and we will create a basic working solver for the sake of academic purposes, so the resulting file will not coincide with the real solver on the repository.

Imports

The solver as any element of Kratos requires to import the corresponding libraries and applications. Like out objective on mind is to create a thermal problem, we will import the base KratosMultiphysics library as well as the ConvectionDiffusionApplication. For importing files from the filesystem we will import os python library, which will be helpful.

from __future__ import print_function, absolute_import, division  # makes KratosMultiphysics backward compatible with python 2.6 and 2.7

# Importing the Kratos Library
import KratosMultiphysics

# Check that applications were imported in the main script
KratosMultiphysics.CheckRegisteredApplications("ConvectionDiffusionApplication")

# Import applications
import KratosMultiphysics.ConvectionDiffusionApplication as ConvectionDiffusionApplication

# Other imports
import os

Constructing the solver

We will create a Solver, following was is done in other applications Solver, for the sake of conssitency, so in first place we define

Project information

Getting Started

Tutorials

Developers

Kratos structure

Conventions

Solvers

Debugging, profiling and testing

HOW TOs

Utilities

Kratos API

Kratos Structural Mechanics API

Clone this wiki locally