mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
interPhaseChangeFoam: corrected handling of alpha1 for transport and updated for consistency with interFoam
This commit is contained in:
@ -5,7 +5,10 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
|
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
|
||||||
-IphaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture \
|
-IphaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
|
-I$(LIB_SRC)/fvOptions/lnInclude\
|
||||||
|
-I$(LIB_SRC)/sampling/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-ltwoPhaseMixture \
|
-ltwoPhaseMixture \
|
||||||
@ -15,4 +18,7 @@ EXE_LIBS = \
|
|||||||
-lincompressibleTurbulenceModel \
|
-lincompressibleTurbulenceModel \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
-lincompressibleLESModels \
|
-lincompressibleLESModels \
|
||||||
-lfiniteVolume
|
-lfiniteVolume \
|
||||||
|
-lmeshTools \
|
||||||
|
-lfvOptions \
|
||||||
|
-lsampling
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
)
|
)
|
||||||
+ fvc::flux
|
+ fvc::flux
|
||||||
(
|
(
|
||||||
-fvc::flux(-phir, scalar(1) - alpha1, alpharScheme),
|
-fvc::flux(-phir, alpha2, alpharScheme),
|
||||||
alpha1,
|
alpha1,
|
||||||
alpharScheme
|
alpharScheme
|
||||||
)
|
)
|
||||||
@ -76,6 +76,7 @@
|
|||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
|
alpha2 = 1.0 - alpha1;
|
||||||
rhoPhi +=
|
rhoPhi +=
|
||||||
(runTime.deltaT()/totalDeltaT)
|
(runTime.deltaT()/totalDeltaT)
|
||||||
*(phiAlpha*(rho1 - rho2) + phi*rho2);
|
*(phiAlpha*(rho1 - rho2) + phi*rho2);
|
||||||
|
|||||||
@ -40,5 +40,5 @@ surfaceScalarField rhoPhi
|
|||||||
#include "alphaEqn.H"
|
#include "alphaEqn.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2;
|
rho == alpha1*rho1 + alpha2*rho2;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,20 +12,6 @@
|
|||||||
mesh
|
mesh
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "Reading field alpha1\n" << endl;
|
|
||||||
volScalarField alpha1
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"alpha1",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Reading field U\n" << endl;
|
Info<< "Reading field U\n" << endl;
|
||||||
volVectorField U
|
volVectorField U
|
||||||
(
|
(
|
||||||
@ -42,14 +28,19 @@
|
|||||||
|
|
||||||
#include "createPhi.H"
|
#include "createPhi.H"
|
||||||
|
|
||||||
|
|
||||||
Info<< "Creating phaseChangeTwoPhaseMixture\n" << endl;
|
Info<< "Creating phaseChangeTwoPhaseMixture\n" << endl;
|
||||||
autoPtr<phaseChangeTwoPhaseMixture> twoPhaseProperties =
|
autoPtr<phaseChangeTwoPhaseMixture> twoPhaseProperties =
|
||||||
phaseChangeTwoPhaseMixture::New(U, phi);
|
phaseChangeTwoPhaseMixture::New(U, phi);
|
||||||
|
|
||||||
|
volScalarField& alpha1(twoPhaseProperties->alpha1());
|
||||||
|
volScalarField& alpha2(twoPhaseProperties->alpha2());
|
||||||
|
|
||||||
const dimensionedScalar& rho1 = twoPhaseProperties->rho1();
|
const dimensionedScalar& rho1 = twoPhaseProperties->rho1();
|
||||||
const dimensionedScalar& rho2 = twoPhaseProperties->rho2();
|
const dimensionedScalar& rho2 = twoPhaseProperties->rho2();
|
||||||
const dimensionedScalar& pSat = twoPhaseProperties->pSat();
|
const dimensionedScalar& pSat = twoPhaseProperties->pSat();
|
||||||
|
|
||||||
|
|
||||||
// Need to store rho for ddt(rho, U)
|
// Need to store rho for ddt(rho, U)
|
||||||
volScalarField rho
|
volScalarField rho
|
||||||
(
|
(
|
||||||
@ -60,11 +51,12 @@
|
|||||||
mesh,
|
mesh,
|
||||||
IOobject::READ_IF_PRESENT
|
IOobject::READ_IF_PRESENT
|
||||||
),
|
),
|
||||||
alpha1*rho1 + (scalar(1) - alpha1)*rho2,
|
alpha1*rho1 + alpha2*rho2,
|
||||||
alpha1.boundaryField().types()
|
alpha1.boundaryField().types()
|
||||||
);
|
);
|
||||||
rho.oldTime();
|
rho.oldTime();
|
||||||
|
|
||||||
|
|
||||||
// Construct interface from alpha1 distribution
|
// Construct interface from alpha1 distribution
|
||||||
interfaceProperties interface(alpha1, U, twoPhaseProperties());
|
interfaceProperties interface(alpha1, U, twoPhaseProperties());
|
||||||
|
|
||||||
@ -113,3 +105,5 @@
|
|||||||
);
|
);
|
||||||
p_rgh = p - rho*gh;
|
p_rgh = p - rho*gh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fv::IOoptionList fvOptions(mesh);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -47,6 +47,7 @@ Description
|
|||||||
#include "phaseChangeTwoPhaseMixture.H"
|
#include "phaseChangeTwoPhaseMixture.H"
|
||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
#include "fvIOoptionList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -46,6 +46,7 @@
|
|||||||
|
|
||||||
U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf);
|
U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
|
fvOptions.correct(U);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -94,8 +94,8 @@ PIMPLE
|
|||||||
{
|
{
|
||||||
momentumPredictor no;
|
momentumPredictor no;
|
||||||
nOuterCorrectors 1;
|
nOuterCorrectors 1;
|
||||||
nCorrectors 2;
|
nCorrectors 3;
|
||||||
nNonOrthogonalCorrectors 1;
|
nNonOrthogonalCorrectors 0;
|
||||||
|
|
||||||
cAlpha 0;
|
cAlpha 0;
|
||||||
nAlphaCorr 1;
|
nAlphaCorr 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user