equationInitialResidualCondition.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) 2015 OpenFOAM Foundation
9 Copyright (C) 2016-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::functionObjects::runTimeControls::equationInitialResidualCondition
29
30Description
31 Minimum or maximum initial residual run time condition
32
33SourceFiles
34 equationInitialResidualCondition.H
35 equationInitialResidualCondition.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef functionObjects_runTimeControls_equationInitialResidualCondition_H
40#define functionObjects_runTimeControls_equationInitialResidualCondition_H
41
42#include "runTimeCondition.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50class fvMesh;
51
52namespace functionObjects
53{
54namespace runTimeControls
55{
56
57/*---------------------------------------------------------------------------*\
58 Class equationInitialResidualCondition Declaration
59\*---------------------------------------------------------------------------*/
62:
63 public runTimeCondition
64{
65public:
67 enum operatingMode
68 {
69 omMin,
71 };
74
75
76protected:
77
78 // Protected data
79
80 //- Field names
82
83 //- Value to compare
84 const scalar value_;
85
86 //- Start checking from time - always skips first iteration
87 scalar timeStart_;
88
89 //- Operating mode
91
92
93 // Protected Member Functions
94
95 //- Set the residual (scalar) value
96 template<class Type>
97 void setResidual
98 (
99 const fvMesh& mesh,
100 const dictionary& dict,
101 const word& fieldName,
102 const label componenti,
103 bool& canSet,
104 scalar& residual
105 ) const;
106
107
108public:
109
110 //- Runtime type information
111 TypeName("equationInitialResidual");
112
113 //- Constructor
115 (
116 const word& name,
117 const objectRegistry& obr,
118 const dictionary& dict,
120 );
121
122 //- Destructor
123 virtual ~equationInitialResidualCondition() = default;
124
125
126 // Public Member Functions
127
128 //- Apply the condition
129 virtual bool apply();
130
131 //- Write
132 virtual void write();
133
134 //- Reset
135 virtual void reset();
136};
137
138
139// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140
141} // End namespace runTimeControls
142} // End namespace functionObjects
143} // End namespace Foam
144
145// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146
147#ifdef NoRepository
149#endif
150
151// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152
153#endif
154
155// ************************************************************************* //
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
TypeName("equationInitialResidual")
Runtime type information.
void setResidual(const fvMesh &mesh, const dictionary &dict, const word &fieldName, const label componenti, bool &canSet, scalar &residual) const
Set the residual (scalar) value.
scalar timeStart_
Start checking from time - always skips first iteration.
virtual const word & name() const
Return the condition name.
Base class for function objects, adding functionality to read/write state information (data required ...
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Registry of regIOobjects.
A class for handling words, derived from Foam::string.
Definition: word.H:68
dynamicFvMesh & mesh
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73