EulerImplicit.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::EulerImplicit
26 
27 Description
28  An Euler implicit solver for chemistry
29 
30  Euler implicit integration based on the reaction rate Jacobian is used to
31  solver for the composition and Euler explicit integration for the
32  temperature. Separating the integration of temperature from composition
33  in this manner is significantly more stable for exothermic systems
34 
35 SourceFiles
36  EulerImplicit.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef EulerImplicit_H
41 #define EulerImplicit_H
42 
43 #include "chemistrySolver.H"
44 #include "simpleMatrix.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class EulerImplicit Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 template<class ChemistryModel>
56 class EulerImplicit
57 :
58  public chemistrySolver<ChemistryModel>
59 {
60  // Private Data
61 
62  //- Chemistry timescale coefficient
63  scalar cTauChem_;
64 
65  //- Field encapsulating the composition, temperature and pressure
66  mutable scalarField cTp_;
67 
68  //- Reaction rate field
69  mutable scalarField R_;
70 
71  //- Reaction Jacobian
72  mutable scalarSquareMatrix J_;
73 
74  //- Euler implicit integration matrix for composition
75  mutable simpleMatrix<scalar> E_;
76 
77 
78 public:
79 
80  //- Runtime type information
81  TypeName("EulerImplicit");
82 
83 
84  // Constructors
85 
86  //- Construct from thermo
88 
89 
90  //- Destructor
91  virtual ~EulerImplicit();
92 
93 
94  // Member Functions
95 
96  //- Update the concentrations and return the chemical time
97  virtual void solve
98  (
99  scalar& p,
100  scalar& T,
101  scalarField& c,
102  const label li,
103  scalar& deltaT,
104  scalar& subDeltaT
105  ) const;
106 };
107 
108 
109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 
111 } // End namespace Foam
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 #ifdef NoRepository
116  #include "EulerImplicit.C"
117 #endif
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 #endif
122 
123 // ************************************************************************* //
An Euler implicit solver for chemistry.
Definition: EulerImplicit.H:58
virtual void solve(scalar &p, scalar &T, scalarField &c, const label li, scalar &deltaT, scalar &subDeltaT) const
Update the concentrations and return the chemical time.
Definition: EulerImplicit.C:61
EulerImplicit(const fluidMulticomponentThermo &thermo)
Construct from thermo.
Definition: EulerImplicit.C:34
TypeName("EulerImplicit")
Runtime type information.
virtual ~EulerImplicit()
Destructor.
Definition: EulerImplicit.C:53
An abstract base class for solving chemistry.
Base-class for multi-component fluid thermodynamic properties.
const dimensionedScalar c
Speed of light in a vacuum.
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
void T(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1)
volScalarField & p
fluidMulticomponentThermo & thermo
Definition: createFields.H:31