1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "fvPatchFields.H"
27 #include "timeVaryingAlphaContactAngleFvPatchScalarField.H"
28 #include "addToRunTimeSelectionTable.H"
32 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
34 Foam::timeVaryingAlphaContactAngleFvPatchScalarField::
35 timeVaryingAlphaContactAngleFvPatchScalarField
38 const DimensionedField<scalar, volMesh>& iF
41 alphaContactAngleFvPatchScalarField(p, iF),
49 Foam::timeVaryingAlphaContactAngleFvPatchScalarField::
50 timeVaryingAlphaContactAngleFvPatchScalarField
52 const timeVaryingAlphaContactAngleFvPatchScalarField& gcpsf,
54 const DimensionedField<scalar, volMesh>& iF,
55 const fvPatchFieldMapper& mapper
58 alphaContactAngleFvPatchScalarField(gcpsf, p, iF, mapper),
60 thetaT0_(gcpsf.thetaT0_),
66 Foam::timeVaryingAlphaContactAngleFvPatchScalarField::
67 timeVaryingAlphaContactAngleFvPatchScalarField
70 const DimensionedField<scalar, volMesh>& iF,
71 const dictionary& dict
74 alphaContactAngleFvPatchScalarField(p, iF),
75 t0_(readScalar(dict.lookup("t0"))),
76 thetaT0_(readScalar(dict.lookup("thetaT0"))),
77 te_(readScalar(dict.lookup("te"))),
78 thetaTe_(readScalar(dict.lookup("thetaTe")))
84 Foam::timeVaryingAlphaContactAngleFvPatchScalarField::
85 timeVaryingAlphaContactAngleFvPatchScalarField
87 const timeVaryingAlphaContactAngleFvPatchScalarField& gcpsf,
88 const DimensionedField<scalar, volMesh>& iF
91 alphaContactAngleFvPatchScalarField(gcpsf, iF),
93 thetaT0_(gcpsf.thetaT0_),
95 thetaTe_(gcpsf.thetaTe_)
99 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
101 Foam::tmp<Foam::scalarField>
102 Foam::timeVaryingAlphaContactAngleFvPatchScalarField::theta
104 const fvPatchVectorField&,
105 const fvsPatchVectorField&
108 scalar t = patch().boundaryMesh().mesh().time().value();
109 scalar theta0 = thetaT0_;
121 theta0 = thetaT0_ + (t - t0_)*(thetaTe_ - thetaT0_)/(te_ - t0_);
124 return tmp<scalarField>(new scalarField(size(), theta0));
128 void Foam::timeVaryingAlphaContactAngleFvPatchScalarField::write
133 fvPatchScalarField::write(os);
134 os.writeKeyword("t0") << t0_ << token::END_STATEMENT << nl;
135 os.writeKeyword("thetaT0") << thetaT0_ << token::END_STATEMENT << nl;
136 os.writeKeyword("te") << te_ << token::END_STATEMENT << nl;
137 os.writeKeyword("thetaTe") << thetaTe_ << token::END_STATEMENT << nl;
138 writeEntry("value", os);
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 timeVaryingAlphaContactAngleFvPatchScalarField
153 // ************************************************************************* //