alphaContactAngleFvPatchScalarField.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "alphaContactAngleFvPatchScalarField.H"
28 #include "fvPatchFieldMapper.H"
29 
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 
36 (
37  Istream& is
38 )
39 :
40  theta0_(readScalar(is)),
41  uTheta_(readScalar(is)),
42  thetaA_(readScalar(is)),
43  thetaR_(readScalar(is))
44 {}
45 
46 
47 Istream& operator>>
48 (
49  Istream& is,
50  alphaContactAngleFvPatchScalarField::interfaceThetaProps& tp
51 )
52 {
53  is >> tp.theta0_ >> tp.uTheta_ >> tp.thetaA_ >> tp.thetaR_;
54  return is;
55 }
56 
57 
58 Ostream& operator<<
59 (
60  Ostream& os,
61  const alphaContactAngleFvPatchScalarField::interfaceThetaProps& tp
62 )
63 {
64  os << tp.theta0_ << token::SPACE
65  << tp.uTheta_ << token::SPACE
66  << tp.thetaA_ << token::SPACE
67  << tp.thetaR_;
68 
69  return os;
70 }
71 
72 
73 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
74 
76 (
77  const fvPatch& p,
78  const DimensionedField<scalar, volMesh>& iF
79 )
80 :
81  zeroGradientFvPatchScalarField(p, iF)
82 {}
83 
84 
86 (
88  const fvPatch& p,
89  const DimensionedField<scalar, volMesh>& iF,
90  const fvPatchFieldMapper& mapper
91 )
92 :
93  zeroGradientFvPatchScalarField(gcpsf, p, iF, mapper),
94  thetaProps_(gcpsf.thetaProps_)
95 {}
96 
97 
99 (
100  const fvPatch& p,
101  const DimensionedField<scalar, volMesh>& iF,
102  const dictionary& dict
103 )
104 :
105  zeroGradientFvPatchScalarField(p, iF),
106  thetaProps_(dict.lookup("thetaProperties"))
107 {
108  evaluate();
109 }
110 
111 
113 (
115  const DimensionedField<scalar, volMesh>& iF
116 )
117 :
118  zeroGradientFvPatchScalarField(gcpsf, iF),
119  thetaProps_(gcpsf.thetaProps_)
120 {}
121 
122 
123 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
124 
125 void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
126 {
128  os.writeKeyword("thetaProperties")
129  << thetaProps_ << token::END_STATEMENT << nl;
130  writeEntry("value", os);
131 }
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
137 (
140 );
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 } // End namespace Foam
145 
146 // ************************************************************************* //
dictionary dict
Macros for easy insertion into run-time selection tables.
makePatchTypeField(fvPatchVectorField, SRFFreestreamVelocityFvPatchVectorField)
stressControl lookup("compactNormalStress") >> compactNormalStress
fvPatchField< scalar > fvPatchScalarField
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
Definition: doubleScalar.H:63
static const char nl
Definition: Ostream.H:262
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::blocking)
Evaluate the patch field.
alphaContactAngleFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
volScalarField & p
Namespace for OpenFOAM.
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:363