Loading...
Searching...
No Matches
waveAlphaFvPatchScalarField.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) 2015 IH-Cantabria
9 Copyright (C) 2016-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 "waveModel.H"
33
34// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
35
37(
38 const fvPatch& p,
52 const fvPatchFieldMapper& mapper
54:
55 fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),
56 waveDictName_(ptf.waveDictName_)
57{}
58
59
61(
62 const fvPatch& p,
64 const dictionary& dict
66:
67 fixedValueFvPatchField<scalar>(p, iF, dict),
68 waveDictName_(dict.getOrDefault<word>("waveDict", waveModel::dictName))
69{}
70
71
73(
76:
77 fixedValueFvPatchField<scalar>(ptf),
78 waveDictName_(ptf.waveDictName_)
79{}
80
81
83(
86)
87:
88 fixedValueFvPatchField<scalar>(ptf, iF),
89 waveDictName_(ptf.waveDictName_)
90{}
91
92
93// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
94
96{
97 if (updated())
98 {
99 return;
100 }
101
102 tmp<waveModel> tmodel
103 (
105 (
106 patch().patch(),
107 internalField().mesh(),
108 waveDictName_
109 )
110 );
111
112 waveModel& model = tmodel.constCast();
113
114 model.correct(db().time().value());
123{
125
126 os.writeEntry("waveDictName", waveDictName_);
127
130
131
132// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133
134namespace Foam
135{
137 (
139 waveAlphaFvPatchScalarField
140 );
141}
142
143
144// ************************************************************************* //
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:59
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
A FieldMapper for finite-volume patch fields.
virtual void write(Ostream &) const
Write.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
A class for managing temporary objects.
Definition tmp.H:75
T & constCast() const
Return non-const reference to the object or to the contents of a (non-null) managed pointer,...
Definition tmp.H:306
Example of the boundary condition specification:
waveAlphaFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
virtual void write(Ostream &) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Base class for waveModels.
Definition waveModel.H:55
virtual const scalarField & alpha() const
Return the latest wave indicator field prediction.
Definition waveModel.C:408
virtual void correct(const scalar t)
Correct the model for time, t[s].
Definition waveModel.C:342
static tmp< waveModel > lookupOrCreate(const polyPatch &patch, const fvMesh &mesh, const word &waveDictName)
Lookup waveModel from database, or create new.
A class for handling words, derived from Foam::string.
Definition word.H:66
volScalarField & p
dynamicFvMesh & mesh
OBJstream os(runTime.globalPath()/outputName)
const word dictName("faMeshDefinition")
#define makePatchTypeField(PatchTypeField, typePatchTypeField)
Define a concrete fvPatchField type and add to run-time tables Example, (fvPatchScalarField,...
Namespace for OpenFOAM.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
fvPatchField< scalar > fvPatchScalarField
dictionary dict