diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C index 096141d75a56a4e506251148b3fc3c00ca684e7a..623333d3b99018224e670bd8122259a2b2e23b10 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C @@ -27,11 +27,13 @@ License #include "alphaContactAngleFvPatchScalarField.H" #include "Time.H" #include "subCycle.H" -#include "fvCFD.H" +#include "MULES.H" +#include "fvcSnGrad.H" +#include "fvcFlux.H" // * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * // -const scalar Foam::multiphaseMixture::convertToRad = +const Foam::scalar Foam::multiphaseMixture::convertToRad = Foam::constant::mathematical::pi/180.0; @@ -249,10 +251,6 @@ void Foam::multiphaseMixture::solve() label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles"))); - label nAlphaCorr(readLabel(pimpleDict.lookup("nAlphaCorr"))); - - bool cycleAlpha(Switch(pimpleDict.lookup("cycleAlpha"))); - scalar cAlpha(readScalar(pimpleDict.lookup("cAlpha"))); @@ -269,7 +267,7 @@ void Foam::multiphaseMixture::solve() !(++alphaSubCycle).end(); ) { - solveAlphas(nAlphaCorr, cycleAlpha, cAlpha); + solveAlphas(cAlpha); rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi_; } @@ -277,7 +275,7 @@ void Foam::multiphaseMixture::solve() } else { - solveAlphas(nAlphaCorr, cycleAlpha, cAlpha); + solveAlphas(cAlpha); } } @@ -481,8 +479,6 @@ Foam::multiphaseMixture::nearInterface() const void Foam::multiphaseMixture::solveAlphas ( - const label nAlphaCorr, - const bool cycleAlpha, const scalar cAlpha ) { @@ -490,92 +486,108 @@ void Foam::multiphaseMixture::solveAlphas nSolves++; word alphaScheme("div(phi,alpha)"); - word alphacScheme("div(phirb,alpha)"); - - tmp<fv::convectionScheme<scalar> > mvConvection - ( - fv::convectionScheme<scalar>::New - ( - mesh_, - alphaTable_, - phi_, - mesh_.divScheme(alphaScheme) - ) - ); + word alpharScheme("div(phirb,alpha)"); surfaceScalarField phic(mag(phi_/mesh_.magSf())); phic = min(cAlpha*phic, max(phic)); - for (int gCorr=0; gCorr<nAlphaCorr; gCorr++) - { - phase* refPhasePtr = &refPhase_; - - if (cycleAlpha) - { - PtrDictionary<phase>::iterator refPhaseIter = phases_.begin(); - for (label i=0; i<nSolves%phases_.size(); i++) - { - ++refPhaseIter; - } - refPhasePtr = &refPhaseIter(); - } + PtrList<surfaceScalarField> phiAlphaCorrs(phases_.size()); + int phasei = 0; - phase& refPhase = *refPhasePtr; + forAllIter(PtrDictionary<phase>, phases_, iter) + { + phase& alpha = iter(); - volScalarField refPhaseNew(refPhase); - refPhaseNew == 1.0; + phiAlphaCorrs.set + ( + phasei, + new surfaceScalarField + ( + fvc::flux + ( + phi_, + alpha, + alphaScheme + ) + ) + ); - rhoPhi_ = phi_*refPhase.rho(); + surfaceScalarField& phiAlphaCorr = phiAlphaCorrs[phasei]; - forAllIter(PtrDictionary<phase>, phases_, iter) + forAllIter(PtrDictionary<phase>, phases_, iter2) { - phase& alpha = iter(); + phase& alpha2 = iter2(); + + if (&alpha2 == &alpha) continue; - if (&alpha == &refPhase) continue; + surfaceScalarField phir(phic*nHatf(alpha, alpha2)); - fvScalarMatrix alphaEqn + phiAlphaCorr += fvc::flux ( - fvm::ddt(alpha) - + mvConvection->fvmDiv(phi_, alpha) + -fvc::flux(-phir, alpha2, alpharScheme), + alpha, + alpharScheme ); + } - forAllIter(PtrDictionary<phase>, phases_, iter2) - { - phase& alpha2 = iter2(); - - if (&alpha2 == &alpha) continue; - - surfaceScalarField phir(phic*nHatf(alpha, alpha2)); - surfaceScalarField phirb12 - ( - -fvc::flux(-phir, alpha2, alphacScheme) - ); + MULES::limit + ( + geometricOneField(), + alpha, + phi_, + phiAlphaCorr, + zeroField(), + zeroField(), + 1, + 0, + 3, + true + ); + + phasei++; + } - alphaEqn += fvm::div(phirb12, alpha, alphacScheme); - } + MULES::limitSum(phiAlphaCorrs); - alphaEqn.solve(mesh_.solver("alpha")); + rhoPhi_ = 0.0*phi_*refPhase_.rho(); + volScalarField sumAlpha("sumAlpha", 0.0*refPhase_); + phasei = 0; - rhoPhi_ += alphaEqn.flux()*(alpha.rho() - refPhase.rho()); + forAllIter(PtrDictionary<phase>, phases_, iter) + { + phase& alpha = iter(); - Info<< alpha.name() << " volume fraction, min, max = " - << alpha.weightedAverage(mesh_.V()).value() - << ' ' << min(alpha).value() - << ' ' << max(alpha).value() - << endl; + surfaceScalarField& phiAlpha = phiAlphaCorrs[phasei]; + phiAlpha += upwind<scalar>(mesh_, phi_).flux(alpha); - refPhaseNew == refPhaseNew - alpha; - } + MULES::explicitSolve + ( + geometricOneField(), + alpha, + phiAlpha, + zeroField(), + zeroField() + ); + + rhoPhi_ += phiAlpha*alpha.rho(); + + Info<< alpha.name() << " volume fraction, min, max = " + << alpha.weightedAverage(mesh_.V()).value() + << ' ' << min(alpha).value() + << ' ' << max(alpha).value() + << endl; - refPhase == refPhaseNew; + sumAlpha += alpha; - Info<< refPhase.name() << " volume fraction, min, max = " - << refPhase.weightedAverage(mesh_.V()).value() - << ' ' << min(refPhase).value() - << ' ' << max(refPhase).value() - << endl; + phasei++; } + Info<< "Phase-sum volume fraction, min, max = " + << sumAlpha.weightedAverage(mesh_.V()).value() + << ' ' << min(sumAlpha).value() + << ' ' << max(sumAlpha).value() + << endl; + calcAlphas(); } diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H index b2bb072e9eaa46e9fee3d6891c908873a3bd4367..9e8eb0d1edb987dfcbe0b351493d3da32c2ba220 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H @@ -168,12 +168,7 @@ private: void calcAlphas(); - void solveAlphas - ( - const label nAlphaCorr, - const bool cycleAlpha, - const scalar cAlpha - ); + void solveAlphas(const scalar cAlpha); tmp<surfaceVectorField> nHatfv ( diff --git a/src/finiteVolume/fvMatrices/solvers/MULES/MULES.C b/src/finiteVolume/fvMatrices/solvers/MULES/MULES.C index 70238148a149c523c4424feeaf18f47a43ff215b..5ec7da84fed378fb98e8ede3ddbad605217b5100 100644 --- a/src/finiteVolume/fvMatrices/solvers/MULES/MULES.C +++ b/src/finiteVolume/fvMatrices/solvers/MULES/MULES.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2006-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -80,4 +80,60 @@ void Foam::MULES::implicitSolve } +void Foam::MULES::limitSum(UPtrList<scalarField>& phiPsiCorrs) +{ + forAll(phiPsiCorrs[0], facei) + { + scalar sumPos = 0; + scalar sumNeg = 0; + + for (int phasei=0; phasei<phiPsiCorrs.size(); phasei++) + { + if (phiPsiCorrs[phasei][facei] > 0) + { + sumPos += phiPsiCorrs[phasei][facei]; + } + else + { + sumNeg += phiPsiCorrs[phasei][facei]; + } + } + + scalar sum = sumPos + sumNeg; + + if (sum > 0 && sumPos > VSMALL) + { + scalar lambda = -sumNeg/sumPos; + + for (int phasei=0; phasei<phiPsiCorrs.size(); phasei++) + { + if (phiPsiCorrs[phasei][facei] > 0) + { + phiPsiCorrs[phasei][facei] *= lambda; + } + } + } + else if (sum < 0 && sumNeg < -VSMALL) + { + scalar lambda = -sumPos/sumNeg; + + for (int phasei=0; phasei<phiPsiCorrs.size(); phasei++) + { + if (phiPsiCorrs[phasei][facei] < 0) + { + phiPsiCorrs[phasei][facei] *= lambda; + } + } + } + else + { + for (int phasei=0; phasei<phiPsiCorrs.size(); phasei++) + { + phiPsiCorrs[phasei][facei] = 0; + } + } + } +} + + // ************************************************************************* // diff --git a/src/finiteVolume/fvMatrices/solvers/MULES/MULES.H b/src/finiteVolume/fvMatrices/solvers/MULES/MULES.H index d3457c9c0a2b155136bce24418b6667c55cb8035..f3e8a0b1f1e1f096b5fb55a90e7c8c564535475c 100644 --- a/src/finiteVolume/fvMatrices/solvers/MULES/MULES.H +++ b/src/finiteVolume/fvMatrices/solvers/MULES/MULES.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2006-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,18 +45,27 @@ SourceFiles #include "volFields.H" #include "surfaceFieldsFwd.H" #include "primitiveFieldsFwd.H" -#include "zero.H" #include "geometricOneField.H" +#include "zero.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { +namespace MULES +{ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace MULES -{ +template<class RhoType, class SpType, class SuType> +void explicitSolve +( + const RhoType& rho, + volScalarField& psi, + const surfaceScalarField& phiPsi, + const SpType& Sp, + const SuType& Su +); template<class RhoType, class SpType, class SuType> void explicitSolve @@ -117,10 +126,29 @@ void limiter const label nLimiterIter ); -} // End namespace MULES +template<class RhoType, class SpType, class SuType> +void limit +( + const RhoType& rho, + const volScalarField& psi, + const surfaceScalarField& phi, + surfaceScalarField& phiPsi, + const SpType& Sp, + const SuType& Su, + const scalar psiMax, + const scalar psiMin, + const label nLimiterIter, + const bool returnCorr +); + +void limitSum(UPtrList<scalarField>& phiPsiCorrs); + +template<class SurfaceScalarFieldList> +void limitSum(SurfaceScalarFieldList& phiPsiCorrs); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace MULES } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C b/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C index 44672474d4db694f2ff22f425fbfbc9caea6e057..3ea20711629126cc05ca0a153efc20b80d597aa5 100644 --- a/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C +++ b/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2006-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,58 +43,14 @@ void Foam::MULES::explicitSolve ( const RhoType& rho, volScalarField& psi, - const surfaceScalarField& phi, - surfaceScalarField& phiPsi, + const surfaceScalarField& phiPsi, const SpType& Sp, - const SuType& Su, - const scalar psiMax, - const scalar psiMin + const SuType& Su ) { Info<< "MULES: Solving for " << psi.name() << endl; const fvMesh& mesh = psi.mesh(); - psi.correctBoundaryConditions(); - - surfaceScalarField phiBD(upwind<scalar>(psi.mesh(), phi).flux(psi)); - - surfaceScalarField& phiCorr = phiPsi; - phiCorr -= phiBD; - - scalarField allLambda(mesh.nFaces(), 1.0); - - slicedSurfaceScalarField lambda - ( - IOobject - ( - "lambda", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh, - dimless, - allLambda, - false // Use slices for the couples - ); - - limiter - ( - allLambda, - rho, - psi, - phiBD, - phiCorr, - Sp, - Su, - psiMax, - psiMin, - 3 - ); - - phiPsi = phiBD + lambda*phiCorr; scalarField& psiIf = psi; const scalarField& psi0 = psi.oldTime(); @@ -127,6 +83,25 @@ void Foam::MULES::explicitSolve } +template<class RhoType, class SpType, class SuType> +void Foam::MULES::explicitSolve +( + const RhoType& rho, + volScalarField& psi, + const surfaceScalarField& phi, + surfaceScalarField& phiPsi, + const SpType& Sp, + const SuType& Su, + const scalar psiMax, + const scalar psiMin +) +{ + psi.correctBoundaryConditions(); + limit(rho, psi, phi, phiPsi, Sp, Su, psiMax, psiMin, 3, false); + explicitSolve(rho, psi, phiPsi, Sp, Su); +} + + template<class RhoType, class SpType, class SuType> void Foam::MULES::implicitSolve ( @@ -614,4 +589,100 @@ void Foam::MULES::limiter } +template<class RhoType, class SpType, class SuType> +void Foam::MULES::limit +( + const RhoType& rho, + const volScalarField& psi, + const surfaceScalarField& phi, + surfaceScalarField& phiPsi, + const SpType& Sp, + const SuType& Su, + const scalar psiMax, + const scalar psiMin, + const label nLimiterIter, + const bool returnCorr +) +{ + const fvMesh& mesh = psi.mesh(); + + surfaceScalarField phiBD(upwind<scalar>(psi.mesh(), phi).flux(psi)); + + surfaceScalarField& phiCorr = phiPsi; + phiCorr -= phiBD; + + scalarField allLambda(mesh.nFaces(), 1.0); + + slicedSurfaceScalarField lambda + ( + IOobject + ( + "lambda", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + mesh, + dimless, + allLambda, + false // Use slices for the couples + ); + + limiter + ( + allLambda, + rho, + psi, + phiBD, + phiCorr, + Sp, + Su, + psiMax, + psiMin, + nLimiterIter + ); + + if (returnCorr) + { + phiCorr *= lambda; + } + else + { + phiPsi = phiBD + lambda*phiCorr; + } +} + + +template<class SurfaceScalarFieldList> +void Foam::MULES::limitSum(SurfaceScalarFieldList& phiPsiCorrs) +{ + { + UPtrList<scalarField> phiPsiCorrsInternal(phiPsiCorrs.size()); + forAll(phiPsiCorrs, phasei) + { + phiPsiCorrsInternal.set(phasei, &phiPsiCorrs[phasei]); + } + + limitSum(phiPsiCorrsInternal); + } + + forAll(phiPsiCorrs[0].boundaryField(), patchi) + { + UPtrList<scalarField> phiPsiCorrsPatch(phiPsiCorrs.size()); + forAll(phiPsiCorrs, phasei) + { + phiPsiCorrsPatch.set + ( + phasei, + &phiPsiCorrs[phasei].boundaryField()[patchi] + ); + } + + limitSum(phiPsiCorrsPatch); + } +} + + // ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/U b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/U deleted file mode 100644 index f835286ef94f050bf81a97fb9acf8428b74c09e1..0000000000000000000000000000000000000000 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/U +++ /dev/null @@ -1,51 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class volVectorField; - location "0"; - object U; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 1 -1 0 0 0 0]; - -internalField uniform (0 0 0); - -boundaryField -{ - leftWall - { - type fixedValue; - value uniform (0 0 0); - } - rightWall - { - type fixedValue; - value uniform (0 0 0); - } - lowerWall - { - type fixedValue; - value uniform (0 0 0); - } - atmosphere - { - type fluxCorrectedVelocity; - value uniform (0 0 0); - } - defaultFaces - { - type empty; - } -} - - -// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphaair b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphaair deleted file mode 100644 index 14c8b6a7af8a24df5fa516cdc1a6b3a9002bdb30..0000000000000000000000000000000000000000 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphaair +++ /dev/null @@ -1,79 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class volScalarField; - location "0"; - object alphaair; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - leftWall - { - type alphaContactAngle; - thetaProperties - ( - ( water air ) 90 0 0 0 - ( oil air ) 90 0 0 0 - ( mercury air ) 90 0 0 0 - ( water oil ) 90 0 0 0 - ( water mercury ) 90 0 0 0 - ( oil mercury ) 90 0 0 0 - ); - value uniform 0; - } - rightWall - { - type alphaContactAngle; - thetaProperties - ( - ( water air ) 90 0 0 0 - ( oil air ) 90 0 0 0 - ( mercury air ) 90 0 0 0 - ( water oil ) 90 0 0 0 - ( water mercury ) 90 0 0 0 - ( oil mercury ) 90 0 0 0 - ); - value uniform 1; - } - lowerWall - { - type alphaContactAngle; - thetaProperties - ( - ( water air ) 90 0 0 0 - ( oil air ) 90 0 0 0 - ( mercury air ) 90 0 0 0 - ( water oil ) 90 0 0 0 - ( water mercury ) 90 0 0 0 - ( oil mercury ) 90 0 0 0 - ); - value uniform 0; - } - atmosphere - { - type inletOutlet; - inletValue uniform 1; - value uniform 1; - } - defaultFaces - { - type empty; - } -} - - -// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphamercury b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphamercury deleted file mode 100644 index be9dc4d0ee98d6720d0d76fc13aaf250979d2a1b..0000000000000000000000000000000000000000 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphamercury +++ /dev/null @@ -1,49 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class volScalarField; - location "0"; - object alphamercury; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - leftWall - { - type zeroGradient; - } - rightWall - { - type zeroGradient; - } - lowerWall - { - type zeroGradient; - } - atmosphere - { - type inletOutlet; - inletValue uniform 0; - value uniform 0; - } - defaultFaces - { - type empty; - } -} - - -// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphaoil b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphaoil deleted file mode 100644 index 3f6f589eb324e9221393024c45dae4d380fafe38..0000000000000000000000000000000000000000 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphaoil +++ /dev/null @@ -1,49 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class volScalarField; - location "0"; - object alphaoil; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - leftWall - { - type zeroGradient; - } - rightWall - { - type zeroGradient; - } - lowerWall - { - type zeroGradient; - } - atmosphere - { - type inletOutlet; - inletValue uniform 0; - value uniform 0; - } - defaultFaces - { - type empty; - } -} - - -// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphas b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphas deleted file mode 100644 index 3571b185b52c7b45b2d234184ea4a4d00c386b91..0000000000000000000000000000000000000000 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphas +++ /dev/null @@ -1,47 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class volScalarField; - location "0"; - object alphas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - leftWall - { - type zeroGradient; - } - rightWall - { - type zeroGradient; - } - lowerWall - { - type zeroGradient; - } - atmosphere - { - type zeroGradient; - } - defaultFaces - { - type empty; - } -} - - -// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphawater b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphawater deleted file mode 100644 index 19a4d2333136ef7b046cbcfb04956efeec21749b..0000000000000000000000000000000000000000 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphawater +++ /dev/null @@ -1,49 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class volScalarField; - location "0"; - object alphawater; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - leftWall - { - type zeroGradient; - } - rightWall - { - type zeroGradient; - } - lowerWall - { - type zeroGradient; - } - atmosphere - { - type inletOutlet; - inletValue uniform 0; - value uniform 0; - } - defaultFaces - { - type empty; - } -} - - -// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/p_rgh b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/p_rgh deleted file mode 100644 index 273973ed5c75bc7c83ff0f5e5d577ac867180cfb..0000000000000000000000000000000000000000 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/p_rgh +++ /dev/null @@ -1,59 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class volScalarField; - object p_rgh; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [1 -1 -2 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - leftWall - { - type buoyantPressure; - value uniform 0; - } - - rightWall - { - type buoyantPressure; - value uniform 0; - } - - lowerWall - { - type buoyantPressure; - value uniform 0; - } - - atmosphere - { - type totalPressure; - p0 uniform 0; - U U; - phi phi; - rho rho; - psi none; - gamma 1; - value uniform 0; - } - - defaultFaces - { - type empty; - } -} - -// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allclean b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allclean index fbb1098d3cee98d3f4819c2747fce1425d42f81d..cd78b26599c3d4f7cd89a2197d3e52eb5f83087b 100755 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allclean +++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allclean @@ -1,9 +1,11 @@ #!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + # Source tutorial clean functions . $WM_PROJECT_DIR/bin/tools/CleanFunctions cleanCase \rm -rf 0 -cp -r 0.org 0 +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allrun b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allrun index d8dfa3c1bdc198f515a40fb79718cae54fffae03..887344985c0a184737b5ab1f75f0709c953212b1 100755 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allrun +++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allrun @@ -7,6 +7,9 @@ cd ${0%/*} || exit 1 # run from this directory # Set application name application=`getApplication` +\rm -rf 0 +cp -r 0.org 0 + runApplication blockMesh runApplication setFields runApplication $application diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/controlDict b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/controlDict index ec28f8f7d2232df5331755ca51fdce2f0b77c0d1..efa8d7b97f6c2e0284037d9235fe014bc2f9d4ed 100644 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/controlDict +++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/controlDict @@ -17,7 +17,7 @@ FoamFile application multiphaseInterFoam; -startFrom latestTime; +startFrom startTime; startTime 0; diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSolution b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSolution index 2306b1ac657f1ab002932ea025141d9106482c3d..1edd60b42b34d63354a9f12e5e521a43180a694c 100644 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSolution +++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSolution @@ -77,7 +77,7 @@ solvers maxIter 20; } - "(U|alpha)" + U { solver smoothSolver; smoother GaussSeidel; @@ -96,11 +96,9 @@ solvers PIMPLE { - nCorrectors 4; + nCorrectors 2; nNonOrthogonalCorrectors 0; - nAlphaCorr 4; nAlphaSubCycles 4; - cycleAlpha yes; cAlpha 2; } diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/U b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/U deleted file mode 100644 index f835286ef94f050bf81a97fb9acf8428b74c09e1..0000000000000000000000000000000000000000 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/U +++ /dev/null @@ -1,51 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class volVectorField; - location "0"; - object U; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 1 -1 0 0 0 0]; - -internalField uniform (0 0 0); - -boundaryField -{ - leftWall - { - type fixedValue; - value uniform (0 0 0); - } - rightWall - { - type fixedValue; - value uniform (0 0 0); - } - lowerWall - { - type fixedValue; - value uniform (0 0 0); - } - atmosphere - { - type fluxCorrectedVelocity; - value uniform (0 0 0); - } - defaultFaces - { - type empty; - } -} - - -// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphaair b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphaair deleted file mode 100644 index 14c8b6a7af8a24df5fa516cdc1a6b3a9002bdb30..0000000000000000000000000000000000000000 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphaair +++ /dev/null @@ -1,79 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class volScalarField; - location "0"; - object alphaair; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - leftWall - { - type alphaContactAngle; - thetaProperties - ( - ( water air ) 90 0 0 0 - ( oil air ) 90 0 0 0 - ( mercury air ) 90 0 0 0 - ( water oil ) 90 0 0 0 - ( water mercury ) 90 0 0 0 - ( oil mercury ) 90 0 0 0 - ); - value uniform 0; - } - rightWall - { - type alphaContactAngle; - thetaProperties - ( - ( water air ) 90 0 0 0 - ( oil air ) 90 0 0 0 - ( mercury air ) 90 0 0 0 - ( water oil ) 90 0 0 0 - ( water mercury ) 90 0 0 0 - ( oil mercury ) 90 0 0 0 - ); - value uniform 1; - } - lowerWall - { - type alphaContactAngle; - thetaProperties - ( - ( water air ) 90 0 0 0 - ( oil air ) 90 0 0 0 - ( mercury air ) 90 0 0 0 - ( water oil ) 90 0 0 0 - ( water mercury ) 90 0 0 0 - ( oil mercury ) 90 0 0 0 - ); - value uniform 0; - } - atmosphere - { - type inletOutlet; - inletValue uniform 1; - value uniform 1; - } - defaultFaces - { - type empty; - } -} - - -// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphamercury b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphamercury deleted file mode 100644 index be9dc4d0ee98d6720d0d76fc13aaf250979d2a1b..0000000000000000000000000000000000000000 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphamercury +++ /dev/null @@ -1,49 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class volScalarField; - location "0"; - object alphamercury; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - leftWall - { - type zeroGradient; - } - rightWall - { - type zeroGradient; - } - lowerWall - { - type zeroGradient; - } - atmosphere - { - type inletOutlet; - inletValue uniform 0; - value uniform 0; - } - defaultFaces - { - type empty; - } -} - - -// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphaoil b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphaoil deleted file mode 100644 index 3f6f589eb324e9221393024c45dae4d380fafe38..0000000000000000000000000000000000000000 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphaoil +++ /dev/null @@ -1,49 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class volScalarField; - location "0"; - object alphaoil; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - leftWall - { - type zeroGradient; - } - rightWall - { - type zeroGradient; - } - lowerWall - { - type zeroGradient; - } - atmosphere - { - type inletOutlet; - inletValue uniform 0; - value uniform 0; - } - defaultFaces - { - type empty; - } -} - - -// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphas b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphas deleted file mode 100644 index 3571b185b52c7b45b2d234184ea4a4d00c386b91..0000000000000000000000000000000000000000 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphas +++ /dev/null @@ -1,47 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class volScalarField; - location "0"; - object alphas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - leftWall - { - type zeroGradient; - } - rightWall - { - type zeroGradient; - } - lowerWall - { - type zeroGradient; - } - atmosphere - { - type zeroGradient; - } - defaultFaces - { - type empty; - } -} - - -// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphawater b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphawater deleted file mode 100644 index 19a4d2333136ef7b046cbcfb04956efeec21749b..0000000000000000000000000000000000000000 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphawater +++ /dev/null @@ -1,49 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class volScalarField; - location "0"; - object alphawater; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - leftWall - { - type zeroGradient; - } - rightWall - { - type zeroGradient; - } - lowerWall - { - type zeroGradient; - } - atmosphere - { - type inletOutlet; - inletValue uniform 0; - value uniform 0; - } - defaultFaces - { - type empty; - } -} - - -// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/p_rgh b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/p_rgh deleted file mode 100644 index 273973ed5c75bc7c83ff0f5e5d577ac867180cfb..0000000000000000000000000000000000000000 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/p_rgh +++ /dev/null @@ -1,59 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class volScalarField; - object p_rgh; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [1 -1 -2 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - leftWall - { - type buoyantPressure; - value uniform 0; - } - - rightWall - { - type buoyantPressure; - value uniform 0; - } - - lowerWall - { - type buoyantPressure; - value uniform 0; - } - - atmosphere - { - type totalPressure; - p0 uniform 0; - U U; - phi phi; - rho rho; - psi none; - gamma 1; - value uniform 0; - } - - defaultFaces - { - type empty; - } -} - -// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allclean b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allclean index fbb1098d3cee98d3f4819c2747fce1425d42f81d..cd78b26599c3d4f7cd89a2197d3e52eb5f83087b 100755 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allclean +++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allclean @@ -1,9 +1,11 @@ #!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + # Source tutorial clean functions . $WM_PROJECT_DIR/bin/tools/CleanFunctions cleanCase \rm -rf 0 -cp -r 0.org 0 +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allrun b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allrun index d8dfa3c1bdc198f515a40fb79718cae54fffae03..efed6d773151d79cd9ad328d9e73248701c7a699 100755 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allrun +++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allrun @@ -7,8 +7,12 @@ cd ${0%/*} || exit 1 # run from this directory # Set application name application=`getApplication` +cp -r 0.org 0 + runApplication blockMesh runApplication setFields -runApplication $application +runApplication decomposePar +runParallel $application 4 +runApplication reconstructPar # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSolution b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSolution index 5f46d6dc86c0a7ceb50da9767bdadc325903a470..d999c4225b338ab88b473f43c558f0c054ae9fce 100644 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSolution +++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSolution @@ -90,11 +90,9 @@ solvers PIMPLE { momentumPredictor no; - nCorrectors 4; + nCorrectors 2; nNonOrthogonalCorrectors 0; - nAlphaCorr 4; nAlphaSubCycles 4; - cycleAlpha yes; cAlpha 2; }