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 -------------------------------------------------------------------------------
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 "waveModel.H"
33 
34 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
35 
37 (
38  const fvPatch& p,
40 )
41 :
43  waveDictName_(waveModel::dictName)
44 {}
45 
46 
48 (
49  const waveAlphaFvPatchScalarField& ptf,
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 :
68  waveDictName_(dict.getOrDefault<word>("waveDict", waveModel::dictName))
69 {}
70 
71 
73 (
75 )
76 :
78  waveDictName_(ptf.waveDictName_)
79 {}
80 
81 
83 (
84  const waveAlphaFvPatchScalarField& ptf,
86 )
87 :
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 
134 namespace Foam
135 {
137  (
140  );
141 }
142 
143 
144 // ************************************************************************* //
Foam::fvPatchField< scalar >
waveModel.H
Foam::fvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:384
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::tmp::constCast
T & constCast() const
Definition: tmpI.H:248
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::waveModel
Base class for waveModels.
Definition: waveModel.H:57
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::waveModel::alpha
virtual const scalarField & alpha() const
Return the latest wave indicator field prediction.
Definition: waveModel.C:416
dictName
const word dictName("faMeshDefinition")
fvPatchFieldMapper.H
Foam::waveAlphaFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: waveAlphaFvPatchScalarField.C:122
Foam::fixedValueFvPatchField< scalar >
Foam::operator==
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
waveAlphaFvPatchScalarField.H
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::waveAlphaFvPatchScalarField::waveAlphaFvPatchScalarField
waveAlphaFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: waveAlphaFvPatchScalarField.C:37
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
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
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: fvPatchField.C:321
Foam::waveAlphaFvPatchScalarField
Example of the boundary condition specification:
Definition: waveAlphaFvPatchScalarField.H:84
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::Ostream::writeEntry
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Definition: Ostream.H:236
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::waveModel::correct
virtual void correct(const scalar t)
Correct the model for time, t[s].
Definition: waveModel.C:350
Foam::waveAlphaFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: waveAlphaFvPatchScalarField.C:95
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::waveModel::lookupOrCreate
static tmp< waveModel > lookupOrCreate(const polyPatch &patch, const fvMesh &mesh, const word &waveDictName)
Lookup waveModel from database, or create new.
Definition: waveModelNew.C:86