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-2020 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_(dict.lookup<scalar>("rhoLiquid")),
56  liquidSurfacePressure_(dict.lookup<scalar>("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  const DimensionedField<vector, volMesh>& iF
82 )
83 :
84  tractionDisplacementFvPatchVectorField(tdpvf, iF),
85  rhoLiquid_(tdpvf.rhoLiquid_),
86  liquidSurfacePressure_(tdpvf.liquidSurfacePressure_),
87  liquidSurfacePoint_(tdpvf.liquidSurfacePoint_)
88 {}
89 
90 
91 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
92 
94 {
95  if (updated())
96  {
97  return;
98  }
99 
101  db().lookupObject<uniformDimensionedVectorField>("g");
102 
104  (
105  liquidSurfacePressure_
106  + rhoLiquid_
107  *max(g.value() & (patch().Cf() - liquidSurfacePoint_), scalar(0))
108  );
109 }
110 
111 
113 {
115  writeEntry(os, "rhoLiquid", rhoLiquid_);
116  writeEntry(os, "liquidSurfacePressure", liquidSurfacePressure_);
117  writeEntry(os, "liquidSurfacePoint", liquidSurfacePoint_);
118  writeEntry(os, "value", *this);
119 }
120 
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 namespace Foam
125 {
127  (
130  );
131 }
132 
133 
134 // ************************************************************************* //
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:260
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.