multiphaseEuler: Uniquely name fields to prevent duplicate registration

This commit is contained in:
Will Bainbridge
2024-07-30 11:01:35 +01:00
parent 2da4528add
commit b4edb74dcf
4 changed files with 37 additions and 25 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2024 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -154,7 +154,7 @@ void Foam::phaseSystem::solve(const PtrList<volScalarField>& rAs)
( (
IOobject IOobject
( (
"Sp", IOobject::groupName("Sp", phase.name()),
mesh_.time().name(), mesh_.time().name(),
mesh_ mesh_
), ),
@ -168,7 +168,7 @@ void Foam::phaseSystem::solve(const PtrList<volScalarField>& rAs)
phasei, phasei,
new volScalarField::Internal new volScalarField::Internal
( (
"Su", IOobject::groupName("Su", phase.name()),
min(alpha.v(), scalar(1)) min(alpha.v(), scalar(1))
*fvc::div(fvc::absolute(phi_, phase.U()))->v() *fvc::div(fvc::absolute(phi_, phase.U()))->v()
) )

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2023 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015-2024 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -708,7 +708,7 @@ void Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::invADVs
addField addField
( (
i, i,
"HVm", IOobject::groupName("HVm", phase.name()),
VmPhase*HDUDts[i], VmPhase*HDUDts[i],
HVms HVms
); );
@ -726,7 +726,7 @@ void Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::invADVs
addField addField
( (
i, i,
"HVm", IOobject::groupName("HVm", phase.name()),
-VmPhase*HDUDts[j], -VmPhase*HDUDts[j],
HVms HVms
); );
@ -887,7 +887,7 @@ Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::invADVfs
addField addField
( (
i, i,
"HVmf", IOobject::groupName("HVmf", phase.name()),
VmPhasef VmPhasef
*byDt *byDt
( (
@ -911,7 +911,7 @@ Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::invADVfs
addField addField
( (
i, i,
"HVmf", IOobject::groupName("HVmf", phase.name()),
-VmPhasef -VmPhasef
*byDt *byDt
( (
@ -1174,7 +1174,7 @@ void Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::dragCorrs
addField addField
( (
i, i,
"dragCorr", IOobject::groupName("dragCorr", phase.name()),
K1*(j == -1 ? -Uphis[i] : (Uphis[j] - Uphis[i])), K1*(j == -1 ? -Uphis[i] : (Uphis[j] - Uphis[i])),
dragCorrs dragCorrs
); );
@ -1182,7 +1182,7 @@ void Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::dragCorrs
addField addField
( (
i, i,
"dragCorrf", IOobject::groupName("dragCorrf", phase.name()),
fvc::interpolate(K1) fvc::interpolate(K1)
*(j == -1 ? -phase.phi() : (otherPhase.phi() - phase.phi())), *(j == -1 ? -phase.phi() : (otherPhase.phi() - phase.phi())),
dragCorrfs dragCorrfs

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2023 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2024 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -843,7 +843,12 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel
i, i,
new volScalarField new volScalarField
( (
IOobject("Su", fluid_.time().name(), mesh_), IOobject
(
IOobject::groupName("Su" + Foam::name(i), this->name()),
fluid_.time().name(),
mesh_
),
mesh_, mesh_,
dimensionedScalar(inv(dimTime), 0) dimensionedScalar(inv(dimTime), 0)
) )
@ -854,7 +859,12 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel
i, i,
new volScalarField new volScalarField
( (
IOobject("Sp", fluid_.time().name(), mesh_), IOobject
(
IOobject::groupName("Sp" + Foam::name(i), this->name()),
fluid_.time().name(),
mesh_
),
mesh_, mesh_,
dimensionedScalar(inv(dimTime), 0) dimensionedScalar(inv(dimTime), 0)
) )
@ -871,7 +881,7 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel
( (
IOobject IOobject
( (
"coalescenceRate", IOobject::groupName("coalescenceRate", this->name()),
mesh_.time().name(), mesh_.time().name(),
mesh_ mesh_
), ),
@ -897,7 +907,7 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel
( (
IOobject IOobject
( (
"breakupRate", IOobject::groupName("breakupRate", this->name()),
fluid_.time().name(), fluid_.time().name(),
mesh_ mesh_
), ),
@ -915,7 +925,7 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel
( (
IOobject IOobject
( (
"binaryBreakupRate", IOobject::groupName("binaryBreakupRate", this->name()),
fluid_.time().name(), fluid_.time().name(),
mesh_ mesh_
), ),
@ -951,7 +961,7 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel
( (
IOobject IOobject
( (
"driftRate", IOobject::groupName("driftRate", this->name()),
fluid_.time().name(), fluid_.time().name(),
mesh_ mesh_
), ),
@ -969,7 +979,7 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel
( (
IOobject IOobject
( (
"nucleationRate", IOobject::groupName("nucleationRate", this->name()),
fluid_.time().name(), fluid_.time().name(),
mesh_ mesh_
), ),

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2023 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015-2024 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -74,8 +74,7 @@ Foam::wallDist::wallDist(const fvMesh& mesh, const word& patchTypeName)
( (
patchDistMethod::New patchDistMethod::New
( (
static_cast<const fvSchemes&>(mesh) mesh.schemes().subDict(patchTypeName_ & "Dist"),
.subDict(patchTypeName_ & "Dist"),
mesh, mesh,
patchIndices_ patchIndices_
) )
@ -94,7 +93,9 @@ Foam::wallDist::wallDist(const fvMesh& mesh, const word& patchTypeName)
), ),
nRequired_ nRequired_
( (
static_cast<const fvSchemes&>(mesh).subDict(patchTypeName_ & "Dist") mesh
.schemes()
.subDict(patchTypeName_ & "Dist")
.lookupOrDefault<Switch>("nRequired", false) .lookupOrDefault<Switch>("nRequired", false)
) )
{ {
@ -124,8 +125,7 @@ Foam::wallDist::wallDist
( (
patchDistMethod::New patchDistMethod::New
( (
static_cast<const fvSchemes&>(mesh) mesh.schemes().subDict(patchTypeName_ & "Dist"),
.subDict(patchTypeName_ & "Dist"),
mesh, mesh,
patchIndices_ patchIndices_
) )
@ -144,7 +144,9 @@ Foam::wallDist::wallDist
), ),
nRequired_ nRequired_
( (
static_cast<const fvSchemes&>(mesh).subDict(patchTypeName_ & "Dist") mesh
.schemes()
.subDict(patchTypeName_ & "Dist")
.lookupOrDefault<Switch>("nRequired", false) .lookupOrDefault<Switch>("nRequired", false)
) )
{ {