flowRateConeDiskVelocityLagrangianVectorFieldSource.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 
27 #include "diskInjection.H"
29 #include "grouped.H"
31 
32 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33 
36 (
37  const regIOobject& iIo,
38  const dictionary& dict
39 )
40 :
41  LagrangianVectorFieldSource(iIo, dict),
44 {}
45 
46 
49 (
51  const regIOobject& iIo
52 )
53 :
54  LagrangianVectorFieldSource(field, iIo),
57 {}
58 
59 
60 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
61 
64 {}
65 
66 
67 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
68 
71 (
72  const LagrangianInjection& injection,
73  const LagrangianSubMesh& subMesh
74 ) const
75 {
76  const flowRateNumberLagrangianScalarFieldSource& flowRateNumber =
77  cloud<clouds::grouped>(injection)
78  .number
79  .sources()[injection.name()]
80  .fieldSourceCast<flowRateNumberLagrangianScalarFieldSource>(injection);
81 
82  const Lagrangian::diskInjection& diskInjection =
83  modelCast<Lagrangian::diskInjection>(injection);
84 
86  (
87  this->direction(injection, subMesh)
88  );
89 
90  return
91  flowRateNumber.Q(injection, subMesh)
92  /diskInjection.area()
93  *direction
94  /average(direction & diskInjection.axis());
95 }
96 
97 
99 (
100  Ostream& os
101 ) const
102 {
104 
106 }
107 
108 
109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 
111 namespace Foam
112 {
114  (
115  LagrangianVectorFieldSource,
117  );
118 }
119 
120 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Base class for Lagrangian injections. Minimal wrapper over LagrangianSource. Implements some utility ...
const word & name() const
The source name.
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
Disk injection model. This injects particles continuously over a disk with a given number rate....
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.
Base class for clouds. Provides a basic evolution algorithm, models, and a database for caching deriv...
Definition: cloud.H:61
Mix-in for source conditions that provides a random injection direction on a disk between two cone an...
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
This source condition provides a conical velocity profile over a disk, characterised by inner and out...
virtual tmp< LagrangianSubVectorField > value(const LagrangianInjection &, const LagrangianSubMesh &) const
Return the value for an instantaneous injection.
flowRateConeDiskVelocityLagrangianVectorFieldSource(const regIOobject &, const dictionary &dict)
Construct from internal field and dictionary.
This source condition sets the values of the number field to recover a specified volumetric or mass f...
dimensionedScalar Q(const LagrangianInjection &, const LagrangianSubMesh &) const
Return the volumetric flow rate for this time-step.
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
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
Namespace for OpenFOAM.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
makeLagrangianTypeFieldSource(LagrangianVectorFieldSource, coneDiskVelocityLagrangianVectorFieldSource)
uint8_t direction
Definition: direction.H:45
dictionary dict