hydrostaticDisplacementFvPatchVectorField.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2018-2019 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 
29 
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 
34 (
35  const fvPatch& p,
36  const DimensionedField<vector, volMesh>& iF
37 )
38 :
39  tractionDisplacementFvPatchVectorField(p, iF),
40  rhoLiquid_(0.0),
41  liquidSurfacePressure_(0.0),
42  liquidSurfacePoint_(Zero)
43 {}
44 
45 
48 (
49  const fvPatch& p,
50  const DimensionedField<vector, volMesh>& iF,
51  const dictionary& dict
52 )
53 :
54  tractionDisplacementFvPatchVectorField(p, iF),
55  rhoLiquid_(readScalar(dict.lookup("rhoLiquid"))),
56  liquidSurfacePressure_(readScalar(dict.lookup("liquidSurfacePressure"))),
57  liquidSurfacePoint_(dict.lookup("liquidSurfacePoint"))
58 {}
59 
60 
63 (
64  const hydrostaticDisplacementFvPatchVectorField& tdpvf,
65  const fvPatch& p,
66  const DimensionedField<vector, volMesh>& iF,
67  const fvPatchFieldMapper& mapper
68 )
69 :
70  tractionDisplacementFvPatchVectorField(tdpvf, p, iF, mapper),
71  rhoLiquid_(tdpvf.rhoLiquid_),
72  liquidSurfacePressure_(tdpvf.liquidSurfacePressure_),
73  liquidSurfacePoint_(tdpvf.liquidSurfacePoint_)
74 {}
75 
76 
79 (
80  const hydrostaticDisplacementFvPatchVectorField& tdpvf
81 )
82 :
83  tractionDisplacementFvPatchVectorField(tdpvf),
84  rhoLiquid_(tdpvf.rhoLiquid_),
85  liquidSurfacePressure_(tdpvf.liquidSurfacePressure_),
86  liquidSurfacePoint_(tdpvf.liquidSurfacePoint_)
87 {}
88 
89 
92 (
93  const hydrostaticDisplacementFvPatchVectorField& tdpvf,
94  const DimensionedField<vector, volMesh>& iF
95 )
96 :
97  tractionDisplacementFvPatchVectorField(tdpvf, iF),
98  rhoLiquid_(tdpvf.rhoLiquid_),
99  liquidSurfacePressure_(tdpvf.liquidSurfacePressure_),
100  liquidSurfacePoint_(tdpvf.liquidSurfacePoint_)
101 {}
102 
103 
104 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
105 
107 {
108  if (updated())
109  {
110  return;
111  }
112 
114  db().lookupObject<uniformDimensionedVectorField>("g");
115 
116  pressure() =
117  liquidSurfacePressure_
118  + rhoLiquid_
119  *max(g.value() & (patch().Cf() - liquidSurfacePoint_), scalar(0));
120 
122 }
123 
124 
126 {
128  writeEntry(os, "rhoLiquid", rhoLiquid_);
129  writeEntry(os, "liquidSurfacePressure", liquidSurfacePressure_);
130  writeEntry(os, "liquidSurfacePoint", liquidSurfacePoint_);
131  writeEntry(os, "value", *this);
132 }
133 
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 namespace Foam
138 {
140  (
143  );
144 }
145 
146 
147 // ************************************************************************* //
#define readScalar
Definition: doubleScalar.C:38
virtual void write(Ostream &) const
Write.
dictionary dict
fvPatchField< vector > fvPatchVectorField
UniformDimensionedField< vector > uniformDimensionedVectorField
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:280
Macros for easy insertion into run-time selection tables.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
stressControl lookup("compactNormalStress") >> compactNormalStress
static const zero Zero
Definition: zero.H:97
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
volScalarField & p
hydrostaticDisplacementFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
Namespace for OpenFOAM.