1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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 <OpenFOAM/addToRunTimeSelectionTable.H>
29 #include <finiteVolume/fvPatchFieldMapper.H>
30 #include <finiteVolume/volFields.H>
31 #include <finiteVolume/surfaceFields.H>
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
40 rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField
43 const DimensionedField<scalar, volMesh>& iF
46 totalPressureFvPatchScalarField(p, iF),
51 rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField
53 const rotatingTotalPressureFvPatchScalarField& ptf,
55 const DimensionedField<scalar, volMesh>& iF,
56 const fvPatchFieldMapper& mapper
59 totalPressureFvPatchScalarField(ptf, p, iF, mapper),
64 rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField
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),
86 rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField
88 const rotatingTotalPressureFvPatchScalarField& tppsf,
89 const DimensionedField<scalar, volMesh>& iF
92 totalPressureFvPatchScalarField(tppsf, iF),
97 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
99 void rotatingTotalPressureFvPatchScalarField::updateCoeffs()
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())
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 rotatingTotalPressureFvPatchScalarField
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 } // End namespace Foam
136 // ************************ vim: set sw=4 sts=4 et: ************************ //