SecondaryPropertyModel.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) 2019-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 \*---------------------------------------------------------------------------*/
25 
26 #include "SecondaryPropertyModel.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
30 template<class ModelType>
33 (
34  const populationBalanceModel& popBal
35 )
36 :
37  ModelType(popBal)
38 {}
39 
40 
41 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
42 
43 template<class ModelType>
46 {}
47 
48 
49 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
50 
51 template<class ModelType>
53 (
55  const label i,
56  const label j,
57  const label k
58 )
59 {
60  const PtrList<dimensionedScalar>& vs = this->popBal().vs();
61 
62  const volScalarField::Internal& propj = fld(j);
63  const volScalarField::Internal& propk = fld(k);
64 
65  src(i) += (propj*vs[j] + propk*vs[k])/(vs[j] + vs[k])*Su;
66 }
67 
68 
69 template<class ModelType>
71 (
73  const label i,
74  const label j
75 )
76 {
77  const volScalarField::Internal& propj = fld(j);
78 
79  src(i) += propj*Su;
80 }
81 
82 
83 template<class ModelType>
85 {
86  forAll(this->popBal().fs(), i)
87  {
88  src(i) = Zero;
89  }
90 }
91 
92 
93 // ************************************************************************* //
label k
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:449
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
Model for tracking the evolution of a dispersed phase size distribution due to coalescence (synonymou...
SecondaryPropertyModel(const populationBalanceModel &popBal)
Construct from a population balance model.
virtual void addCoalescence(const volScalarField::Internal &Su, const label i, const label j, const label k)
Add coalescence contribution to secondary property source.
virtual void reset()
Reset secondary property source.
virtual void addBreakup(const volScalarField::Internal &Su, const label i, const label j)
Add breakup contribution to secondary property source.
gmvFile<< "tracers "<< particles.size()<< nl;{ pointField positions(particles.size());label particlei=0;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter) { positions[particlei++]=iter().position(mesh);} for(i=0;i< pTraits< point >::nComponents;i++) { forAll(positions, particlei) { gmvFile<< component(positions[particlei], i)<< ' ';} gmvFile<< nl;}}forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.name(), lagrangian::cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
tmp< VolField< Type > > Su(const VolField< Type > &su, const VolField< Type > &vf)
Definition: fvcSup.C:44
static const zero Zero
Definition: zero.H:97
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59