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,
40)
41:
42 fixedValueFvPatchField<scalar>(p, iF),
43 waveDictName_(waveModel::dictName)
44{}
45
46
48(
50 const fvPatch& p,
52 const fvPatchFieldMapper& mapper
53)
54:
55 fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),
56 waveDictName_(ptf.waveDictName_)
57{}
58
59
61(
62 const fvPatch& p,
64 const dictionary& dict
65)
66:
67 fixedValueFvPatchField<scalar>(p, iF, dict),
68 waveDictName_(dict.getOrDefault<word>("waveDict", waveModel::dictName))
69{}
70
71
73(
75)
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());
115
116 operator==(model.alpha());
117
119}
120
121
123{
125
126 os.writeEntry("waveDictName", waveDictName_);
127
128 writeEntry("value", os);
129}
130
131
132// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133
134namespace Foam
135{
137 (
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:62
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Definition: Ostream.H:239
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
virtual bool write()
Write the output fields.
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
A class for managing temporary objects.
Definition: tmp.H:65
T & constCast() const
Definition: tmpI.H:248
Example of the boundary condition specification:
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Base class for waveModels.
Definition: waveModel.H:61
virtual const scalarField & alpha() const
Return the latest wave indicator field prediction.
Definition: waveModel.C:416
virtual void correct(const scalar t)
Correct the model for time, t[s].
Definition: waveModel.C:350
static tmp< waveModel > lookupOrCreate(const polyPatch &patch, const fvMesh &mesh, const word &waveDictName)
Lookup waveModel from database, or create new.
Definition: waveModelNew.C:86
A class for handling words, derived from Foam::string.
Definition: word.H:68
volScalarField & p
dynamicFvMesh & mesh
OBJstream os(runTime.globalPath()/outputName)
const word dictName("faMeshDefinition")
#define makePatchTypeField(PatchTypeField, typePatchTypeField)
Definition: fvPatchField.H:676
Namespace for OpenFOAM.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
dictionary dict