waveAlpha_DimensionedFieldFunction.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::DimensionedFieldFunctions::waveAlpha
26 
27 Description
28  Initialises the phase fraction to that specified by a superposition of wave
29  models. All the wave modelling parameters are obtained from a centrally
30  registered waveSuperposition class.
31 
32 Usage
33  \table
34  Property | Description | Required? | Default
35  liquid | Is the alpha field that of the liquid? | no | true
36  \endtable
37 
38  Example of the boundary condition specification:
39  \verbatim
40  internalField
41  {
42  type waveAlpha;
43  libs ("libwaves.so");
44  }
45  \endverbatim
46 
47 See also
48  Foam::waveAlphaFvPatchScalarField
49  Foam::waveSuperposition
50 
51 SourceFiles
52  waveAlpha_DimensionedFieldFunction.C
53 
54 \*---------------------------------------------------------------------------*/
55 
56 #ifndef waveAlpha_DimensionedFieldFunction_H
57 #define waveAlpha_DimensionedFieldFunction_H
58 
60 
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 
63 namespace Foam
64 {
65 
66 class fvMesh;
67 
68 namespace DimensionedFieldFunctions
69 {
70 
71 /*---------------------------------------------------------------------------*\
72  Class waveAlpha Declaration
73 \*---------------------------------------------------------------------------*/
74 
75 class waveAlpha
76 :
77  public DimensionedFieldFunction<DimensionedField<scalar, fvMesh>>
78 {
79  // Private Data
80 
81  //- Is this alpha field that of the liquid under the wave?
82  const Switch liquid_;
83 
84 
85 public:
86 
87  //- Runtime type information
88  TypeName("waveAlpha");
89 
90 
91  // Constructors
92 
93  //- Construct with dictionary to initialise given field
94  waveAlpha
95  (
96  const dictionary& dict,
98  );
99 
100  //- Construct a copy for the given field
101  waveAlpha
102  (
103  const waveAlpha& dff,
105  );
106 
107  //- Construct and return a clone for the specified field
108  virtual autoPtr
109  <
111  > clone(DimensionedField<scalar, fvMesh>& field) const;
112 
113 
114  //- Destructor
115  virtual ~waveAlpha()
116  {}
117 
118 
119  // Member Functions
120 
121  //- Evaluate the function and set the field
122  virtual void evaluate();
123 
124  //- Write data to dictionary stream
125  virtual void write(Ostream& os) const;
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace DimensionedFieldFunctions
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #endif
137 
138 // ************************************************************************* //
Base class for run-time selectable internal and patch field initialisation evaluation and update with...
virtual autoPtr< DimensionedFieldFunction< DimensionedField< scalar, fvMesh > > > clone() const
Construct and return a clone for the specified field.
Initialises the phase fraction to that specified by a superposition of wave models....
waveAlpha(const dictionary &dict, DimensionedField< scalar, fvMesh > &field)
Construct with dictionary to initialise given field.
TypeName("waveAlpha")
Runtime type information.
virtual void evaluate()
Evaluate the function and set the field.
virtual void write(Ostream &os) const
Write data to dictionary stream.
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:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Namespace for OpenFOAM.
dictionary dict