multiphaseEuler::wallBoiling,IATEwallBoiling: Completed moving to multiphaseThermophysicalTransportModels

to avoid compilation cyclic dependency
This commit is contained in:
Henry Weller
2023-04-06 08:06:53 +01:00
parent 05ffb6a6ff
commit 13562fa31a
4 changed files with 2 additions and 317 deletions

View File

@ -1,133 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
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 "IATEwallBoiling.H"
#include "alphatWallBoilingWallFunctionFvPatchScalarField.H"
#include "fvmSup.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace diameterModels
{
namespace IATEsources
{
defineTypeNameAndDebug(wallBoiling, 0);
addToRunTimeSelectionTable(IATEsource, wallBoiling, dictionary);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::diameterModels::IATEsources::wallBoiling::wallBoiling
(
const IATE& iate,
const dictionary& dict
)
:
IATEsource(iate)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::fvScalarMatrix>
Foam::diameterModels::IATEsources::wallBoiling::R
(
const volScalarField& alphai,
volScalarField& kappai
) const
{
volScalarField::Internal R
(
IOobject
(
typedName("R"),
phase().time().name(),
phase().mesh()
),
phase().mesh(),
dimensionedScalar(dimless/dimTime, 0)
);
volScalarField::Internal Rdk
(
IOobject
(
typedName("Rdk"),
phase().time().name(),
phase().mesh()
),
phase().mesh(),
dimensionedScalar(kappai.dimensions()/dimTime, 0)
);
const volScalarField& alphat =
phase().mesh().lookupObject<volScalarField>
(
IOobject::groupName("alphat", otherPhase().name())
);
const volScalarField::Boundary& alphatBf = alphat.boundaryField();
const scalarField& rho = phase().rho();
typedef compressible::alphatWallBoilingWallFunctionFvPatchScalarField
alphatWallBoilingWallFunction;
forAll(alphatBf, patchi)
{
if (isA<alphatWallBoilingWallFunction>(alphatBf[patchi]))
{
const alphatWallBoilingWallFunction& alphatw =
refCast<const alphatWallBoilingWallFunction>(alphatBf[patchi]);
const scalarField& dmdt = alphatw.dmdtf();
const scalarField& dDep = alphatw.dDeparture();
const labelList& faceCells = alphatw.patch().faceCells();
forAll(alphatw, facei)
{
if (dmdt[facei] > small)
{
const label faceCelli = faceCells[facei];
R[faceCelli] =
dmdt[facei]/(alphai[faceCelli]*rho[faceCelli]);
Rdk[faceCelli] = R[faceCelli]*(6.0/dDep[facei]);
}
}
}
}
return Rdk - fvm::Sp(R, kappai);
}
// ************************************************************************* //

View File

@ -1,98 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
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/>.
Class
Foam::diameterModels::IATEsources::wallBoiling
Description
Wall-boiling IATE source.
SourceFiles
wallBoiling.C
\*---------------------------------------------------------------------------*/
#ifndef IATEwallBoiling_H
#define IATEwallBoiling_H
#include "IATEsource.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace diameterModels
{
namespace IATEsources
{
/*---------------------------------------------------------------------------*\
Class wallBoiling Declaration
\*---------------------------------------------------------------------------*/
class wallBoiling
:
public IATEsource
{
public:
//- Runtime type information
TypeName("wallBoiling");
// Constructors
wallBoiling
(
const IATE& iate,
const dictionary& dict
);
//- Destructor
virtual ~wallBoiling()
{}
// Member Functions
virtual tmp<fvScalarMatrix> R
(
const volScalarField& alphai,
volScalarField& kappai
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace IATEsources
} // End namespace diameterModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,182 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
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 "wallBoiling.H"
#include "addToRunTimeSelectionTable.H"
#include "alphatWallBoilingWallFunctionFvPatchScalarField.H"
#include "phaseSystem.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace diameterModels
{
namespace nucleationModels
{
defineTypeNameAndDebug(wallBoiling, 0);
addToRunTimeSelectionTable
(
nucleationModel,
wallBoiling,
dictionary
);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::diameterModels::nucleationModels::wallBoiling::
wallBoiling
(
const populationBalanceModel& popBal,
const dictionary& dict
)
:
nucleationModel(popBal, dict)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::diameterModels::nucleationModels::wallBoiling::precompute()
{
const volScalarField& alphat =
popBal_.mesh().lookupObject<volScalarField>
(
IOobject::groupName("alphat", popBal_.continuousPhase().name())
);
const volScalarField::Boundary& alphatBf = alphat.boundaryField();
typedef compressible::alphatWallBoilingWallFunctionFvPatchScalarField
alphatWallBoilingWallFunction;
forAll(alphatBf, patchi)
{
if (isA<alphatWallBoilingWallFunction>(alphatBf[patchi]))
{
const alphatWallBoilingWallFunction& alphatw =
refCast<const alphatWallBoilingWallFunction>(alphatBf[patchi]);
const scalarField& dDep = alphatw.dDeparture();
if (min(dDep) < velGroup_.sizeGroups().first().dSph().value())
{
Warning
<< "Minimum departure diameter " << min(dDep)
<< " m outside of range ["
<< velGroup_.sizeGroups().first().dSph().value() << ", "
<< velGroup_.sizeGroups().last().dSph().value() << "] m"
<< " at patch " << alphatw.patch().name()
<< endl
<< " The nucleation rate in populationBalance "
<< popBal_.name() << " is set to zero." << endl
<< " Adjust discretisation over property space to"
<< " suppress this warning."
<< endl;
}
else if (max(dDep) > velGroup_.sizeGroups().last().dSph().value())
{
Warning
<< "Maximum departure diameter " << max(dDep)
<< " m outside of range ["
<< velGroup_.sizeGroups().first().dSph().value() << ", "
<< velGroup_.sizeGroups().last().dSph().value() << "] m"
<< " at patch " << alphatw.patch().name()
<< endl
<< " The nucleation rate in populationBalance "
<< popBal_.name() << " is set to zero." << endl
<< " Adjust discretisation over property space to"
<< " suppress this warning."
<< endl;
}
}
}
}
void
Foam::diameterModels::nucleationModels::wallBoiling::addToNucleationRate
(
volScalarField& nucleationRate,
const label i
)
{
const sizeGroup& fi = popBal_.sizeGroups()[i];
const phaseModel& phase = fi.phase();
const volScalarField& rho = phase.rho();
const volScalarField& alphat =
popBal_.mesh().lookupObject<volScalarField>
(
IOobject::groupName("alphat", popBal_.continuousPhase().name())
);
const volScalarField::Boundary& alphatBf = alphat.boundaryField();
typedef compressible::alphatWallBoilingWallFunctionFvPatchScalarField
alphatWallBoilingWallFunction;
forAll(alphatBf, patchi)
{
if
(
isA<alphatWallBoilingWallFunction>(alphatBf[patchi])
)
{
const alphatWallBoilingWallFunction& alphatw =
refCast<const alphatWallBoilingWallFunction>(alphatBf[patchi]);
const scalarField& dmdt = alphatw.dmdtf();
const scalarField& dDep = alphatw.dDeparture();
const labelList& faceCells = alphatw.patch().faceCells();
dimensionedScalar unitLength("unitLength", dimLength, 1);
forAll(alphatw, facei)
{
if (dmdt[facei] > small)
{
const label faceCelli = faceCells[facei];
nucleationRate[faceCelli] +=
popBal_.eta
(
i,
fi.x()/pow3(fi.dSph())*pow3(dDep[facei]*unitLength)
).value()
*dmdt[facei]/rho[faceCelli]/fi.x().value();
}
}
}
}
}
// ************************************************************************* //

View File

@ -1,105 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
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/>.
Class
Foam::diameterModels::nucleationModels::wallBoiling
Description
Wall-boiling model which requires a velocityGroup (i.e. phase) to be
specified in which the nucleation occurs. This setting must be consistent
with the specifications in the alphatWallBoilingWallFunction. If the
departure-diameter lies outside the diameter-range given by the sizeGroups
of the corresponding velocityGroup, the solver will give a warning and the
nucleation rate will be set to zero.
SourceFiles
wallBoiling.C
\*---------------------------------------------------------------------------*/
#ifndef wallBoiling_H
#define wallBoiling_H
#include "nucleationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace diameterModels
{
namespace nucleationModels
{
/*---------------------------------------------------------------------------*\
Class wallBoiling Declaration
\*---------------------------------------------------------------------------*/
class wallBoiling
:
public nucleationModel
{
public:
//- Runtime type information
TypeName("wallBoiling");
// Constructor
wallBoiling
(
const populationBalanceModel& popBal,
const dictionary& dict
);
//- Destructor
virtual ~wallBoiling()
{}
// Member Functions
//- Precompute diameter independent expressions
virtual void precompute();
//- Add to nucleationRate
virtual void addToNucleationRate
(
volScalarField& nucleationRate,
const label i
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace nucleationModels
} // End namespace diameterModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //