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 -------------------------------------------------------------------------------
11 License
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 
40 (
41  const fvPatch& p,
43 )
44 :
45  fixedGradientFvPatchVectorField(p, iF)
46 {}
47 
48 
51 (
53  const fvPatch& p,
55  const fvPatchFieldMapper& mapper
56 )
57 :
58  fixedGradientFvPatchVectorField(ptf, p, iF, mapper)
59 {}
60 
61 
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 
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 {
117  writeEntry("value", os);
118 }
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 namespace Foam
124 {
126  (
129  );
130 }
131 
132 // ************************************************************************* //
Foam::fvPatchField< vector >
volFields.H
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
freeSurfaceVelocityFvPatchVectorField.H
Foam::freeSurfaceVelocityFvPatchVectorField
This boundary condition provides a velocity outlet boundary condition for free surface patches.
Definition: freeSurfaceVelocityFvPatchVectorField.H:55
Foam::interfaceTrackingFvMesh
The interfaceTrackingFvMesh.
Definition: interfaceTrackingFvMesh.H:58
Foam::dynamicFvMesh
Abstract base class for geometry and/or topology changing fvMesh.
Definition: dynamicFvMesh.H:78
surfaceFields.H
Foam::surfaceFields.
fvPatchFieldMapper.H
Foam::freeSurfaceVelocityFvPatchVectorField::freeSurfaceVelocityFvPatchVectorField
freeSurfaceVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: freeSurfaceVelocityFvPatchVectorField.C:40
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::objectRegistry::lookupObject
const Type & lookupObject(const word &name, const bool recursive=false) const
Definition: objectRegistryTemplates.C:434
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
interfaceTrackingFvMesh.H
os
OBJstream os(runTime.globalPath()/outputName)
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::interfaceTrackingFvMesh::freeSurfaceSnGradU
tmp< vectorField > freeSurfaceSnGradU()
Return free surface normal derivative of velocity.
Definition: interfaceTrackingFvMesh.C:1814
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::freeSurfaceVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: freeSurfaceVelocityFvPatchVectorField.C:114
Foam::freeSurfaceVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: freeSurfaceVelocityFvPatchVectorField.C:90
Foam::vtk::write
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Definition: foamVtkOutputTemplates.C:36
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::makePatchTypeField
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
Foam::dictionary::getOrDefault
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:148
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54