solver.C
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) 2022-2023 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 \*---------------------------------------------------------------------------*/
25 
26 #include "solver.H"
27 #include "localEulerDdtScheme.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
35 }
36 
37 
38 Foam::scalar Foam::solver::deltaTFactor = 1.2;
39 
40 
41 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
42 
43 bool Foam::solver::writeData(Ostream&) const
44 {
46  return false;
47 }
48 
49 
50 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
51 
53 :
55  (
56  IOobject
57  (
58  typeName,
59  mesh.time().timeName(),
60  mesh
61  )
62  ),
63 
64  mesh_(mesh),
65  steady(mesh_.schemes().steady()),
66  LTS(fv::localEulerDdt::enabled(mesh)),
67 
68  fvModelsPtr(nullptr),
69  fvConstraintsPtr(nullptr),
70 
71  mesh(mesh_),
72  runTime(mesh_.time()),
73  pimple(mesh_)
74 {}
75 
76 
77 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
78 
80 {}
81 
82 
83 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
84 
86 {
87  if (!fvModelsPtr)
88  {
89  fvModelsPtr = &Foam::fvModels::New(mesh);
90  }
91 
92  return *fvModelsPtr;
93 }
94 
95 
97 {
98  if (!fvConstraintsPtr)
99  {
100  fvConstraintsPtr = &Foam::fvConstraints::New(mesh);
101  }
102 
103  return *fvConstraintsPtr;
104 }
105 
106 
107 // ************************************************************************* //
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
static autoPtr< dictionary > New(Istream &)
Construct top-level dictionary on freestore from Istream.
Definition: dictionaryIO.C:100
Finite volume constraints.
Definition: fvConstraints.H:62
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Finite volume models.
Definition: fvModels.H:65
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:55
Abstract base class for run-time selectable region solvers.
Definition: solver.H:55
static scalar deltaTFactor
deltaT increase factor
Definition: solver.H:103
virtual ~solver()
Destructor.
Definition: solver.C:79
Foam::fvModels & fvModels() const
Return the fvModels that are created on demand.
Definition: solver.C:85
solver(fvMesh &mesh)
Construct from region mesh.
Definition: solver.C:52
Foam::fvConstraints & fvConstraints() const
Return the fvConstraints that are created on demand.
Definition: solver.C:96
pimpleControl pimple(mesh)
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:353
word timeName
Definition: getTimeIndex.H:3
Namespace for OpenFOAM.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
defineTypeNameAndDebug(combustionModel, 0)
labelList fv(nPoints)