diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake b/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake index 421f05ab3534d114c2b1ec7459cd64ee80c59b47..8f1133699c53b6c52641f56a255e207e8485270f 100755 --- a/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake +++ b/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake @@ -3,8 +3,8 @@ cd ${0%/*} || exit 1 # run from this directory set -x wmake libso phaseModel -wmake libso multiphaseSystem wmake libso interfacialModels +wmake libso multiphaseSystem wmake libso kineticTheoryModels wmake diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Make/options b/applications/solvers/multiphase/multiphaseEulerFoam/Make/options index d4cfc301369f5e947acc62fd52f8a38ec5e35be2..8fc20e86237ec7b86f3cc24054e04e40f9320b92 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/Make/options +++ b/applications/solvers/multiphase/multiphaseEulerFoam/Make/options @@ -1,4 +1,4 @@ -EXE_INC = -ggdb3 \ +EXE_INC = \ -IphaseModel/lnInclude \ -ImultiphaseSystem/lnInclude \ /*-IkineticTheoryModels/lnInclude*/ \ diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H b/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H index 1d12ba871dc73ff1885b72bd19b0b5b949f47ec1..1ee149c48ec63924503ec6349d91dbee8b846e9f 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H @@ -33,7 +33,7 @@ forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter) + (alpha/phase.rho())*fluid.Svm(phase) ) ); - mrfZones.addCoriolis(UEqns[phasei]); + mrfZones.addCoriolis(alpha, UEqns[phasei]); UEqns[phasei].relax(); phasei++; diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/Make/options b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/Make/options index e956bfdc91ea2c7afd9f4cac6a8225a39e051546..231ff8a2ce8e0ad7f241d4c8a620b713d39f59bc 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/Make/options +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/Make/options @@ -1,4 +1,4 @@ -EXE_INC = -ggdb3 \ +EXE_INC = \ -I../phaseModel/lnInclude \ -I../interfacialModels/lnInclude \ -IalphaContactAngle \ diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C index fc4351037bff96794e8e371d660c7681936f4387..b7c93bd481f334b6accc46fa53c0b7721691d502 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C @@ -56,9 +56,6 @@ void Foam::multiphaseSystem::calcAlphas() void Foam::multiphaseSystem::solveAlphas() { - word alphaScheme("div(phi,alpha)"); - word alpharScheme("div(phirb,alpha)"); - surfaceScalarField phic(mag(phi_/mesh_.magSf())); PtrList<surfaceScalarField> phiAlphaCorrs(phases_.size()); @@ -67,6 +64,7 @@ void Foam::multiphaseSystem::solveAlphas() forAllIter(PtrDictionary<phaseModel>, phases_, iter) { phaseModel& phase1 = iter(); + volScalarField& alpha1 = phase1; phase1.phiAlpha() = dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0); @@ -80,7 +78,7 @@ void Foam::multiphaseSystem::solveAlphas() ( phi_, phase1, - alphaScheme + "div(phi," + alpha1.name() + ')' ) ) ); @@ -90,6 +88,7 @@ void Foam::multiphaseSystem::solveAlphas() forAllIter(PtrDictionary<phaseModel>, phases_, iter2) { phaseModel& phase2 = iter2(); + volScalarField& alpha2 = phase2; if (&phase2 == &phase1) continue; @@ -100,11 +99,13 @@ void Foam::multiphaseSystem::solveAlphas() *nHatf(phase1, phase2) ); + word phirScheme("div(phir," + alpha2.name() + ',' + alpha1.name() + ')'); + phiAlphaCorr += fvc::flux ( - -fvc::flux(-phir, phase2, alpharScheme), + -fvc::flux(-phir, phase2, phirScheme), phase1, - alpharScheme + phirScheme ); } diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 1a17d3dcab011d74410fca113e7988aed2cf48a6..ba4f80b0bba48771bdb729c01256f36d70080898 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -133,7 +133,6 @@ $(derivedFvPatchFields)/fan/fanFvPatchFields.C $(derivedFvPatchFields)/fanPressure/fanPressureFvPatchScalarField.C $(derivedFvPatchFields)/buoyantPressure/buoyantPressureFvPatchScalarField.C $(derivedFvPatchFields)/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C -$(derivedFvPatchFields)/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C $(derivedFvPatchFields)/fixedInternalValueFvPatchField/fixedInternalValueFvPatchFields.C $(derivedFvPatchFields)/fixedNormalSlip/fixedNormalSlipFvPatchFields.C $(derivedFvPatchFields)/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C diff --git a/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C deleted file mode 100644 index be534fb8fac0938fd62ff698e36fc7eb068d4397..0000000000000000000000000000000000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C +++ /dev/null @@ -1,177 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "multiphaseFixedFluxPressureFvPatchScalarField.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" -#include "surfaceFields.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::multiphaseFixedFluxPressureFvPatchScalarField:: -multiphaseFixedFluxPressureFvPatchScalarField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF -) -: - fixedGradientFvPatchScalarField(p, iF), - UName_("U"), - phiName_("phi"), - rhoName_("rho") -{} - - -Foam::multiphaseFixedFluxPressureFvPatchScalarField:: -multiphaseFixedFluxPressureFvPatchScalarField -( - const multiphaseFixedFluxPressureFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const fvPatchFieldMapper& mapper -) -: - fixedGradientFvPatchScalarField(ptf, p, iF, mapper), - UName_(ptf.UName_), - phiName_(ptf.phiName_), - rhoName_(ptf.rhoName_) -{} - - -Foam::multiphaseFixedFluxPressureFvPatchScalarField:: -multiphaseFixedFluxPressureFvPatchScalarField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const dictionary& dict -) -: - fixedGradientFvPatchScalarField(p, iF), - UName_(dict.lookupOrDefault<word>("U", "U")), - phiName_(dict.lookupOrDefault<word>("phi", "phi")), - rhoName_(dict.lookupOrDefault<word>("rho", "rho")) -{ - if (dict.found("gradient")) - { - gradient() = scalarField("gradient", dict, p.size()); - fixedGradientFvPatchScalarField::updateCoeffs(); - fixedGradientFvPatchScalarField::evaluate(); - } - else - { - fvPatchField<scalar>::operator=(patchInternalField()); - gradient() = 0.0; - } -} - - -Foam::multiphaseFixedFluxPressureFvPatchScalarField:: -multiphaseFixedFluxPressureFvPatchScalarField -( - const multiphaseFixedFluxPressureFvPatchScalarField& wbppsf -) -: - fixedGradientFvPatchScalarField(wbppsf), - UName_(wbppsf.UName_), - phiName_(wbppsf.phiName_), - rhoName_(wbppsf.rhoName_) -{} - - -Foam::multiphaseFixedFluxPressureFvPatchScalarField:: -multiphaseFixedFluxPressureFvPatchScalarField -( - const multiphaseFixedFluxPressureFvPatchScalarField& wbppsf, - const DimensionedField<scalar, volMesh>& iF -) -: - fixedGradientFvPatchScalarField(wbppsf, iF), - UName_(wbppsf.UName_), - phiName_(wbppsf.phiName_), - rhoName_(wbppsf.rhoName_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::multiphaseFixedFluxPressureFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - const fvPatchField<vector>& Up = - patch().lookupPatchField<volVectorField, vector>(UName_); - - const surfaceScalarField& phi = - db().lookupObject<surfaceScalarField>(phiName_); - - fvsPatchField<scalar> phip = - patch().patchField<surfaceScalarField, scalar>(phi); - - if (phi.dimensions() == dimDensity*dimVelocity*dimArea) - { - const fvPatchField<scalar>& rhop = - patch().lookupPatchField<volScalarField, scalar>(rhoName_); - - phip /= rhop; - } - - const fvsPatchField<scalar>& Dpp = - patch().lookupPatchField<surfaceScalarField, scalar>("Dp"); - - gradient() = (phip - (patch().Sf() & Up))/patch().magSf()/Dpp; - - fixedGradientFvPatchScalarField::updateCoeffs(); -} - - -void Foam::multiphaseFixedFluxPressureFvPatchScalarField::write -( - Ostream& os -) const -{ - fvPatchScalarField::write(os); - writeEntryIfDifferent<word>(os, "U", "U", UName_); - writeEntryIfDifferent<word>(os, "phi", "phi", phiName_); - writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_); - gradient().writeEntry("gradient", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makePatchTypeField - ( - fvPatchScalarField, - multiphaseFixedFluxPressureFvPatchScalarField - ); -} - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.H deleted file mode 100644 index b97001a5c0ff6e84872f6a0718f105901cb6074f..0000000000000000000000000000000000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.H +++ /dev/null @@ -1,154 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::multiphaseFixedFluxPressureFvPatchScalarField - -Description - Foam::multiphaseFixedFluxPressureFvPatchScalarField - -SourceFiles - multiphaseFixedFluxPressureFvPatchScalarField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef multiphaseFixedFluxPressureFvPatchScalarFields_H -#define multiphaseFixedFluxPressureFvPatchScalarFields_H - -#include "fvPatchFields.H" -#include "fixedGradientFvPatchFields.H" -#include "Switch.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class multiphaseFixedFluxPressureFvPatch Declaration -\*---------------------------------------------------------------------------*/ - -class multiphaseFixedFluxPressureFvPatchScalarField -: - public fixedGradientFvPatchScalarField -{ - // Private data - - //- Name of the velocity field - word UName_; - - //- Name of the flux transporting the field - word phiName_; - - //- Name of the density field used to normalise the mass flux - // if neccessary - word rhoName_; - - -public: - - //- Runtime type information - TypeName("multiphaseFixedFluxPressure"); - - - // Constructors - - //- Construct from patch and internal field - multiphaseFixedFluxPressureFvPatchScalarField - ( - const fvPatch&, - const DimensionedField<scalar, volMesh>& - ); - - //- Construct from patch, internal field and dictionary - multiphaseFixedFluxPressureFvPatchScalarField - ( - const fvPatch&, - const DimensionedField<scalar, volMesh>&, - const dictionary& - ); - - //- Construct by mapping given - // multiphaseFixedFluxPressureFvPatchScalarField onto a new patch - multiphaseFixedFluxPressureFvPatchScalarField - ( - const multiphaseFixedFluxPressureFvPatchScalarField&, - const fvPatch&, - const DimensionedField<scalar, volMesh>&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - multiphaseFixedFluxPressureFvPatchScalarField - ( - const multiphaseFixedFluxPressureFvPatchScalarField& - ); - - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new multiphaseFixedFluxPressureFvPatchScalarField(*this) - ); - } - - //- Construct as copy setting internal field reference - multiphaseFixedFluxPressureFvPatchScalarField - ( - const multiphaseFixedFluxPressureFvPatchScalarField&, - const DimensionedField<scalar, volMesh>& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone - ( - const DimensionedField<scalar, volMesh>& iF - ) const - { - return tmp<fvPatchScalarField> - ( - new multiphaseFixedFluxPressureFvPatchScalarField(*this, iF) - ); - } - - - // Member functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/bubbleColumn/0/alphas b/tutorials/multiphase/multiphaseEulerFoam/bubbleColumn/0/alphas index fc0a0cff8050245fabdf0c455763851e64ea964d..833c25f0343a06eeeef3bff3b080a24ed20b17bf 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/bubbleColumn/0/alphas +++ b/tutorials/multiphase/multiphaseEulerFoam/bubbleColumn/0/alphas @@ -17,7 +17,7 @@ FoamFile dimensions [0 0 0 0 0 0 0]; -internalField nonuniform List<scalar> +internalField nonuniform List<scalar> 1875 ( 1 diff --git a/tutorials/multiphase/multiphaseEulerFoam/bubbleColumn/system/fvSchemes b/tutorials/multiphase/multiphaseEulerFoam/bubbleColumn/system/fvSchemes index fe3f1e6de4afff5982c91e96c97bfd91ee58819e..feb67860ae39c145326f42328e8989a75d8bf8d5 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/bubbleColumn/system/fvSchemes +++ b/tutorials/multiphase/multiphaseEulerFoam/bubbleColumn/system/fvSchemes @@ -29,8 +29,8 @@ divSchemes { default none; - div(phi,alpha) Gauss upwind; //limitedLinear01 1; - div(phirb,alpha) Gauss upwind; + "div\(phi,alpha.*\)" Gauss vanLeer; + "div\(phir,alpha.*,alpha.*\)" Gauss vanLeer; "div\(phiAlpha.*,U.*\)" Gauss limitedLinearV 1; div(Rc) Gauss linear; @@ -39,7 +39,7 @@ divSchemes laplacianSchemes { - default Gauss linear uncorrected; + default Gauss linear corrected; } interpolationSchemes @@ -49,7 +49,7 @@ interpolationSchemes snGradSchemes { - default uncorrected; + default corrected; } fluxRequired diff --git a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/0.org/p b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/0.org/p index 318a5d779cdb926978cd606c834cb30075af33d5..7d12a339569a8ca8a9ef78453ef2963f94f5fba0 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/0.org/p +++ b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/0.org/p @@ -22,25 +22,25 @@ boundaryField { leftWall { - type buoyantPressure; + type multiphaseFixedFluxPressure; value uniform 0; } rightWall { - type buoyantPressure; + type multiphaseFixedFluxPressure; value uniform 0; } lowerWall { - type buoyantPressure; + type multiphaseFixedFluxPressure; value uniform 0; } atmosphere { - type fixedValue; //totalPressure; + type totalPressure; p0 uniform 0; U Uair; phi phiair; diff --git a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/system/fvSchemes b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/system/fvSchemes index cd9e871aaf7945c654dcd8e9c0a08d245b1b6cde..5a4bb79d9628ec2e14f036974ba794d9b805986f 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/system/fvSchemes +++ b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/system/fvSchemes @@ -27,12 +27,12 @@ gradSchemes divSchemes { - div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss vanLeer; + "div\(phi,alpha.*\)" Gauss vanLeer; + "div\(phir,alpha.*,alpha.*\)" Gauss vanLeer; - "div\(phiAlpha.*,U.*\)" Gauss upwind; + "div\(phiAlpha.*,U.*\)" Gauss limitedLinearV 1; div(Rc) Gauss linear; - "div\(phi.*,U.*\)" Gauss upwind; + "div\(phi.*,U.*\)" Gauss limitedLinearV 1; } laplacianSchemes