sizeGroup.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 "sizeGroup.H"
29 #include "populationBalanceModel.H"
30 #include "mixedFvPatchField.H"
31 
32 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33 
35 (
36  const word& name,
37  const dictionary& dict,
38  const phaseModel& phase,
40  const fvMesh& mesh
41 )
42 :
44  (
45  IOobject
46  (
47  IOobject::groupName
48  (
49  name,
50  IOobject::groupName
51  (
54  )
55  ),
56  mesh.time().timeName(),
57  mesh,
58  IOobject::READ_IF_PRESENT,
59  IOobject::AUTO_WRITE
60  ),
61  mesh,
62  dimensionedScalar(name, dimless, readScalar(dict.lookup("value"))),
63  velocityGroup.f().boundaryField().types()
64  ),
65  phase_(phase),
66  velocityGroup_(velocityGroup),
67  d_("d", dimLength, dict),
68  x_("x", velocityGroup.formFactor()*pow3(d_)),
69  value_(readScalar(dict.lookup("value")))
70 {
71  // Adjust refValue at mixedFvPatchField boundaries
72  forAll(this->boundaryField(), patchi)
73  {
74  typedef mixedFvPatchField<scalar> mixedFvPatchScalarField;
75 
76  if
77  (
78  isA<mixedFvPatchScalarField>(this->boundaryFieldRef()[patchi])
79  )
80  {
81  mixedFvPatchScalarField& f =
82  refCast<mixedFvPatchScalarField>
83  (
84  this->boundaryFieldRef()[patchi]
85  );
86 
87  f.refValue() = value_;
88  }
89  }
90 }
91 
92 
93 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
94 
96 {}
97 
98 
99 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
100 
103 {
105  return nullptr;
106 }
107 
108 
109 // ************************************************************************* //
populationBalanceModel.H
Foam::phaseModel
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:57
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
Foam::dimless
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
Definition: dimensionSets.H:50
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::dimLength
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:53
Foam::phase
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phase.H:54
Foam::diameterModels::sizeGroup::clone
autoPtr< sizeGroup > clone() const
Return clone.
Definition: sizeGroup.C:102
Foam::diameterModels::velocityGroup::formFactor
const dimensionedScalar & formFactor() const
Return the form factor.
Definition: velocityGroupI.H:45
mixedFvPatchField.H
Foam::diameterModels::velocityGroup::popBalName
const word & popBalName() const
Return name of populationBalance this velocityGroup belongs to.
Definition: velocityGroupI.H:31
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:290
Foam::diameterModels::sizeGroup::sizeGroup
sizeGroup(const word &name, const dictionary &dict, const phaseModel &phase, const velocityGroup &velocityGroup, const fvMesh &mesh)
Definition: sizeGroup.C:35
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:419
Foam::pow3
dimensionedScalar pow3(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:89
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::diameterModels::sizeGroup::~sizeGroup
virtual ~sizeGroup()
Destructor.
Definition: sizeGroup.C:95
sizeGroup.H
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:43
Foam::diameterModels::velocityGroup
This diameterModel is intended for use with a populationBalanceModel in order to simulate polydispers...
Definition: velocityGroup.H:107
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
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
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam::mixedFvPatchField< scalar >
Foam::diameterModels::velocityGroup::f
const volScalarField & f() const
Return reference field for sizeGroup's.
Definition: velocityGroupI.H:38
Foam::phaseModel::name
const word & name() const
Return the name of this phase.
Definition: phaseModel.C:94
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
f
labelList f(nPoints)
Foam::diameterModel::phase
const phaseModel & phase() const
Return the phase.
Definition: diameterModel.H:116
Foam::GeometricField::boundaryField
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Definition: GeometricFieldI.H:62