ddt.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) 2017 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::functionObjects::ddt
29 
30 Group
31  grpFieldFunctionObjects
32 
33 Description
34  Computes the Eulerian time derivative of an input volume field for
35  time-variant simulations (not appropriate to steady-state simulations).
36 
37  Operands:
38  \table
39  Operand | Type | Location
40  input | vol<Type>Field | $FOAM_CASE/<time>/<inpField>
41  output file | - | -
42  output field | vol<Type>Field | $FOAM_CASE/<time>/<outField>
43  \endtable
44 
45  where \c <Type>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor.
46 
47 Usage
48  Minimal example by using \c system/controlDict.functions:
49  \verbatim
50  ddt1
51  {
52  // Mandatory entries (unmodifiable)
53  type ddt;
54  libs (fieldFunctionObjects);
55 
56  // Mandatory (inherited) entries (runtime modifiable)
57  field <field>;
58 
59  // Optional (inherited) entries
60  ...
61  }
62  \endverbatim
63 
64  where the entries mean:
65  \table
66  Property | Description | Type | Req'd | Dflt
67  type | Type name: ddt | word | yes | -
68  libs | Library name: fieldFunctionObjects | word | yes | -
69  field | Name of operand field | word | yes | -
70  \endtable
71 
72  The inherited entries are elaborated in:
73  - \link functionObject.H \endlink
74  - \link fieldExpression.H \endlink
75 
76  Minimal example by using the \c postProcess utility:
77  \verbatim
78  postProcess -func "ddt(<field>)"
79  \endverbatim
80 
81 See also
82  - Foam::functionObject
83  - Foam::functionObjects::fvMeshFunctionObject
84  - Foam::functionObjects::fieldExpression
85  - ExtendedCodeGuide::functionObjects::field::ddt
86 
87 SourceFiles
88  ddt.C
89  ddtTemplates.C
90 
91 \*---------------------------------------------------------------------------*/
92 
93 #ifndef functionObjects_ddt_H
94 #define functionObjects_ddt_H
95 
96 #include "fieldExpression.H"
97 
98 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
99 
100 namespace Foam
101 {
102 namespace functionObjects
103 {
104 
105 /*---------------------------------------------------------------------------*\
106  Class ddt Declaration
107 \*---------------------------------------------------------------------------*/
108 
109 class ddt
110 :
111  public fieldExpression
112 {
113 
114  // Private Member Functions
115 
116  //- Calculate and store the result
117  // \return true if fieldName_ was known and had the correct type
118  template<class Type>
119  bool calcDdt();
120 
121  //- Calculate time derivative of the field
122  // \return true on success
123  virtual bool calc();
124 
125 
126 public:
127 
128  //- Runtime type information
129  TypeName("ddt");
130 
131 
132  // Constructors
133 
134  //- Construct from Time and dictionary
135  ddt
136  (
137  const word& name,
138  const Time& runTime,
139  const dictionary& dict
140  );
141 
142  //- No copy construct
143  ddt(const ddt&) = delete;
144 
145  //- No copy assignment
146  void operator=(const ddt&) = delete;
147 
148 
149  //- Destructor
150  virtual ~ddt() = default;
151 };
152 
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 } // End namespace functionObjects
157 } // End namespace Foam
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #ifdef NoRepository
162  #include "ddtTemplates.C"
163 #endif
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #endif
168 
169 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::functionObjects::ddt::TypeName
TypeName("ddt")
Runtime type information.
Foam::functionObjects::ddt::~ddt
virtual ~ddt()=default
Destructor.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::functionObject::name
const word & name() const noexcept
Return the name of this functionObject.
Definition: functionObject.C:143
Foam::functionObjects::fieldExpression
Intermediate class for handling field expression function objects (e.g. blendingFactor etc....
Definition: fieldExpression.H:120
Foam::fac::ddt
tmp< GeometricField< Type, faPatchField, areaMesh > > ddt(const dimensioned< Type > dt, const faMesh &mesh)
Definition: facDdt.C:47
Foam::functionObjects::ddt::ddt
ddt(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Definition: ddt.C:71
fieldExpression.H
ddtTemplates.C
Foam::functionObjects::ddt::operator=
void operator=(const ddt &)=delete
No copy assignment.
Foam::functionObjects::ddt
Computes the Eulerian time derivative of an input volume field for time-variant simulations (not appr...
Definition: ddt.H:148