Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
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::ddt
29
30Group
31 grpFieldFunctionObjects
32
33Description
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 | <time>/inputField
41 output file | - | -
42 output field | vol<Type>Field | <time>/outputField
43 \endtable
44
45 where \c Type can be one of:
46 \c Scalar, \c Vector, \c SphericalTensor, \c SymmTensor, or \c Tensor.
47
48Usage
49 Minimal example by using \c system/controlDict.functions:
50 \verbatim
51 ddtFO
52 {
53 // Mandatory entries
54 type ddt;
55 libs (fieldFunctionObjects);
56
57 // Inherited entries
58 field <word>;
59 ...
60 }
61 \endverbatim
62
63 where the entries mean:
64 \table
65 Property | Description | Type | Reqd | Deflt
66 type | Type name: ddt | word | yes | -
67 libs | Library name: fieldFunctionObjects | word | yes | -
68 field | Name of operand field | word | yes | -
69 \endtable
70
71 The inherited entries are elaborated in:
72 - \link fieldExpression.H \endlink
73
74SourceFiles
75 ddt.C
76 ddtTemplates.C
77
78\*---------------------------------------------------------------------------*/
79
80#ifndef Foam_functionObjects_ddt_H
81#define Foam_functionObjects_ddt_H
82
83#include "fieldExpression.H"
84
85// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
86
87namespace Foam
88{
89namespace functionObjects
90{
91
92/*---------------------------------------------------------------------------*\
93 Class ddt Declaration
94\*---------------------------------------------------------------------------*/
95
96class ddt
97:
98 public fieldExpression
99{
100
101 // Private Member Functions
102
103 //- Calculate and store the result
104 // \return true if fieldName_ was known and had the correct type
105 template<class Type>
106 bool calcDdt();
107
108 //- Calculate time derivative of the field
109 // \return true on success
110 virtual bool calc();
111
112
113public:
114
115 //- Runtime type information
116 TypeName("ddt");
117
118
119 // Constructors
120
121 //- Construct from name, Time and dictionary
122 ddt
123 (
124 const word& name,
125 const Time& runTime,
126 const dictionary& dict
127 );
128
129 //- No copy construct
130 ddt(const ddt&) = delete;
132 //- No copy assignment
133 void operator=(const ddt&) = delete;
134
135
136 //- Destructor
137 virtual ~ddt() = default;
138};
139
140
141// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142
143} // End namespace functionObjects
144} // End namespace Foam
145
146// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147
148#ifdef NoRepository
149 #include "ddtTemplates.C"
150#endif
151
152// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153
154#endif
155
156// ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
const word & name() const noexcept
Return the name of this functionObject.
Computes the Eulerian time derivative of an input volume field for time-variant simulations (not appr...
Definition ddt.H:134
void operator=(const ddt &)=delete
No copy assignment.
ddt(const ddt &)=delete
No copy construct.
TypeName("ddt")
Runtime type information.
ddt(const word &name, const Time &runTime, const dictionary &dict)
Construct from name, Time and dictionary.
Definition ddt.C:64
virtual ~ddt()=default
Destructor.
Intermediate class for handling field expression function objects (e.g. blendingFactor etc....
fieldExpression(const word &name, const Time &runTime, const dictionary &dict, const word &fieldName=word::null, const word &resultName=word::null)
Construct from name, Time and dictionary.
virtual bool calc()=0
Calculate the components of the field and return true if successful.
A class for handling words, derived from Foam::string.
Definition word.H:66
engineTime & runTime
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68