Loading...
Searching...
No Matches
incompressiblePrimalSolver.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2007-2023 PCOpt/NTUA
9 Copyright (C) 2013-2023 FOSS GP
10 Copyright (C) 2019 OpenCFD Ltd.
11-------------------------------------------------------------------------------
12License
13 This file is part of OpenFOAM.
14
15 OpenFOAM is free software: you can redistribute it and/or modify it
16 under the terms of the GNU General Public License as published by
17 the Free Software Foundation, either version 3 of the License, or
18 (at your option) any later version.
19
20 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 for more details.
24
25 You should have received a copy of the GNU General Public License
26 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27
28Class
29 Foam::incompressiblePrimalSolver
30
31Description
32 Base class for primal incompressible solvers
33
34\*---------------------------------------------------------------------------*/
35
36#ifndef incompressiblePrimalSolver_H
37#define incompressiblePrimalSolver_H
38
39#include "primalSolver.H"
40#include "incompressibleVars.H"
41
42// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
44namespace Foam
45{
47class objective;
48
49/*---------------------------------------------------------------------------*\
50 Class incompressiblePrimalSolver Declaration
51\*---------------------------------------------------------------------------*/
52
53class incompressiblePrimalSolver
54:
55 public primalSolver
56{
57private:
58
59 // Privare Member Functions
60
61 //- No copy construct
62 incompressiblePrimalSolver(const incompressiblePrimalSolver&) = delete;
63
64 //- No copy assignment
65 void operator=(const incompressiblePrimalSolver&) = delete;
66
67
68protected:
69
70 // Protected data
71
72 //- Convergence criterion for reconstructing phi from U and p
74
75 //- Max iterations for reconstructing phi from U and p
78
79public:
80
81
82 // Static Data Members
83
84 //- Run-time type information
85 TypeName("incompressible");
86
87
88 // Declare run-time constructor selection table
89
91 (
92 autoPtr,
93 incompressiblePrimalSolver,
95 (
96 fvMesh& mesh,
97 const word& managerType,
98 const dictionary& dict,
99 const word& solverName
100 ),
102 );
103
104
105 // Constructors
106
107 //- Construct from mesh and dictionary
108 incompressiblePrimalSolver
109 (
110 fvMesh& mesh,
111 const word& managerType,
112 const dictionary& dict,
113 const word& solverName
114 );
115
116
117 // Selectors
118
119 //- Return a reference to the selected incompressible primal solver
121 (
122 fvMesh& mesh,
123 const word& managerType,
124 const dictionary& dict,
125 const word& solverName
126 );
127
128
129 //- Destructor
130 virtual ~incompressiblePrimalSolver() = default;
131
132
133 // Member Functions
134
135 //- Read dict if updated
136 virtual bool readDict(const dictionary& dict);
137
138
139 // Access
140
141 //- Return the list of objectives assodicated with this solver
143
144 //- Access to the incompressible variables set
145 const incompressibleVars& getIncoVars() const;
146
147 //- Access to the incompressible variables set
149
150
151 // Evolution
152
153 //- Update boundary conditions
154 virtual void correctBoundaryConditions();
155
156
157 // IO
158
159 //- In case of multi-point runs with turbulent flows,
160 //- output dummy turbulence fields with the base names, to allow
161 //- continuation
162 virtual bool write(const bool valid = true) const
163 {
164 if (mesh_.time().writeTime())
165 {
166 return getIncoVars().write();
167 }
168
169 return false;
170 }
171
172 //- In case of multi-point runs with turbulent flows,
173 //- output dummy turbulence fields with the base names, to allow
174 //- continuation
175 virtual bool writeNow() const
176 {
177 return getIncoVars().write();
178 }
179};
180
181
182// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184} // End namespace Foam
185
186// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187
188#endif
189
190// ************************************************************************* //
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition UPtrList.H:101
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
static autoPtr< incompressiblePrimalSolver > New(fvMesh &mesh, const word &managerType, const dictionary &dict, const word &solverName)
Return a reference to the selected incompressible primal solver.
TypeName("incompressible")
Run-time type information.
virtual ~incompressiblePrimalSolver()=default
Destructor.
const incompressibleVars & getIncoVars() const
Access to the incompressible variables set.
virtual bool write(const bool valid=true) const
In case of multi-point runs with turbulent flows, output dummy turbulence fields with the base names,...
virtual bool readDict(const dictionary &dict)
Read dict if updated.
label phiReconstructionIters_
Max iterations for reconstructing phi from U and p.
virtual bool writeNow() const
In case of multi-point runs with turbulent flows, output dummy turbulence fields with the base names,...
scalar phiReconstructionTol_
Convergence criterion for reconstructing phi from U and p.
UPtrList< objective > getObjectiveFunctions() const
Return the list of objectives assodicated with this solver.
virtual void correctBoundaryConditions()
Update boundary conditions.
declareRunTimeSelectionTable(autoPtr, incompressiblePrimalSolver, dictionary,(fvMesh &mesh, const word &managerType, const dictionary &dict, const word &solverName),(mesh, managerType, dict, solverName))
Base class for solution control classes.
bool write() const
Write dummy turbulent fields to allow for continuation in multi-point, turbulent runs.
Abstract base class for objective functions. No point in making this runTime selectable since its chi...
Definition objective.H:58
const word & managerType() const
Return the manager type.
Definition solverI.H:72
const dictionary & dict() const
Return the solver dictionary.
Definition solverI.H:54
const fvMesh & mesh() const
Return the solver mesh.
Definition solverI.H:24
const word & solverName() const
Return the solver name.
Definition solverI.H:30
fvMesh & mesh_
Reference to the mesh database.
Definition solver.H:56
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
runTime write()
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes).
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68