totalPressureConeVelocityLagrangianVectorFieldSource.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  ),
48  direction_
49  (
51  (
52  "direction",
53  iIo.time().userUnits(),
54  dimless,
55  dict
56  )
57  )
58 {}
59 
60 
63 (
65  const regIOobject& iIo
66 )
67 :
68  LagrangianVectorFieldSource(field, iIo),
72  (
73  field,
74  *this,
75  *this
76  ),
78  direction_(field.direction_, false)
79 {}
80 
81 
82 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
83 
86 {}
87 
88 
89 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
90 
93 (
94  const LagrangianInjection& injection,
95  const LagrangianSubMesh& subMesh
96 ) const
97 {
98  return
99  Umag(injection, subMesh)
100  *direction(normalised(value(subMesh, dimless, direction_())));
101 }
102 
103 
105 (
106  Ostream& os
107 ) const
108 {
110 
112 
114 
115  writeEntry(os, time().userUnits(), units::none, direction_());
116 }
117 
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 namespace Foam
122 {
124  (
125  LagrangianVectorFieldSource,
127  );
128 }
129 
130 // ************************************************************************* //
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.
Mix-in for source conditions that provides a random injection direction between two cone angles.
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 conical velocity profile, characterised by inner and outer cone angl...
virtual tmp< LagrangianSubVectorField > value(const LagrangianInjection &, const LagrangianSubMesh &) const
Return the value for an instantaneous injection.
totalPressureConeVelocityLagrangianVectorFieldSource(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)
uint8_t direction
Definition: direction.H:45
dictionary dict