freeSurfaceVelocityFvPatchVectorField.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2019 Zeljko Tukovic, FSB Zagreb.
9 Copyright (C) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
31#include "fvPatchFieldMapper.H"
32#include "volFields.H"
33#include "surfaceFields.H"
35
36// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
37
38Foam::freeSurfaceVelocityFvPatchVectorField::
39freeSurfaceVelocityFvPatchVectorField
40(
41 const fvPatch& p,
43)
44:
45 fixedGradientFvPatchVectorField(p, iF)
46{}
47
48
49Foam::freeSurfaceVelocityFvPatchVectorField::
50freeSurfaceVelocityFvPatchVectorField
51(
53 const fvPatch& p,
55 const fvPatchFieldMapper& mapper
56)
57:
58 fixedGradientFvPatchVectorField(ptf, p, iF, mapper)
59{}
60
61
62Foam::freeSurfaceVelocityFvPatchVectorField::
63freeSurfaceVelocityFvPatchVectorField
64(
65 const fvPatch& p,
67 const dictionary& dict
68)
69:
70 fixedGradientFvPatchVectorField(p, iF)
71{
72 patchType() = dict.getOrDefault<word>("patchType", word::null);
73 fvPatchVectorField::operator=(patchInternalField());
74}
75
76
77Foam::freeSurfaceVelocityFvPatchVectorField::
78freeSurfaceVelocityFvPatchVectorField
79(
82)
83:
84 fixedGradientFvPatchVectorField(fcvpvf, iF)
85{}
86
87
88// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
89
91{
92 if (updated())
93 {
94 return;
95 }
96
97 const fvMesh& mesh = patch().boundaryMesh().mesh();
98
100 refCast<interfaceTrackingFvMesh>
101 (
102 const_cast<dynamicFvMesh&>
103 (
104 mesh.lookupObject<dynamicFvMesh>("fvSolution")
105 )
106 );
107
108 gradient() = itm.freeSurfaceSnGradU();
109
110 fixedGradientFvPatchVectorField::updateCoeffs();
111}
112
113
115{
116 fixedGradientFvPatchVectorField::write(os);
117 writeEntry("value", os);
118}
119
120
121// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122
123namespace Foam
124{
126 (
129 );
130}
131
132// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Abstract base class for geometry and/or topology changing fvMesh.
Definition: dynamicFvMesh.H:81
This boundary condition provides a velocity outlet boundary condition for free surface patches.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual bool write()
Write the output fields.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
A FieldMapper for finite-volume patch fields.
virtual void operator=(const UList< vector > &)
Definition: fvPatchField.C:408
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
The interfaceTrackingFvMesh.
tmp< vectorField > freeSurfaceSnGradU()
Return free surface normal derivative of velocity.
const Type & lookupObject(const word &name, const bool recursive=false) const
A class for handling words, derived from Foam::string.
Definition: word.H:68
static const word null
An empty word.
Definition: word.H:80
volScalarField & p
dynamicFvMesh & mesh
OBJstream os(runTime.globalPath()/outputName)
#define makePatchTypeField(PatchTypeField, typePatchTypeField)
Definition: fvPatchField.H:676
Namespace for OpenFOAM.
dictionary dict
Foam::surfaceFields.