Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
99e20b3b
Commit
99e20b3b
authored
Aug 04, 2020
by
Mark OLESEN
Committed by
Sergio Ferraris
Aug 05, 2020
Browse files
ENH: combine some phaseSystem selectors into regular .C files
- reduces the number of files, eases code refactoring
parent
93ed9337
Changes
190
Hide whitespace changes
Inline
Side-by-side
src/phaseSystemModels/multiphaseEuler/multiphaseSystem/Make/files
View file @
99e20b3b
...
...
@@ -4,14 +4,12 @@ multiphaseSystem/multiphaseSystem.C
diameter = diameterModels
$(diameter)/diameterModel/diameterModel.C
$(diameter)/diameterModel/diameterModelNew.C
$(diameter)/constantDiameter/constantDiameter.C
$(diameter)/isothermalDiameter/isothermalDiameter.C
drag = interfacialModels/dragModels
$(drag)/dragModel/dragModel.C
$(drag)/dragModel/dragModelNew.C
$(drag)/Ergun/Ergun.C
$(drag)/GidaspowErgunWenYu/GidaspowErgunWenYu.C
$(drag)/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C
...
...
@@ -24,7 +22,6 @@ $(drag)/interface/interface.C
heatTransfer = interfacialModels/heatTransferModels
$(heatTransfer)/heatTransferModel/heatTransferModel.C
$(heatTransfer)/heatTransferModel/heatTransferModelNew.C
$(heatTransfer)/RanzMarshall/RanzMarshall.C
...
...
src/phaseSystemModels/multiphaseEuler/multiphaseSystem/diameterModels/constantDiameter/constantDiameter.C
View file @
99e20b3b
...
...
@@ -59,12 +59,6 @@ Foam::diameterModels::constant::constant
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam
::
diameterModels
::
constant
::~
constant
()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam
::
tmp
<
Foam
::
volScalarField
>
Foam
::
diameterModels
::
constant
::
d
()
const
...
...
src/phaseSystemModels/multiphaseEuler/multiphaseSystem/diameterModels/constantDiameter/constantDiameter.H
View file @
99e20b3b
...
...
@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2013 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -54,7 +55,7 @@ class constant
:
public
diameterModel
{
// Private
d
ata
// Private
D
ata
//- The constant diameter of the phase
dimensionedScalar
d_
;
...
...
@@ -77,7 +78,7 @@ public:
//- Destructor
virtual
~
constant
();
virtual
~
constant
()
=
default
;
// Member Functions
...
...
src/phaseSystemModels/multiphaseEuler/multiphaseSystem/diameterModels/diameterModel/diameterModel.C
View file @
99e20b3b
...
...
@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2013 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -49,10 +50,40 @@ Foam::diameterModel::diameterModel
{}
// * * * * * * * * * * * * * * * *
Destru
ctor
* * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * *
Sele
ctor
s *
* * * * * * * * * * * * * * * //
Foam
::
diameterModel
::~
diameterModel
()
{}
Foam
::
autoPtr
<
Foam
::
diameterModel
>
Foam
::
diameterModel
::
New
(
const
dictionary
&
dict
,
const
phaseModel
&
phase
)
{
const
word
modelType
(
dict
.
get
<
word
>
(
"diameterModel"
));
Info
<<
"Selecting diameterModel for phase "
<<
phase
.
name
()
<<
": "
<<
modelType
<<
endl
;
auto
cstrIter
=
dictionaryConstructorTablePtr_
->
cfind
(
modelType
);
if
(
!
cstrIter
.
found
())
{
FatalIOErrorInLookup
(
dict
,
"diameterModel"
,
modelType
,
*
dictionaryConstructorTablePtr_
)
<<
exit
(
FatalIOError
);
}
return
cstrIter
()
(
dict
.
optionalSubDict
(
modelType
+
"Coeffs"
),
phase
);
}
// ************************************************************************* //
src/phaseSystemModels/multiphaseEuler/multiphaseSystem/diameterModels/diameterModel/diameterModel.H
View file @
99e20b3b
...
...
@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2013 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -31,7 +32,6 @@ Description
SourceFiles
diameterModel.C
newDiameterModel.C
\*---------------------------------------------------------------------------*/
...
...
@@ -55,9 +55,10 @@ class diameterModel
{
protected:
// Protected
d
ata
// Protected
D
ata
const
dictionary
&
dict_
;
const
phaseModel
&
phase_
;
...
...
@@ -92,7 +93,7 @@ public:
//- Destructor
virtual
~
diameterModel
();
virtual
~
diameterModel
()
=
default
;
// Selectors
...
...
src/phaseSystemModels/multiphaseEuler/multiphaseSystem/diameterModels/diameterModel/diameterModelNew.C
deleted
100644 → 0
View file @
93ed9337
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include
"diameterModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam
::
autoPtr
<
Foam
::
diameterModel
>
Foam
::
diameterModel
::
New
(
const
dictionary
&
dict
,
const
phaseModel
&
phase
)
{
const
word
modelType
(
dict
.
get
<
word
>
(
"diameterModel"
));
Info
<<
"Selecting diameterModel for phase "
<<
phase
.
name
()
<<
": "
<<
modelType
<<
endl
;
auto
cstrIter
=
dictionaryConstructorTablePtr_
->
cfind
(
modelType
);
if
(
!
cstrIter
.
found
())
{
FatalIOErrorInLookup
(
dict
,
"diameterModel"
,
modelType
,
*
dictionaryConstructorTablePtr_
)
<<
exit
(
FatalIOError
);
}
return
cstrIter
()
(
dict
.
optionalSubDict
(
modelType
+
"Coeffs"
),
phase
);
}
// ************************************************************************* //
src/phaseSystemModels/multiphaseEuler/multiphaseSystem/diameterModels/isothermalDiameter/isothermalDiameter.C
View file @
99e20b3b
...
...
@@ -60,12 +60,6 @@ Foam::diameterModels::isothermal::isothermal
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam
::
diameterModels
::
isothermal
::~
isothermal
()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam
::
tmp
<
Foam
::
volScalarField
>
Foam
::
diameterModels
::
isothermal
::
d
()
const
...
...
src/phaseSystemModels/multiphaseEuler/multiphaseSystem/diameterModels/isothermalDiameter/isothermalDiameter.H
View file @
99e20b3b
...
...
@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2013 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -54,7 +55,7 @@ class isothermal
:
public
diameterModel
{
// Private
d
ata
// Private
D
ata
//- Reference diameter for the isothermal expansion
dimensionedScalar
d0_
;
...
...
@@ -80,7 +81,7 @@ public:
//- Destructor
virtual
~
isothermal
();
virtual
~
isothermal
()
=
default
;
// Member Functions
...
...
src/phaseSystemModels/multiphaseEuler/multiphaseSystem/interfacialModels/dragModels/blended/blended.C
View file @
99e20b3b
...
...
@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -61,12 +62,6 @@ Foam::dragModels::blended::blended
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam
::
dragModels
::
blended
::~
blended
()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam
::
tmp
<
Foam
::
volScalarField
>
Foam
::
dragModels
::
blended
::
K
...
...
src/phaseSystemModels/multiphaseEuler/multiphaseSystem/interfacialModels/dragModels/blended/blended.H
View file @
99e20b3b
...
...
@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -80,7 +81,7 @@ public:
//- Destructor
virtual
~
blended
();
virtual
~
blended
()
=
default
;
// Member Functions
...
...
src/phaseSystemModels/multiphaseEuler/multiphaseSystem/interfacialModels/dragModels/dragModel/dragModel.C
View file @
99e20b3b
...
...
@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -40,23 +41,50 @@ namespace Foam
Foam
::
dragModel
::
dragModel
(
const
dictionary
&
interfaceD
ict
,
const
dictionary
&
d
ict
,
const
phaseModel
&
phase1
,
const
phaseModel
&
phase2
)
:
interfaceDict_
(
interfaceD
ict
),
interfaceDict_
(
d
ict
),
phase1_
(
phase1
),
phase2_
(
phase2
),
residualPhaseFraction_
(
"residualPhaseFraction"
,
dimless
,
interfaceD
ict
),
residualSlip_
(
"residualSlip"
,
dimVelocity
,
interfaceD
ict
)
residualPhaseFraction_
(
"residualPhaseFraction"
,
dimless
,
d
ict
),
residualSlip_
(
"residualSlip"
,
dimVelocity
,
d
ict
)
{}
// * * * * * * * * * * * * * * * *
Destru
ctor
* * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * *
Sele
ctor
s *
* * * * * * * * * * * * * * * //
Foam
::
dragModel
::~
dragModel
()
{}
Foam
::
autoPtr
<
Foam
::
dragModel
>
Foam
::
dragModel
::
New
(
const
dictionary
&
dict
,
const
phaseModel
&
phase1
,
const
phaseModel
&
phase2
)
{
const
word
modelType
(
dict
.
get
<
word
>
(
"type"
));
Info
<<
"Selecting dragModel for phase "
<<
phase1
.
name
()
<<
": "
<<
modelType
<<
endl
;
auto
cstrIter
=
dictionaryConstructorTablePtr_
->
cfind
(
modelType
);
if
(
!
cstrIter
.
found
())
{
FatalIOErrorInLookup
(
dict
,
"dragModel"
,
modelType
,
*
dictionaryConstructorTablePtr_
)
<<
exit
(
FatalIOError
);
}
return
cstrIter
()(
dict
,
phase1
,
phase2
);
}
// ************************************************************************* //
src/phaseSystemModels/multiphaseEuler/multiphaseSystem/interfacialModels/dragModels/dragModel/dragModel.H
View file @
99e20b3b
...
...
@@ -30,7 +30,6 @@ Description
SourceFiles
dragModel.C
newDragModel.C
\*---------------------------------------------------------------------------*/
...
...
@@ -54,7 +53,7 @@ class dragModel
{
protected:
// Protected
d
ata
// Protected
D
ata
const
dictionary
&
interfaceDict_
;
const
phaseModel
&
phase1_
;
...
...
@@ -88,21 +87,21 @@ public:
dragModel
(
const
dictionary
&
interfaceD
ict
,
const
dictionary
&
d
ict
,
const
phaseModel
&
phase1
,
const
phaseModel
&
phase2
);
//- Destructor
virtual
~
dragModel
();
virtual
~
dragModel
()
=
default
;
// Selectors
static
autoPtr
<
dragModel
>
New
(
const
dictionary
&
interfaceD
ict
,
const
dictionary
&
d
ict
,
const
phaseModel
&
phase1
,
const
phaseModel
&
phase2
);
...
...
src/phaseSystemModels/multiphaseEuler/multiphaseSystem/interfacialModels/dragModels/dragModel/dragModelNew.C
deleted
100644 → 0
View file @
93ed9337
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include
"dragModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam
::
autoPtr
<
Foam
::
dragModel
>
Foam
::
dragModel
::
New
(
const
dictionary
&
interfaceDict
,
const
phaseModel
&
phase1
,
const
phaseModel
&
phase2
)
{
const
word
modelType
(
interfaceDict
.
get
<
word
>
(
"type"
));
Info
<<
"Selecting dragModel for phase "
<<
phase1
.
name
()
<<
": "
<<
modelType
<<
endl
;
auto
cstrIter
=
dictionaryConstructorTablePtr_
->
cfind
(
modelType
);
if
(
!
cstrIter
.
found
())
{
FatalIOErrorInLookup
(
interfaceDict
,
"dragModel"
,
modelType
,
*
dictionaryConstructorTablePtr_
)
<<
exit
(
FatalIOError
);
}
return
cstrIter
()(
interfaceDict
,
phase1
,
phase2
);
}
// ************************************************************************* //
src/phaseSystemModels/multiphaseEuler/multiphaseSystem/interfacialModels/dragModels/interface/interface.C
View file @
99e20b3b
...
...
@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -59,12 +60,6 @@ Foam::dragModels::interface::interface
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam
::
dragModels
::
interface
::~
interface
()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam
::
tmp
<
Foam
::
volScalarField
>
Foam
::
dragModels
::
interface
::
K
...
...
src/phaseSystemModels/multiphaseEuler/multiphaseSystem/interfacialModels/dragModels/interface/interface.H
View file @
99e20b3b
...
...
@@ -73,7 +73,7 @@ public:
//- Destructor
virtual
~
interface
();
virtual
~
interface
()
=
default
;
// Member Functions
...
...
src/phaseSystemModels/multiphaseEuler/multiphaseSystem/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C
View file @
99e20b3b
...
...
@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2012 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -40,23 +41,54 @@ namespace Foam
Foam
::
heatTransferModel
::
heatTransferModel
(
const
dictionary
&
interfaceD
ict
,
const
dictionary
&
d
ict
,
const
volScalarField
&
alpha1
,
const
phaseModel
&
phase1
,
const
phaseModel
&
phase2
)
:
interfaceDict_
(
interfaceD
ict
),
interfaceDict_
(
d
ict
),
alpha1_
(
alpha1
),
phase1_
(
phase1
),
phase2_
(
phase2
)
{}
// * * * * * * * * * * * * * * * *
Destru
ctor
* * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * *
Sele
ctor
s *
* * * * * * * * * * * * * * * //
Foam
::
heatTransferModel
::~
heatTransferModel
()
{}
Foam
::
autoPtr
<
Foam
::
heatTransferModel
>
Foam
::
heatTransferModel
::
New
(
const
dictionary
&
dict
,
const
volScalarField
&
alpha1
,
const
phaseModel
&
phase1
,
const
phaseModel
&
phase2
)
{
const
word
modelType
(
dict
.
get
<
word
>
(
"heatTransferModel"
+
phase1
.
name
())
);
Info
<<
"Selecting heatTransferModel for phase "
<<
phase1
.
name
()
<<
": "
<<
modelType
<<
endl
;
auto
cstrIter
=
dictionaryConstructorTablePtr_
->
cfind
(
modelType
);
if
(
!
cstrIter
.
found
())
{
FatalIOErrorInLookup
(
dict
,
"heatTransferModel"
,
modelType
,
*
dictionaryConstructorTablePtr_
)
<<
exit
(
FatalIOError
);
}
return
cstrIter
()(
dict
,
alpha1
,
phase1
,
phase2
);
}
// ************************************************************************* //
src/phaseSystemModels/multiphaseEuler/multiphaseSystem/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.H
View file @
99e20b3b
...
...
@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License