vorticityWriter.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  Copyright : (C) 2011 Symscape
3  Website : www.symscape.com
4 -------------------------------------------------------------------------------
5 License
6  This file is part of OpenFOAM.
7 
8  OpenFOAM is free software: you can redistribute it and/or modify it
9  under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
14  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16  for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
20 
21 \*---------------------------------------------------------------------------*/
22 
23 #include "vorticityWriter.H"
24 #include "volFields.H"
25 #include "dictionary.H"
26 #include "Time.H"
27 #include "fvc.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33  defineTypeNameAndDebug(vorticityWriter, 0);
34  const word vorticityWriter::FIELD_NAME("vorticity");
35 }
36 
37 
38 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
39 
42 {}
43 
44 
45 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
46 
48 {
49  const fvMesh& mesh = refCast<const fvMesh>(obr);
50  const Time& runTime = obr.time();
51  const volVectorField& U = obr.lookupObject<volVectorField>("U");
52 
54  (
55  IOobject
56  (
57  FIELD_NAME,
58  runTime.timeName(),
59  mesh,
61  ),
62  fvc::curl(U)
63  );
64 
65  vorticity.write();
66 }
67 
68 
69 // ************************************************************************* //
volFields.H
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
Foam::fvc::curl
tmp< GeometricField< Type, fvPatchField, volMesh > > curl(const GeometricField< Type, fvPatchField, volMesh > &vf)
Definition: fvcCurl.C:45
Foam::vorticityWriter::FIELD_NAME
static const word FIELD_NAME
Field file name.
Definition: vorticityWriter.H:54
Foam::objectRegistry::time
const Time & time() const
Return time.
Definition: objectRegistry.H:117
Foam::vorticity::write
virtual void write()
Calculate the vorticity and write.
Definition: vorticity.C:149
U
U
Definition: pEqn.H:46
vorticityWriter.H
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:50
Foam::vorticityWriter::write
virtual void write(const objectRegistry &obr)
Write derived field.
Definition: vorticityWriter.C:47
Foam::derivedFieldWriter
Basis for writers used in derivedFields e.g., wallShearStressWriter.
Definition: derivedFieldWriter.H:49
Foam::IOobject::NO_READ
@ NO_READ
Definition: IOobject.H:111
Foam::vorticityWriter::vorticityWriter
vorticityWriter(const dictionary &dict)
Definition: vorticityWriter.C:40
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::vorticity
This function object calculates and outputs the vorticity, the curl of the velocity as a volvectorFie...
Definition: vorticity.H:106
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::Time::timeName
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
Definition: Time.C:741
dictionary.H
fvc.H
Foam::objectRegistry::lookupObject
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
Definition: objectRegistryTemplates.C:165
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)