initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / fields / fvPatchFields / derived / rotatingTotalPressure / rotatingTotalPressureFvPatchScalarField.C
blobb41084139e77aab10bce90179ab7a71f2781fcd7
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "rotatingTotalPressureFvPatchScalarField.H"
28 #include "addToRunTimeSelectionTable.H"
29 #include "fvPatchFieldMapper.H"
30 #include "volFields.H"
31 #include "surfaceFields.H"
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 namespace Foam
38 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
40 rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField
42     const fvPatch& p,
43     const DimensionedField<scalar, volMesh>& iF
46     totalPressureFvPatchScalarField(p, iF),
47     omega_(vector::zero)
51 rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField
53     const rotatingTotalPressureFvPatchScalarField& ptf,
54     const fvPatch& p,
55     const DimensionedField<scalar, volMesh>& iF,
56     const fvPatchFieldMapper& mapper
59     totalPressureFvPatchScalarField(ptf, p, iF, mapper),
60     omega_(ptf.omega_)
64 rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField
66     const fvPatch& p,
67     const DimensionedField<scalar, volMesh>& iF,
68     const dictionary& dict
71     totalPressureFvPatchScalarField(p, iF, dict),
72     omega_(dict.lookup("omega"))
76 rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField
78     const rotatingTotalPressureFvPatchScalarField& tppsf
81     totalPressureFvPatchScalarField(tppsf),
82     omega_(tppsf.omega_)
86 rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField
88     const rotatingTotalPressureFvPatchScalarField& tppsf,
89     const DimensionedField<scalar, volMesh>& iF
92     totalPressureFvPatchScalarField(tppsf, iF),
93     omega_(tppsf.omega_)
97 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
99 void rotatingTotalPressureFvPatchScalarField::updateCoeffs()
101     if (updated())
102     {
103         return;
104     }
106     vector axisHat = omega_/mag(omega_);
107     vectorField rotationVelocity = 
108         omega_ ^ (patch().Cf() - axisHat*(axisHat & patch().Cf()));
110     vectorField Up = patch().lookupPatchField<volVectorField, vector>(UName())
111         + rotationVelocity;
113     totalPressureFvPatchScalarField::updateCoeffs(Up);
117 void rotatingTotalPressureFvPatchScalarField::write(Ostream& os) const
119     totalPressureFvPatchScalarField::write(os);
120     os.writeKeyword("omega")<< omega_ << token::END_STATEMENT << nl;
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 makePatchTypeField
128     fvPatchScalarField,
129     rotatingTotalPressureFvPatchScalarField
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 } // End namespace Foam
136 // ************************************************************************* //