totalPressureVelocityLagrangianVectorFieldSource.C
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-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 \*---------------------------------------------------------------------------*/
25 
28 
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30 
33 (
34  const regIOobject& iIo,
35  const dictionary& dict
36 )
37 :
38  LagrangianVectorFieldSource(iIo, dict),
42  (
43  *this,
44  *this,
45  dict
46  ),
47  direction_
48  (
50  (
51  "direction",
52  iIo.time().userUnits(),
53  dimless,
54  dict
55  )
56  )
57 {}
58 
59 
62 (
64  const regIOobject& iIo
65 )
66 :
67  LagrangianVectorFieldSource(field, iIo),
71  (
72  field,
73  *this,
74  *this
75  )
76 {}
77 
78 
79 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
80 
83 {}
84 
85 
86 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
87 
90 (
91  const LagrangianInjection& injection,
92  const LagrangianSubMesh& subMesh
93 ) const
94 {
95  return
96  Umag(injection, subMesh)
97  *normalised(value(subMesh, dimless, direction_()));
98 }
99 
100 
102 (
103  Ostream& os
104 ) const
105 {
107 
109 
110  writeEntry(os, time().userUnits(), units::none, direction_());
111 }
112 
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 namespace Foam
117 {
119  (
120  LagrangianVectorFieldSource,
122  );
123 }
124 
125 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Mix-in for source conditions that provides functions for evaluating Function1s at variable times.
Run-time selectable general function of one variable.
Definition: Function1.H:62
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
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
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:55
A class for managing temporary objects.
Definition: tmp.H:55
This source condition provides a velocity in a given direction with a magnitude calculated from the d...
virtual tmp< LagrangianSubVectorField > value(const LagrangianInjection &, const LagrangianSubMesh &) const
Return the value for an instantaneous injection.
totalPressureVelocityLagrangianVectorFieldSource(const regIOobject &, const dictionary &dict)
Construct from internal field and dictionary.
Mix-in for source conditions that compute the velocity magnitude from the difference between a specif...
const dimensionSet dimless
const dimensionSet time
const unitSet none
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
Namespace for OpenFOAM.
const dimensionSet & dimless
Definition: dimensions.C:138
dimensionSet normalised(const dimensionSet &)
Definition: dimensionSet.C:509
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)
void writeEntry(Ostream &os, const word &key, const DimensionedFieldFunction< DimensionedFieldType > &f)
makeLagrangianTypeFieldSource(LagrangianVectorFieldSource, coneDiskVelocityLagrangianVectorFieldSource)
dictionary dict