Test-volField.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2015 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 Application
25  Test-volField
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "fvCFD.H"
31 
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 
34 int main(int argc, char *argv[])
35 {
36  #include "setRootCase.H"
37 
38  #include "createTime.H"
39  #include "createMesh.H"
40 
41  Info<< "Reading field p\n" << endl;
43  (
44  IOobject
45  (
46  "p",
47  runTime.timeName(),
48  mesh,
49  IOobject::MUST_READ,
50  IOobject::AUTO_WRITE
51  ),
52  mesh
53  );
54 
55  Info<< "Reading field U\n" << endl;
57  (
58  IOobject
59  (
60  "U",
61  runTime.timeName(),
62  mesh,
63  IOobject::MUST_READ,
64  IOobject::AUTO_WRITE
65  ),
66  mesh
67  );
68 
69  #include "createPhi.H"
70 
72  (
73  IOobject
74  (
75  "st",
76  runTime.timeName(),
77  mesh,
78  IOobject::NO_READ,
79  IOobject::NO_WRITE
80  ),
81  mesh,
82  dimensioned<symmTensor>("st", dimless, symmTensor::one),
83  zeroGradientFvPatchSymmTensorField::typeName
84  );
85 
87  (
88  solve
89  (
90  fvm::ddt(st)
91  + fvm::div(phi, st)
93  (
95  st
96  )
97  ==
99  (
100  "source",
102  symmTensor(0, 2, 0, 1, 1.5, 0)
103  )
104  )
105  );
106 
107  Info<< nl
108  << "Detailed SolverPerformance<symmTensor>: " << nl
109  << " " << sP << endl;
110 
111  Info<< nl
112  << "solverPerformanceDict: "
114 
115  return 0;
116 }
117 
118 
119 // ************************************************************************* //
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::dimless
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
p
p
Definition: pEqn.H:62
main
int main(int argc, char *argv[])
Definition: Test-volField.C:31
Foam::dimLength
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:50
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
transformGeometricField.H
Spatial transformation functions for FieldFields.
Foam::fvc::div
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
U
U
Definition: pEqn.H:46
Foam::fvc::laplacian
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
solve
rhoEqn solve()
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::Info
messageStream Info
Foam::data::solverPerformanceDict
const dictionary & solverPerformanceDict() const
Return the dictionary of solver performance data.
Definition: data.C:56
Foam::symmTensor
SymmTensor< scalar > symmTensor
SymmTensor of scalars.
Definition: symmTensor.H:48
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:41
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:41
setRootCase.H
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:49
createMesh.H
createTime.H
fvCFD.H
Foam::fvc::ddt
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
Definition: fvcDdt.C:45
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::SolverPerformance
SolverPerformance is the class returned by the LduMatrix solver containing performance statistics.
Definition: SolverPerformance.H:49