totalPressureVelocityMagnitudeLagrangianScalarFieldSource.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) 2025 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::totalPressureVelocityMagnitudeLagrangianScalarFieldSource
26 
27 Description
28  Mix-in for source conditions that compute the velocity magnitude from the
29  difference between a specified upstream pressure and the local interpolated
30  pressure
31 
32 SourceFiles
33  totalPressureVelocityMagnitudeLagrangianScalarFieldSource.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef totalPressureVelocityMagnitudeLagrangianScalarFieldSource_H
38 #define totalPressureVelocityMagnitudeLagrangianScalarFieldSource_H
39 
40 #include "LagrangianInjection.H"
41 #include "Function1.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 class LagrangianFieldSourceBase;
49 class cloudLagrangianFieldSource;
50 
51 /*---------------------------------------------------------------------------*\
52  Class totalPressureVelocityMagnitudeLagrangianScalarFieldSource Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 {
57 private:
58 
59  // Private Data
60 
61  //- Reference to the field source
62  const LagrangianFieldSourceBase& field_;
63 
64  //- Reference to the cloud field source
65  const cloudLagrangianFieldSource& cloudField_;
66 
67  //- Total pressure entry. Cached until evaluation as the function
68  // cannot be constructed until the carrier pressure dimensions are
69  // available. After this it is deleted.
70  mutable autoPtr<entry> p0Entry_;
71 
72  //- Total pressure
73  mutable autoPtr<Function1<scalar>> p0_;
74 
75  //- Name of the carrier density field
76  const word rhocName_;
77 
78  //- Name of the carrier pressure field
79  const word pcName_;
80 
81 
82 public:
83 
84  // Constructors
85 
86  //- Construct from a dictionary
88  (
91  const dictionary& dict
92  );
93 
94  //- Copy constructor
96  (
100  );
101 
102 
103  //- Destructor
105 
106 
107  // Member Functions
108 
109  //- Return the value for an instantaneous injection
111  (
112  const LagrangianInjection&,
113  const LagrangianSubMesh&
114  ) const;
115 
116  //- Write
117  void write(Ostream&) const;
118 };
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 #endif
128 
129 // ************************************************************************* //
Base class for Lagrangian source conditions.
Base class for Lagrangian injections. Minimal wrapper over LagrangianSource. Implements some utility ...
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
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
Mix-in for source conditions that refer to a cloud.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
A class for managing temporary objects.
Definition: tmp.H:55
Mix-in for source conditions that compute the velocity magnitude from the difference between a specif...
tmp< LagrangianSubScalarField > Umag(const LagrangianInjection &, const LagrangianSubMesh &) const
Return the value for an instantaneous injection.
totalPressureVelocityMagnitudeLagrangianScalarFieldSource(const LagrangianFieldSourceBase &, const cloudLagrangianFieldSource &, const dictionary &dict)
Construct from a dictionary.
A class for handling words, derived from string.
Definition: word.H:63
Namespace for OpenFOAM.
dictionary dict