initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / turbulenceModels / RAS / incompressible / derivedFvPatchFields / turbulentMixingLengthDissipationRateInlet / turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
blob20c44ffb2020ca9e08936841fe9aeede45a69e74
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2006-2008 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 "turbulentMixingLengthDissipationRateInletFvPatchScalarField.H"
28 #include "addToRunTimeSelectionTable.H"
29 #include "fvPatchFieldMapper.H"
30 #include "surfaceFields.H"
31 #include "volFields.H"
32 #include "RASModel.H"
34 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 namespace Foam
39 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
41 turbulentMixingLengthDissipationRateInletFvPatchScalarField::
42 turbulentMixingLengthDissipationRateInletFvPatchScalarField
44     const fvPatch& p,
45     const DimensionedField<scalar, volMesh>& iF
48     fixedValueFvPatchField<scalar>(p, iF),
49     mixingLength_(0.001)
52 turbulentMixingLengthDissipationRateInletFvPatchScalarField::
53 turbulentMixingLengthDissipationRateInletFvPatchScalarField
55     const turbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf,
56     const fvPatch& p,
57     const DimensionedField<scalar, volMesh>& iF,
58     const fvPatchFieldMapper& mapper
61     fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),
62     mixingLength_(ptf.mixingLength_)
65 turbulentMixingLengthDissipationRateInletFvPatchScalarField::
66 turbulentMixingLengthDissipationRateInletFvPatchScalarField
68     const fvPatch& p,
69     const DimensionedField<scalar, volMesh>& iF,
70     const dictionary& dict
73     fixedValueFvPatchField<scalar>(p, iF, dict),
74     mixingLength_(readScalar(dict.lookup("mixingLength")))
77 turbulentMixingLengthDissipationRateInletFvPatchScalarField::
78 turbulentMixingLengthDissipationRateInletFvPatchScalarField
80     const turbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf
83     fixedValueFvPatchField<scalar>(ptf),
84     mixingLength_(ptf.mixingLength_)
87 turbulentMixingLengthDissipationRateInletFvPatchScalarField::
88 turbulentMixingLengthDissipationRateInletFvPatchScalarField
90     const turbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf,
91     const DimensionedField<scalar, volMesh>& iF
94     fixedValueFvPatchField<scalar>(ptf, iF),
95     mixingLength_(ptf.mixingLength_)
99 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
101 void turbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs()
103     if (updated())
104     {
105         return;
106     }
108     // Lookup Cmu corresponding to the turbulence model selected
109     const incompressible::RASModel& RAS =
110         db().lookupObject<incompressible::RASModel>("RASProperties");
111     scalar Cmu = readScalar(RAS.coeffDict().lookup("Cmu"));
113     scalar Cmu75 = pow(Cmu, 0.75);
115     const fvPatchField<scalar>& k =
116         patch().lookupPatchField<volScalarField, scalar>("k");
118     operator==(Cmu75*k*sqrt(k)/mixingLength_);
120     fixedValueFvPatchField<scalar>::updateCoeffs();
124 void turbulentMixingLengthDissipationRateInletFvPatchScalarField::write
126     Ostream& os
127 ) const
129     fvPatchField<scalar>::write(os);
130     os.writeKeyword("mixingLength")
131         << mixingLength_ << token::END_STATEMENT << nl;
132     writeEntry("value", os);
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 makePatchTypeField
140     fvPatchScalarField,
141     turbulentMixingLengthDissipationRateInletFvPatchScalarField
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 } // End namespace Foam
149 // ************************************************************************* //