densityChange.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 "densityChange.H"
30 #include "phaseSystem.H"
31 #include "fvcDdt.H"
32 #include "fvcGrad.H"
33 
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38 namespace diameterModels
39 {
40 namespace driftModels
41 {
42  defineTypeNameAndDebug(densityChangeDrift, 0);
43  addToRunTimeSelectionTable(driftModel, densityChangeDrift, dictionary);
44 }
45 }
46 }
47 
48 
49 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
50 
52 (
53  const populationBalanceModel& popBal,
54  const dictionary& dict
55 )
56 :
57  driftModel(popBal, dict)
58 {}
59 
60 
61 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
62 
63 
65 (
66  volScalarField& driftRate,
67  const label i
68 )
69 {
70  const sizeGroup& fi = popBal_.sizeGroups()[i];
71  volScalarField& rho = const_cast<volScalarField&>(fi.phase().rho()());
72 
73  driftRate -= (fvc::ddt(rho) + (fvc::grad(rho)&popBal_.U()))
74  *popBal_.sizeGroups()[i].x()/rho;
75 }
76 
77 
78 // ************************************************************************* //
Foam::diameterModels::sizeGroup::phase
const phaseModel & phase() const
Return const-reference to the phase.
Definition: sizeGroupI.H:38
Foam::fac::grad
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh >> grad(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facGrad.C:56
rho
rho
Definition: readInitialConditions.H:88
Foam::diameterModels::driftModels::densityChangeDrift::densityChangeDrift
densityChangeDrift(const populationBalanceModel &popBal, const dictionary &dict)
Definition: densityChange.C:52
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
densityChange.H
fvcGrad.H
Calculate the gradient of the given field.
Foam::fac::ddt
tmp< GeometricField< Type, faPatchField, areaMesh > > ddt(const dimensioned< Type > dt, const faMesh &mesh)
Definition: facDdt.C:47
fvcDdt.H
Calculate the first temporal derivative.
Foam::phaseModel::rho
const dimensionedScalar & rho() const
Definition: phaseModel.H:167
Foam::diameterModels::driftModel
Base class for drift models.
Definition: driftModel.H:52
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::diameterModels::driftModels::addToRunTimeSelectionTable
addToRunTimeSelectionTable(driftModel, constantDrift, dictionary)
Foam::diameterModels::driftModels::densityChangeDrift::addToDriftRate
virtual void addToDriftRate(volScalarField &driftRate, const label i)
Add to driftRate.
Definition: densityChange.C:65