Commit 99e20b3b authored by Mark Olesen's avatar Mark Olesen Committed by Sergio Ferraris
Browse files

ENH: combine some phaseSystem selectors into regular .C files

- reduces the number of files, eases code refactoring
parent 93ed9337
......@@ -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
......
......@@ -59,12 +59,6 @@ Foam::diameterModels::constant::constant
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::diameterModels::constant::~constant()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::diameterModels::constant::d() const
......
......@@ -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 data
// Private Data
//- The constant diameter of the phase
dimensionedScalar d_;
......@@ -77,7 +78,7 @@ public:
//- Destructor
virtual ~constant();
virtual ~constant() = default;
// Member Functions
......
......@@ -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
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
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
);
}
// ************************************************************************* //
......@@ -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 data
// Protected Data
const dictionary& dict_;
const phaseModel& phase_;
......@@ -92,7 +93,7 @@ public:
//- Destructor
virtual ~diameterModel();
virtual ~diameterModel() = default;
// Selectors
......
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
);
}
// ************************************************************************* //
......@@ -60,12 +60,6 @@ Foam::diameterModels::isothermal::isothermal
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::diameterModels::isothermal::~isothermal()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::diameterModels::isothermal::d() const
......
......@@ -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 data
// Private Data
//- Reference diameter for the isothermal expansion
dimensionedScalar d0_;
......@@ -80,7 +81,7 @@ public:
//- Destructor
virtual ~isothermal();
virtual ~isothermal() = default;
// Member Functions
......
......@@ -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
......
......@@ -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
......
......@@ -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& interfaceDict,
const dictionary& dict,
const phaseModel& phase1,
const phaseModel& phase2
)
:
interfaceDict_(interfaceDict),
interfaceDict_(dict),
phase1_(phase1),
phase2_(phase2),
residualPhaseFraction_("residualPhaseFraction", dimless, interfaceDict),
residualSlip_("residualSlip", dimVelocity, interfaceDict)
residualPhaseFraction_("residualPhaseFraction", dimless, dict),
residualSlip_("residualSlip", dimVelocity, dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
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);
}
// ************************************************************************* //
......@@ -30,7 +30,6 @@ Description
SourceFiles
dragModel.C
newDragModel.C
\*---------------------------------------------------------------------------*/
......@@ -54,7 +53,7 @@ class dragModel
{
protected:
// Protected data
// Protected Data
const dictionary& interfaceDict_;
const phaseModel& phase1_;
......@@ -88,21 +87,21 @@ public:
dragModel
(
const dictionary& interfaceDict,
const dictionary& dict,
const phaseModel& phase1,
const phaseModel& phase2
);
//- Destructor
virtual ~dragModel();
virtual ~dragModel() = default;
// Selectors
static autoPtr<dragModel> New
(
const dictionary& interfaceDict,
const dictionary& dict,
const phaseModel& phase1,
const phaseModel& phase2
);
......
/*---------------------------------------------------------------------------*\
========= |
\\ / 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);
}
// ************************************************************************* //
......@@ -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
......
......@@ -73,7 +73,7 @@ public:
//- Destructor
virtual ~interface();
virtual ~interface() = default;
// Member Functions
......
......@@ -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& interfaceDict,
const dictionary& dict,
const volScalarField& alpha1,
const phaseModel& phase1,
const phaseModel& phase2
)
:
interfaceDict_(interfaceDict),
interfaceDict_(dict),
alpha1_(alpha1),
phase1_(phase1),
phase2_(phase2)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
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);
}
// ************************************************************************* //
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -54,7 +55,7 @@ class heatTransferModel
{
protected: