multiphaseInterFoam::multiphaseMixture::phase: simplified interface

This commit is contained in:
Henry Weller
2023-01-06 18:46:41 +00:00
parent 06893a0bc6
commit f16e60c517
3 changed files with 13 additions and 25 deletions

View File

@ -71,7 +71,7 @@ Foam::multiphaseMixture::multiphaseMixture
)
),
phases_(lookup("phases"), phase::iNew(U, phi)),
phases_(lookup("phases"), phase::iNew(U.mesh())),
mesh_(U.mesh()),
U_(U),

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -27,27 +27,22 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::phase::phase
(
const word& phaseName,
const volVectorField& U,
const surfaceScalarField& phi
)
Foam::phase::phase(const word& phaseName, const fvMesh& mesh)
:
volScalarField
(
IOobject
(
IOobject::groupName("alpha", phaseName),
U.mesh().time().name(),
U.mesh(),
mesh.time().name(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
U.mesh()
mesh
),
name_(phaseName),
nuModel_(viscosityModel::New(U.mesh(), phaseName)),
nuModel_(viscosityModel::New(mesh, phaseName)),
rho_("rho", dimDensity, nuModel_())
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -69,8 +69,7 @@ public:
phase
(
const word& name,
const volVectorField& U,
const surfaceScalarField& phi
const fvMesh& mesh
);
//- Return clone
@ -80,25 +79,19 @@ public:
// from Istream
class iNew
{
const volVectorField& U_;
const surfaceScalarField& phi_;
const fvMesh& mesh_;
public:
iNew
(
const volVectorField& U,
const surfaceScalarField& phi
)
iNew(const fvMesh& mesh)
:
U_(U),
phi_(phi)
mesh_(mesh)
{}
autoPtr<phase> operator()(Istream& is) const
{
const word name(is);
return autoPtr<phase>(new phase(name, U_, phi_));
return autoPtr<phase>(new phase(name, mesh_));
}
};