From 13562fa31a9bad77cc02b0bacbbfcf677fa9af11 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 6 Apr 2023 08:06:53 +0100 Subject: [PATCH] multiphaseEuler::wallBoiling,IATEwallBoiling: Completed moving to multiphaseThermophysicalTransportModels to avoid compilation cyclic dependency --- .../IATEsources/wallBoiling/IATEwallBoiling.H | 2 +- .../wallBoiling/wallBoiling.H | 2 +- .../IATEsources/wallBoiling/IATEwallBoiling.C | 133 ------------- .../wallBoiling/wallBoiling.C | 182 ------------------ 4 files changed, 2 insertions(+), 317 deletions(-) rename applications/solvers/modules/multiphaseEuler/{phaseSystems => multiphaseThermophysicalTransportModels}/diameterModels/IATE/IATEsources/wallBoiling/IATEwallBoiling.H (97%) rename applications/solvers/modules/multiphaseEuler/{phaseSystems => multiphaseThermophysicalTransportModels}/populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.H (97%) delete mode 100644 applications/solvers/modules/multiphaseEuler/phaseSystems/diameterModels/IATE/IATEsources/wallBoiling/IATEwallBoiling.C delete mode 100644 applications/solvers/modules/multiphaseEuler/phaseSystems/populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.C diff --git a/applications/solvers/modules/multiphaseEuler/phaseSystems/diameterModels/IATE/IATEsources/wallBoiling/IATEwallBoiling.H b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/diameterModels/IATE/IATEsources/wallBoiling/IATEwallBoiling.H similarity index 97% rename from applications/solvers/modules/multiphaseEuler/phaseSystems/diameterModels/IATE/IATEsources/wallBoiling/IATEwallBoiling.H rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/diameterModels/IATE/IATEsources/wallBoiling/IATEwallBoiling.H index 38dba6ee75..df42555eee 100644 --- a/applications/solvers/modules/multiphaseEuler/phaseSystems/diameterModels/IATE/IATEsources/wallBoiling/IATEwallBoiling.H +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/diameterModels/IATE/IATEsources/wallBoiling/IATEwallBoiling.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/solvers/modules/multiphaseEuler/phaseSystems/populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.H b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.H similarity index 97% rename from applications/solvers/modules/multiphaseEuler/phaseSystems/populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.H rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.H index aa14f5fe5f..63b01898e0 100644 --- a/applications/solvers/modules/multiphaseEuler/phaseSystems/populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.H +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/solvers/modules/multiphaseEuler/phaseSystems/diameterModels/IATE/IATEsources/wallBoiling/IATEwallBoiling.C b/applications/solvers/modules/multiphaseEuler/phaseSystems/diameterModels/IATE/IATEsources/wallBoiling/IATEwallBoiling.C deleted file mode 100644 index 9472871eb5..0000000000 --- a/applications/solvers/modules/multiphaseEuler/phaseSystems/diameterModels/IATE/IATEsources/wallBoiling/IATEwallBoiling.C +++ /dev/null @@ -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 . - -\*---------------------------------------------------------------------------*/ - -#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::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 - ( - 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(alphatBf[patchi])) - { - const alphatWallBoilingWallFunction& alphatw = - refCast(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); -} - - -// ************************************************************************* // diff --git a/applications/solvers/modules/multiphaseEuler/phaseSystems/populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.C b/applications/solvers/modules/multiphaseEuler/phaseSystems/populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.C deleted file mode 100644 index 4da9569618..0000000000 --- a/applications/solvers/modules/multiphaseEuler/phaseSystems/populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.C +++ /dev/null @@ -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 . - -\*---------------------------------------------------------------------------*/ - -#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 - ( - IOobject::groupName("alphat", popBal_.continuousPhase().name()) - ); - - const volScalarField::Boundary& alphatBf = alphat.boundaryField(); - - typedef compressible::alphatWallBoilingWallFunctionFvPatchScalarField - alphatWallBoilingWallFunction; - - forAll(alphatBf, patchi) - { - if (isA(alphatBf[patchi])) - { - const alphatWallBoilingWallFunction& alphatw = - refCast(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 - ( - IOobject::groupName("alphat", popBal_.continuousPhase().name()) - ); - - const volScalarField::Boundary& alphatBf = alphat.boundaryField(); - - typedef compressible::alphatWallBoilingWallFunctionFvPatchScalarField - alphatWallBoilingWallFunction; - - forAll(alphatBf, patchi) - { - if - ( - isA(alphatBf[patchi]) - ) - { - const alphatWallBoilingWallFunction& alphatw = - refCast(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(); - } - } - } - } -} - - -// ************************************************************************* //