diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Make/options b/applications/solvers/multiphase/interPhaseChangeFoam/Make/options index 58b340781f2d35e0eb103fa024d80e92ad3bb1e5..d4ead1472172b905966cc2e8788cd884ac128c9d 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/Make/options +++ b/applications/solvers/multiphase/interPhaseChangeFoam/Make/options @@ -5,7 +5,10 @@ EXE_INC = \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ -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 = \ -ltwoPhaseMixture \ @@ -15,4 +18,7 @@ EXE_LIBS = \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleLESModels \ - -lfiniteVolume + -lfiniteVolume \ + -lmeshTools \ + -lfvOptions \ + -lsampling diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H index 9ce20db849e48869930b74ce03f186e33c74e5ad..75015542b554c22e0d6d678a44f3cfe549e1e379 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H @@ -16,7 +16,7 @@ ) + fvc::flux ( - -fvc::flux(-phir, scalar(1) - alpha1, alpharScheme), + -fvc::flux(-phir, alpha2, alpharScheme), alpha1, alpharScheme ) @@ -76,6 +76,7 @@ 0 ); + alpha2 = 1.0 - alpha1; rhoPhi += (runTime.deltaT()/totalDeltaT) *(phiAlpha*(rho1 - rho2) + phi*rho2); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H index ad2cf243d2bae2459a62370bf468e335af8c9d04..5e7fd27f7528e9e1d38756c4e35b6e5cd52c4897 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H @@ -40,5 +40,5 @@ surfaceScalarField rhoPhi #include "alphaEqn.H" } - rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2; + rho == alpha1*rho1 + alpha2*rho2; } diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H b/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H index 60f15ab553bd9f2153f257446b956931ba7796ef..0e45fa495e8aa5b1cfcbb6c06c51899c82488e5f 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H @@ -12,20 +12,6 @@ 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; volVectorField U ( @@ -42,14 +28,19 @@ #include "createPhi.H" + Info<< "Creating phaseChangeTwoPhaseMixture\n" << endl; autoPtr<phaseChangeTwoPhaseMixture> twoPhaseProperties = phaseChangeTwoPhaseMixture::New(U, phi); + volScalarField& alpha1(twoPhaseProperties->alpha1()); + volScalarField& alpha2(twoPhaseProperties->alpha2()); + const dimensionedScalar& rho1 = twoPhaseProperties->rho1(); const dimensionedScalar& rho2 = twoPhaseProperties->rho2(); const dimensionedScalar& pSat = twoPhaseProperties->pSat(); + // Need to store rho for ddt(rho, U) volScalarField rho ( @@ -60,11 +51,12 @@ mesh, IOobject::READ_IF_PRESENT ), - alpha1*rho1 + (scalar(1) - alpha1)*rho2, + alpha1*rho1 + alpha2*rho2, alpha1.boundaryField().types() ); rho.oldTime(); + // Construct interface from alpha1 distribution interfaceProperties interface(alpha1, U, twoPhaseProperties()); @@ -113,3 +105,5 @@ ); p_rgh = p - rho*gh; } + + fv::IOoptionList fvOptions(mesh); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C index 00a7976a2edae65d6b23b11d0b2b733062392876..83eb7106e94101ee610c1b67509a9250621892e4 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,6 +47,7 @@ Description #include "phaseChangeTwoPhaseMixture.H" #include "turbulenceModel.H" #include "pimpleControl.H" +#include "fvIOoptionList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H index 817db5012c294263f4bf9bb2e14503b8584c4802..7d9b71669aac7391fff95ea372b16cece7f37e41 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H @@ -46,6 +46,7 @@ U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf); U.correctBoundaryConditions(); + fvOptions.correct(U); } } diff --git a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSolution b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSolution index 68884d2d04d380a3463d9ca17d3d252359998761..bfbd5df2715b0f33a0bb2b07e93fcc83523c550a 100644 --- a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSolution +++ b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSolution @@ -94,8 +94,8 @@ PIMPLE { momentumPredictor no; nOuterCorrectors 1; - nCorrectors 2; - nNonOrthogonalCorrectors 1; + nCorrectors 3; + nNonOrthogonalCorrectors 0; cAlpha 0; nAlphaCorr 1;