waveAbsorptionModel.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-2017 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 
29 #include "waveAbsorptionModel.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 namespace waveModels
36 {
38 }
39 }
40 
41 
42 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
43 
45 (
46  const scalar t
47 ) const
48 {
49  // No time ramping applied for absorption
50  return 1;
51 }
52 
53 
54 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
55 
57 (
58  const dictionary& dict,
59  const fvMesh& mesh,
60  const polyPatch& patch,
61  const bool readFields
62 )
63 :
64  waveModel(dict, mesh, patch, false)
65 {
66  if (readFields)
67  {
68  readDict(dict);
69  }
70 }
71 
72 
73 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
74 
76 (
77  const dictionary& overrideDict
78 )
79 {
80  if (waveModel::readDict(overrideDict))
81  {
82  // Note: always set to true
83  activeAbsorption_ = true;
84 
85  return true;
86  }
87 
88  return false;
89 }
90 
91 
92 // ************************************************************************* //
Foam::waveModel
Base class for waveModels.
Definition: waveModel.H:57
waveAbsorptionModel.H
Foam::waveModels::waveAbsorptionModel
Definition: waveAbsorptionModel.H:49
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
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
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::waveModels::waveAbsorptionModel::timeCoeff
virtual scalar timeCoeff(const scalar t) const
Return the time scaling coefficient.
Definition: waveAbsorptionModel.C:45
Foam::readFields
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
Definition: ReadFieldsTemplates.C:312
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::waveModels::waveAbsorptionModel::readDict
virtual bool readDict(const dictionary &overrideDict)
Read from dictionary.
Definition: waveAbsorptionModel.C:76
Foam::waveModels::waveAbsorptionModel::waveAbsorptionModel
waveAbsorptionModel(const dictionary &dict, const fvMesh &mesh, const polyPatch &patch, const bool readFields=true)
Constructor.
Definition: waveAbsorptionModel.C:57
Foam::waveModels::defineTypeNameAndDebug
defineTypeNameAndDebug(waveAbsorptionModel, 0)