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 "timeVaryingAlphaContactAngleFvPatchScalarField.H"
28 #include "addToRunTimeSelectionTable.H"
29 #include "fvPatchFieldMapper.H"
33 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
35 Foam::timeVaryingAlphaContactAngleFvPatchScalarField::
36 timeVaryingAlphaContactAngleFvPatchScalarField
39 const DimensionedField<scalar, volMesh>& iF
42 alphaContactAngleFvPatchScalarField(p, iF),
50 Foam::timeVaryingAlphaContactAngleFvPatchScalarField::
51 timeVaryingAlphaContactAngleFvPatchScalarField
53 const timeVaryingAlphaContactAngleFvPatchScalarField& gcpsf,
55 const DimensionedField<scalar, volMesh>& iF,
56 const fvPatchFieldMapper& mapper
59 alphaContactAngleFvPatchScalarField(gcpsf, p, iF, mapper),
61 thetaT0_(gcpsf.thetaT0_),
67 Foam::timeVaryingAlphaContactAngleFvPatchScalarField::
68 timeVaryingAlphaContactAngleFvPatchScalarField
71 const DimensionedField<scalar, volMesh>& iF,
72 const dictionary& dict
75 alphaContactAngleFvPatchScalarField(p, iF),
76 t0_(readScalar(dict.lookup("t0"))),
77 thetaT0_(readScalar(dict.lookup("thetaT0"))),
78 te_(readScalar(dict.lookup("te"))),
79 thetaTe_(readScalar(dict.lookup("thetaTe")))
85 Foam::timeVaryingAlphaContactAngleFvPatchScalarField::
86 timeVaryingAlphaContactAngleFvPatchScalarField
88 const timeVaryingAlphaContactAngleFvPatchScalarField& gcpsf,
89 const DimensionedField<scalar, volMesh>& iF
92 alphaContactAngleFvPatchScalarField(gcpsf, iF),
94 thetaT0_(gcpsf.thetaT0_),
96 thetaTe_(gcpsf.thetaTe_)
100 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
102 Foam::tmp<Foam::scalarField>
103 Foam::timeVaryingAlphaContactAngleFvPatchScalarField::theta
105 const fvPatchVectorField&,
106 const fvsPatchVectorField&
109 scalar t = patch().boundaryMesh().mesh().time().value();
110 scalar theta0 = thetaT0_;
122 theta0 = thetaT0_ + (t - t0_)*(thetaTe_ - thetaT0_)/(te_ - t0_);
125 return tmp<scalarField>(new scalarField(size(), theta0));
129 void Foam::timeVaryingAlphaContactAngleFvPatchScalarField::write
134 fvPatchScalarField::write(os);
135 os.writeKeyword("t0") << t0_ << token::END_STATEMENT << nl;
136 os.writeKeyword("thetaT0") << thetaT0_ << token::END_STATEMENT << nl;
137 os.writeKeyword("te") << te_ << token::END_STATEMENT << nl;
138 os.writeKeyword("thetaTe") << thetaTe_ << token::END_STATEMENT << nl;
139 writeEntry("value", os);
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 timeVaryingAlphaContactAngleFvPatchScalarField
154 // ************************************************************************* //