TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Simpler.h
1/****************************************************************************
2* Copyright (c) 2022, 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
17#ifndef Simpler_included
18#define Simpler_included
19#include <Simple.h>
20
21//Description
22
23//Ref. Numerical heat Transfer Vol. 10 P. 209-228
24// D. S. Jang - R. Jetli - S. Acharya
25
26// Pressure convergence in the Simple algorithm (see class Simple) is slow
27// because the off-diagonal terms are neglected when solving the Poisson equation
28// for the pressure correction.
29// The goal of the Simpler algorithm is to compute a more accurate pressure estimate
30// and then apply the Simple algorithm with it.
31
32// A = (M/dt + C(Uk) + D)
33// Bt and -B denote the gradient and divergence operators respectively
34
35// -Pressure estimation
36// First evaluate the velocity field UPk by solving (Da = diagonal part of A, E = off-diagonal part):
37// Da[Uk-1]UPk = E[Uk-1]Uk-1 + Sv + Ss -> UPk
38//
39// The momentum equation can then be written as:
40// Da[Uk-1]Uk = Da[Uk-1]UPk - BtPk
41// Combining this with the continuity equation (-BUk = 0):
42// (BDa-1Bt)Pk = BUPk -> Pk
43//
44//
45// -Applying the Simple algorithm to find the solution (Uk,Pk)
46//
47// (U*k, Pk) satisfies the following momentum equation:
48// A[Uk-1]U*k = -BtPk + Sv + Ss + (M/dt)Uk-1 -> U*k
49//
50// p'k is evaluated by solving:
51// (BDa-1Bt)p'k = BU*k -> p'k
52//
53// The velocity correction u'k is deduced by solving:
54// Da[Uk-1] (Uk-U*k) = -Btp'k -> U'k
55//
56// The pressure field Pk is not modified by the correction p'k,
57// while the velocity is updated by: Uk = U*k + U'k
58//
59// The algorithm can be repeated until convergence ||Uk-Uk-1|| < seuil_convergence_implicite_.
60// In practice, only one iteration is needed (seuil_convergence_implicite_ = 1e6).
61
62// The algorithm coded in this class (iterer_NS) differs slightly from the above description:
63// In the UPk evaluation step:
64// - the pressure gradient is taken into account and the relation becomes:
65// Da[Uk-1]UPk = E[Uk-1]Uk-1 + Sv + Ss - BtPk
66//
67// - solving (BDa-1Bt)Pcor = BUPk gives a pressure correction
68// and the pressure field is updated: Pk = Pk-1 + Pcor
69// (Pcor replaces the notation Pk used above)
70//
71// - resu is readjusted (BtPk = BtPk-1 + BtPcor) to contain -BtPk
72
73class Simpler : public Simple
74{
75
76 Declare_instanciable(Simpler);
77
78public :
79 void iterer_NS(Equation_base&, DoubleTab& current, DoubleTab& pression, double, Matrice_Morse&, double, DoubleTrav&,int nb_iter,int& converge, int& ok) override;
80
81
82
83protected :
84
85
86};
87
88int inverser_par_diagonale(const Matrice_Morse& matrice,const DoubleTrav& resu,const DoubleTab& present,DoubleTrav& correction_en_vitesse);
89
90#endif
91
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,.
Simple()
Definition Simple.cpp:38
void iterer_NS(Equation_base &, DoubleTab &current, DoubleTab &pression, double, Matrice_Morse &, double, DoubleTrav &, int nb_iter, int &converge, int &ok) override
Definition Simpler.cpp:172