constantDrift.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2017-2018 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "constantDrift.H"
29 #include "phaseSystem.H"
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 namespace diameterModels
37 {
38 namespace driftModels
39 {
42 }
43 }
44 }
45 
46 
47 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
48 
50 (
51  const populationBalanceModel& popBal,
52  const dictionary& dict
53 )
54 :
55  driftModel(popBal, dict),
56  N_
57  (
58  IOobject
59  (
60  "N",
61  popBal.mesh().time().timeName(),
62  popBal.mesh()
63  ),
64  popBal.mesh(),
66  )
67 {}
68 
69 
70 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
71 
73 {
74  N_ *= 0.0;
75 
77  {
78  const sizeGroup& fi = popBal_.sizeGroups()[i];
79 
80  N_ += fi*fi.phase()/fi.x();
81  }
82 }
83 
84 
86 (
87  volScalarField& driftRate,
88  const label i
89 )
90 {
91  const sizeGroup& fi = popBal_.sizeGroups()[i];
92  phaseModel& phase = const_cast<phaseModel&>(fi.phase());
93  volScalarField& rho = phase.thermoRef().rho();
94 
95  driftRate += (popBal_.fluid().fvOptions()(phase, rho)&rho)/(N_*rho);
96 }
97 
98 
99 // ************************************************************************* //
Foam::phaseModel
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:54
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
Foam::diameterModels::driftModels::constantDrift::addToDriftRate
virtual void addToDriftRate(volScalarField &driftRate, const label i)
Add to driftRate.
Definition: constantDrift.C:86
Foam::diameterModels::sizeGroup::phase
const phaseModel & phase() const
Return const-reference to the phase.
Definition: sizeGroupI.H:38
Foam::phase
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phase.H:54
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::diameterModels::driftModels::constantDrift::constantDrift
constantDrift(const populationBalanceModel &popBal, const dictionary &dict)
Definition: constantDrift.C:50
Foam::Time::timeName
static word timeName(const scalar t, const int precision=precision_)
Definition: Time.C:780
rho
rho
Definition: readInitialConditions.H:88
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::diameterModels::populationBalanceModel::mesh
const fvMesh & mesh() const
Return reference to the mesh.
Definition: populationBalanceModelI.H:56
Foam::inv
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
Definition: dimensionedSphericalTensor.C:73
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:43
constantDrift.H
Foam::diameterModels::sizeGroup
This class represents a single sizeGroup belonging to a velocityGroup. The main property of a sizeGro...
Definition: sizeGroup.H:96
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::diameterModels::populationBalanceModel
Class that solves the univariate population balance equation by means of a class method (also called ...
Definition: populationBalanceModel.H:179
Foam::diameterModels::driftModels::defineTypeNameAndDebug
defineTypeNameAndDebug(constantDrift, 0)
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::diameterModels::driftModels::constantDrift::correct
virtual void correct()
Correct diameter independent expressions.
Definition: constantDrift.C:72
Foam::fvMesh::time
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:275
Foam::diameterModels::driftModel
Base class for drift models.
Definition: driftModel.H:52
Foam::diameterModels::driftModel::popBal_
const populationBalanceModel & popBal_
Reference to the populationBalanceModel.
Definition: driftModel.H:59
Foam::dimVolume
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:61
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::diameterModels::sizeGroup::x
const dimensionedScalar & x() const
Return representative volume of the sizeGroup.
Definition: sizeGroupI.H:59
Foam::diameterModels::driftModels::addToRunTimeSelectionTable
addToRunTimeSelectionTable(driftModel, constantDrift, dictionary)
Foam::diameterModels::driftModels::constantDrift
Constant drift rate within all classes. Used for verification and validation of the drift formulation...
Definition: constantDrift.H:57
Foam::diameterModels::populationBalanceModel::sizeGroups
const UPtrList< sizeGroup > & sizeGroups() const
Return the sizeGroups belonging to this populationBalance.
Definition: populationBalanceModelI.H:84
Foam::phase::rho
const dimensionedScalar & rho() const
Return const-access to phase1 density.
Definition: phase.H:140