blended.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) 2011 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "blended.H"
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 namespace dragModels
37 {
39 
41  (
42  dragModel,
43  blended,
45  );
46 }
47 }
48 
49 
50 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
51 
53 (
54  const dictionary& interfaceDict,
55  const phaseModel& phase1,
56  const phaseModel& phase2
57 )
58 :
59  dragModel(interfaceDict, phase1, phase2),
60  dragModel1_(New(interfaceDict.subDict(phase1.name()), phase1, phase2)),
61  dragModel2_(New(interfaceDict.subDict(phase2.name()), phase2, phase1))
62 {}
63 
64 
65 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
66 
68 (
69  const volScalarField& Ur
70 ) const
71 {
72  return phase2()*dragModel1_->K(Ur) + phase1()*dragModel2_->K(Ur);
73 }
74 
75 
76 // ************************************************************************* //
Foam::phaseModel
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:54
Foam::dragModels::defineTypeNameAndDebug
defineTypeNameAndDebug(blended, 0)
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::dragModel::K
virtual tmp< volScalarField > K() const
Return the drag coefficient K.
Definition: dragModel.C:153
Foam::dragModels::blended::blended
blended(const dictionary &interfaceDict, const phaseModel &phase1, const phaseModel &phase2)
Construct from components.
Definition: blended.C:53
Foam::dragModels::blended
Blends two drag models based on the phase fractions to handle phase-inversion.
Definition: blended.H:54
Foam::dictionary::subDict
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
Definition: dictionary.C:460
Foam::dragModels::addToRunTimeSelectionTable
addToRunTimeSelectionTable(dragModel, blended, dictionary)
phase2
phaseModel & phase2
Definition: setRegionFluidFields.H:6
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::New
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Definition: DimensionedFieldReuseFunctions.H:105
blended.H
Foam::dragModel
Definition: dragModel.H:51
phase1
phaseModel & phase1
Definition: setRegionFluidFields.H:5
Foam::GeometricField< scalar, fvPatchField, volMesh >