TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Simpler_Base.h
1/****************************************************************************
2* Copyright (c) 2026, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16#ifndef Simpler_Base_included
17#define Simpler_Base_included
18
19#include <Solveur_non_lineaire.h>
20#include <Parametre_implicite.h>
21#include <TRUSTTabs_forward.h>
22#include <Nom.h>
23
26class Equation_base;
27class Matrice_Morse;
28class Matrice;
29class Sources;
30class Motcle;
31
32//Description
33//
34// Base class for implicit equation solvers.
35// The equation is discretised as:
36// (M/dt + C(U) + D)Xn+1 = Sv + Ss + (M/dt)Xn
37// where
38// C(U) convection matrix
39// D diffusion matrix
40// M mass matrix
41// Sv volumetric source term
42// Ss surface source term (Neumann condition)
43// Xn and Xn+1 denote the unknown at times tn and tn+1 respectively
44//
45// At each time step (tn) we solve the following system:
46// A[Xk] = b[Xk]
47// with
48// A[Xk] = (M/dt + C(Uk) + D)
49// b[Xk] = Sv + Ss + (M/dt)Xk
50// k denotes an iteration index for the iterative resolution of the matrix system (tn fixed)
51
52// The resolution method used to determine X is a fixed-point method:
53// Set f(Xk) = A[Xk]Xk - b[Xk] so that the solution Xsol satisfies f(Xsol) = 0
54// A first-order Taylor expansion gives:
55// Xk - Xk+1 = f(Xk)/f'(Xk)
56// Making the hypothesis f' = A (not strictly true for the convection part)
57// the system becomes: A[Xk](Xk-Xk+1) = f(Xk) or equivalently
58// A[Xk]Xk+1 = A[Xk]Xk - (A[Xk]Xk-Ss) + Sv +(M/dt)Xk
59//
60//
61// Method iterer_eqn() for equations other than Navier-Stokes:
62// - builds the matrix (matrice) and right-hand side (resu) from the equation (assembler_avec_inertie(...))
63// - triggers the matrix system resolution (le_solveur_.resoudre_systeme(...))
64
65// Method iterer_NS() called by iterer_eqn() for the specific case of the Navier-Stokes equation.
66// Available algorithms: Simple - Simpler - Piso - Implicite
67// See subclasses of Simpler_base for descriptions of the respective algorithms.
68
69
71{
72 Declare_base_sans_constructeur(Simpler_Base);
73
74public :
75
76 inline int max_iter_implicite();
77 inline int max_iter_implicite() const;
78
79 bool iterer_eqn(Equation_base& equation, const DoubleTab& inconnue, DoubleTab& result, double dt, int numero_iteration, int& ok) override =0;
80
81 virtual void iterer_NS(Equation_base&, DoubleTab& current, DoubleTab& pression, double, Matrice_Morse&, double, DoubleTrav&,int nb_iter,int& converge, int& ok)=0;
82
83 void assembler_matrice_pression_implicite(Equation_base& eqn_NS,const Matrice_Morse& matrice,Matrice& matrice_en_pression_2);
84
85protected :
86
89
90 Entree& lire(const Motcle&, Entree&) override;
91 int get_controle_residu() const override { return controle_residu_; }
92};
93
94#endif
class Equation_base The role of an equation is the calculation of one or more fields....
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
Matrice class - Generic class in the matrix hierarchy.
Definition Matrice.h:34
A character string (Nom) in uppercase.
Definition Motcle.h:26
friend class Entree
Definition Objet_U.h:71
class Schema_Temps_base
Entree & lire(const Motcle &, Entree &) override
int max_iter_implicite() const
virtual void iterer_NS(Equation_base &, DoubleTab &current, DoubleTab &pression, double, Matrice_Morse &, double, DoubleTrav &, int nb_iter, int &converge, int &ok)=0
int max_iter_implicite()
void assembler_matrice_pression_implicite(Equation_base &eqn_NS, const Matrice_Morse &matrice, Matrice &matrice_en_pression_2)
double facsec_diffusion_for_sets_
int get_controle_residu() const override
bool iterer_eqn(Equation_base &equation, const DoubleTab &inconnue, DoubleTab &result, double dt, int numero_iteration, int &ok) override=0
class Solveur_non_lineaire
class Sources Sources represents a list of Source objects.
Definition Sources.h:31