diff --git a/applications/solvers/multiphase/driftFluxFoam/createFields.H b/applications/solvers/multiphase/driftFluxFoam/createFields.H index 7cb3a487a5..70de4f935b 100644 --- a/applications/solvers/multiphase/driftFluxFoam/createFields.H +++ b/applications/solvers/multiphase/driftFluxFoam/createFields.H @@ -63,15 +63,9 @@ surfaceScalarField rhoPhi ); -// Relative Velocity -autoPtr UdmModelPtr -( - relativeVelocityModel::New - ( - mixture, - mixture - ) -); +#include "readGravitationalAcceleration.H" +#include "readhRef.H" +#include "gh.H" // Construct compressible turbulence model @@ -81,10 +75,6 @@ autoPtr turbulence ); -#include "readGravitationalAcceleration.H" -#include "readhRef.H" -#include "gh.H" - volScalarField p ( @@ -120,5 +110,18 @@ mesh.setFluxRequired(alpha1.name()); tmp talphaPhiCorr0; #include "createMRF.H" + +// Relative Velocity +autoPtr UdmModelPtr +( + relativeVelocityModel::New + ( + mixture, + mixture, + g, + MRF + ) +); + #include "createFvModels.H" #include "createFvConstraints.H" diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/general/general.C b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/general/general.C index 9ff19f6880..da4e7110c9 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/general/general.C +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/general/general.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,13 +43,15 @@ namespace relativeVelocityModels Foam::relativeVelocityModels::general::general ( const dictionary& dict, - const incompressibleTwoPhaseInteractingMixture& mixture + const incompressibleTwoPhaseInteractingMixture& mixture, + const uniformDimensionedVectorField& g, + const MRFZoneList& MRF ) : - relativeVelocityModel(dict, mixture), + relativeVelocityModel(dict, mixture, g, MRF), a_("a", dimless, dict), a1_("a1", dimless, dict), - V0_("V0", dimVelocity, dict), + Vc_("Vc", dimTime, dict), residualAlpha_("residualAlpha", dimless, dict) {} @@ -66,7 +68,8 @@ void Foam::relativeVelocityModels::general::correct() { Udm_ = (rhoc_/rho()) - *V0_ + *Vc_ + *(g_ + MRF_.centrifugalAcceleration()) *( exp(-a_*max(alphad_ - residualAlpha_, scalar(0))) - exp(-a1_*max(alphad_ - residualAlpha_, scalar(0))) diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/general/general.H b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/general/general.H index e96b566989..55aaf8a618 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/general/general.H +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/general/general.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -60,8 +60,8 @@ class general //- a1 coefficient dimensionedScalar a1_; - //- Drift velocity - dimensionedVector V0_; + //- Drift velocity coefficient + dimensionedScalar Vc_; //- Residual phase fraction dimensionedScalar residualAlpha_; @@ -79,7 +79,9 @@ public: general ( const dictionary& dict, - const incompressibleTwoPhaseInteractingMixture& mixture + const incompressibleTwoPhaseInteractingMixture& mixture, + const uniformDimensionedVectorField& g, + const MRFZoneList& MRF ); diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C index 86c8d5b256..3791d35293 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,7 +70,9 @@ Foam::wordList Foam::relativeVelocityModel::UdmPatchFieldTypes() const Foam::relativeVelocityModel::relativeVelocityModel ( const dictionary& dict, - const incompressibleTwoPhaseInteractingMixture& mixture + const incompressibleTwoPhaseInteractingMixture& mixture, + const uniformDimensionedVectorField& g, + const MRFZoneList& MRF ) : mixture_(mixture), @@ -78,6 +80,8 @@ Foam::relativeVelocityModel::relativeVelocityModel alphad_(mixture.alpha1()), rhoc_(mixture.rhoc()), rhod_(mixture.rhod()), + g_(g), + MRF_(MRF), Udm_ ( @@ -101,7 +105,9 @@ Foam::relativeVelocityModel::relativeVelocityModel Foam::autoPtr Foam::relativeVelocityModel::New ( const dictionary& dict, - const incompressibleTwoPhaseInteractingMixture& mixture + const incompressibleTwoPhaseInteractingMixture& mixture, + const uniformDimensionedVectorField& g, + const MRFZoneList& MRF ) { word modelType(dict.lookup(typeName)); @@ -127,7 +133,9 @@ Foam::autoPtr Foam::relativeVelocityModel::New cstrIter() ( dict.optionalSubDict(modelType + "Coeffs"), - mixture + mixture, + g, + MRF ) ); } @@ -141,19 +149,19 @@ Foam::relativeVelocityModel::~relativeVelocityModel() // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -tmp Foam::relativeVelocityModel::rho() const +Foam::tmp Foam::relativeVelocityModel::rho() const { return alphac_*rhoc_ + alphad_*rhod_; } -tmp Foam::relativeVelocityModel::tauDm() const +Foam::tmp Foam::relativeVelocityModel::tauDm() const { - volScalarField betac(alphac_*rhoc_); - volScalarField betad(alphad_*rhod_); + const volScalarField betac(alphac_*rhoc_); + const volScalarField betad(alphad_*rhod_); // Calculate the relative velocity of the continuous phase w.r.t the mean - volVectorField Ucm(betad*Udm_/betac); + const volVectorField Ucm(betad*Udm_/betac); return volSymmTensorField::New ( diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.H b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.H index faa32dbcbd..b93ec2e99f 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.H +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,9 +34,9 @@ SourceFiles #ifndef relativeVelocityModel_H #define relativeVelocityModel_H -#include "fvCFD.H" -#include "dictionary.H" #include "incompressibleTwoPhaseInteractingMixture.H" +#include "uniformDimensionedFields.H" +#include "MRFZoneList.H" #include "runTimeSelectionTables.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -78,10 +78,15 @@ protected: //- Dispersed density const dimensionedScalar& rhod_; + //- Acceleration due to gravity + const uniformDimensionedVectorField& g_; + + //- MRF zones + const MRFZoneList& MRF_; + //- Dispersed diffusion velocity mutable volVectorField Udm_; - public: //- Runtime type information @@ -93,9 +98,13 @@ public: autoPtr, relativeVelocityModel, dictionary, - (const dictionary& dict, - const incompressibleTwoPhaseInteractingMixture& mixture), - (dict, mixture) + ( + const dictionary& dict, + const incompressibleTwoPhaseInteractingMixture& mixture, + const uniformDimensionedVectorField& g, + const MRFZoneList& MRF + ), + (dict, mixture, g, MRF) ); @@ -105,7 +114,9 @@ public: relativeVelocityModel ( const dictionary& dict, - const incompressibleTwoPhaseInteractingMixture& mixture + const incompressibleTwoPhaseInteractingMixture& mixture, + const uniformDimensionedVectorField& g, + const MRFZoneList& MRF ); //- Disallow default bitwise copy construction @@ -116,7 +127,9 @@ public: static autoPtr New ( const dictionary& dict, - const incompressibleTwoPhaseInteractingMixture& mixture + const incompressibleTwoPhaseInteractingMixture& mixture, + const uniformDimensionedVectorField& g, + const MRFZoneList& MRF ); diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/simple/simple.C b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/simple/simple.C index b5308f5121..6e29124a8c 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/simple/simple.C +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/simple/simple.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,12 +43,14 @@ namespace relativeVelocityModels Foam::relativeVelocityModels::simple::simple ( const dictionary& dict, - const incompressibleTwoPhaseInteractingMixture& mixture + const incompressibleTwoPhaseInteractingMixture& mixture, + const uniformDimensionedVectorField& g, + const MRFZoneList& MRF ) : - relativeVelocityModel(dict, mixture), + relativeVelocityModel(dict, mixture, g, MRF), a_("a", dimless, dict), - V0_("V0", dimVelocity, dict), + Vc_("Vc", dimTime, dict), residualAlpha_("residualAlpha", dimless, dict) {} @@ -63,7 +65,10 @@ Foam::relativeVelocityModels::simple::~simple() void Foam::relativeVelocityModels::simple::correct() { - Udm_ = (rhoc_/rho())*V0_*pow(scalar(10), -a_*max(alphad_, scalar(0))); + Udm_ = + (rhoc_/rho()) + *Vc_*(g_ + MRF_.centrifugalAcceleration()) + *pow(scalar(10), -a_*max(alphad_, scalar(0))); } diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/simple/simple.H b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/simple/simple.H index 0befd32ae6..4df9a37a2e 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/simple/simple.H +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/simple/simple.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,8 +57,8 @@ class simple //- A coefficient dimensionedScalar a_; - //- Drift velocity - dimensionedVector V0_; + //- Drift velocity coefficient + dimensionedScalar Vc_; //- Residual phase fraction dimensionedScalar residualAlpha_; @@ -76,7 +76,9 @@ public: simple ( const dictionary& dict, - const incompressibleTwoPhaseInteractingMixture& mixture + const incompressibleTwoPhaseInteractingMixture& mixture, + const uniformDimensionedVectorField& g, + const MRFZoneList& MRF ); diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C index 0da6f2943f..839cdc3e1d 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C @@ -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-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -94,7 +94,7 @@ void Foam::MRFZone::setMRFFaces() { forAll(pp, i) { - label facei = pp.start()+i; + const label facei = pp.start() + i; if (zoneCell[own[facei]]) { @@ -107,7 +107,7 @@ void Foam::MRFZone::setMRFFaces() { forAll(pp, i) { - label facei = pp.start()+i; + const label facei = pp.start() + i; if (zoneCell[own[facei]]) { @@ -149,7 +149,7 @@ void Foam::MRFZone::setMRFFaces() forAll(pp, patchFacei) { - label facei = pp.start() + patchFacei; + const label facei = pp.start() + patchFacei; if (faceType[facei] == 1) { @@ -178,7 +178,7 @@ void Foam::MRFZone::setMRFFaces() forAll(pp, patchFacei) { - label facei = pp.start() + patchFacei; + const label facei = pp.start() + patchFacei; if (faceType[facei] == 1) { @@ -195,23 +195,28 @@ void Foam::MRFZone::setMRFFaces() if (debug) { faceSet internalFaces(mesh_, "internalFaces", internalFaces_); + Pout<< "Writing " << internalFaces.size() << " internal faces in MRF zone to faceSet " << internalFaces.name() << endl; + internalFaces.write(); faceSet MRFFaces(mesh_, "includedFaces", 100); + forAll(includedFaces_, patchi) { forAll(includedFaces_[patchi], i) { - label patchFacei = includedFaces_[patchi][i]; + const label patchFacei = includedFaces_[patchi][i]; MRFFaces.insert(patches[patchi].start()+patchFacei); } } + Pout<< "Writing " << MRFFaces.size() << " patch faces in MRF zone to faceSet " << MRFFaces.name() << endl; + MRFFaces.write(); faceSet excludedFaces(mesh_, "excludedFaces", 100); @@ -219,13 +224,15 @@ void Foam::MRFZone::setMRFFaces() { forAll(excludedFaces_[patchi], i) { - label patchFacei = excludedFaces_[patchi][i]; + const label patchFacei = excludedFaces_[patchi][i]; excludedFaces.insert(patches[patchi].start()+patchFacei); } } + Pout<< "Writing " << excludedFaces.size() << " faces in MRF zone with special handling to faceSet " << excludedFaces.name() << endl; + excludedFaces.write(); } } @@ -318,7 +325,7 @@ void Foam::MRFZone::addCoriolis forAll(cells, i) { - label celli = cells[i]; + const label celli = cells[i]; ddtUc[celli] += (Omega ^ Uc[celli]); } } @@ -342,7 +349,7 @@ void Foam::MRFZone::addCoriolis(fvVectorMatrix& UEqn, const bool rhs) const { forAll(cells, i) { - label celli = cells[i]; + const label celli = cells[i]; Usource[celli] += V[celli]*(Omega ^ U[celli]); } } @@ -350,7 +357,7 @@ void Foam::MRFZone::addCoriolis(fvVectorMatrix& UEqn, const bool rhs) const { forAll(cells, i) { - label celli = cells[i]; + const label celli = cells[i]; Usource[celli] -= V[celli]*(Omega ^ U[celli]); } } @@ -380,7 +387,7 @@ void Foam::MRFZone::addCoriolis { forAll(cells, i) { - label celli = cells[i]; + const label celli = cells[i]; Usource[celli] += V[celli]*rho[celli]*(Omega ^ U[celli]); } } @@ -388,13 +395,52 @@ void Foam::MRFZone::addCoriolis { forAll(cells, i) { - label celli = cells[i]; + const label celli = cells[i]; Usource[celli] -= V[celli]*rho[celli]*(Omega ^ U[celli]); } } } +void Foam::MRFZone::addCentrifugalAcceleration +( + volVectorField& centrifugalAcceleration +) const +{ + if (cellZoneID_ == -1) + { + return; + } + + const labelList& cells = mesh_.cellZones()[cellZoneID_]; + const volVectorField& C = mesh_.C(); + vectorField& cac = centrifugalAcceleration.primitiveFieldRef(); + + const vector Omega = this->Omega(); + + forAll(cells, i) + { + const label celli = cells[i]; + cac[celli] -= Omega ^ (Omega ^ (C[celli] - origin_)); + } + + // Included (rotating) patches + + volVectorField::Boundary& caf = centrifugalAcceleration.boundaryFieldRef(); + + forAll(includedFaces_, patchi) + { + forAll(includedFaces_[patchi], i) + { + const label patchFacei = includedFaces_[patchi][i]; + caf[patchi][patchFacei] -= + Omega + ^ (Omega ^ (C.boundaryField()[patchi][patchFacei] - origin_)); + } + } +} + + void Foam::MRFZone::makeRelative(volVectorField& U) const { if (cellZoneID_ == -1) @@ -403,14 +449,13 @@ void Foam::MRFZone::makeRelative(volVectorField& U) const } const volVectorField& C = mesh_.C(); + const labelList& cells = mesh_.cellZones()[cellZoneID_]; const vector Omega = this->Omega(); - const labelList& cells = mesh_.cellZones()[cellZoneID_]; - forAll(cells, i) { - label celli = cells[i]; + const label celli = cells[i]; U[celli] -= (Omega ^ (C[celli] - origin_)); } @@ -422,7 +467,7 @@ void Foam::MRFZone::makeRelative(volVectorField& U) const { forAll(includedFaces_[patchi], i) { - label patchFacei = includedFaces_[patchi][i]; + const label patchFacei = includedFaces_[patchi][i]; Ubf[patchi][patchFacei] = Zero; } } @@ -432,7 +477,7 @@ void Foam::MRFZone::makeRelative(volVectorField& U) const { forAll(excludedFaces_[patchi], i) { - label patchFacei = excludedFaces_[patchi][i]; + const label patchFacei = excludedFaces_[patchi][i]; Ubf[patchi][patchFacei] -= (Omega ^ (C.boundaryField()[patchi][patchFacei] - origin_)); @@ -477,14 +522,13 @@ void Foam::MRFZone::makeAbsolute(volVectorField& U) const } const volVectorField& C = mesh_.C(); + const labelList& cells = mesh_.cellZones()[cellZoneID_]; const vector Omega = this->Omega(); - const labelList& cells = mesh_.cellZones()[cellZoneID_]; - forAll(cells, i) { - label celli = cells[i]; + const label celli = cells[i]; U[celli] += (Omega ^ (C[celli] - origin_)); } @@ -495,7 +539,7 @@ void Foam::MRFZone::makeAbsolute(volVectorField& U) const { forAll(includedFaces_[patchi], i) { - label patchFacei = includedFaces_[patchi][i]; + const label patchFacei = includedFaces_[patchi][i]; Ubf[patchi][patchFacei] = (Omega ^ (C.boundaryField()[patchi][patchFacei] - origin_)); } @@ -506,7 +550,7 @@ void Foam::MRFZone::makeAbsolute(volVectorField& U) const { forAll(excludedFaces_[patchi], i) { - label patchFacei = excludedFaces_[patchi][i]; + const label patchFacei = excludedFaces_[patchi][i]; Ubf[patchi][patchFacei] += (Omega ^ (C.boundaryField()[patchi][patchFacei] - origin_)); } @@ -545,7 +589,7 @@ void Foam::MRFZone::correctBoundaryVelocity(volVectorField& U) const forAll(includedFaces_[patchi], i) { - label patchFacei = includedFaces_[patchi][i]; + const label patchFacei = includedFaces_[patchi][i]; pfld[patchFacei] = (Omega ^ (patchC[patchFacei] - origin_)); } diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.H b/src/finiteVolume/cfdTools/general/MRF/MRFZone.H index de7b163a43..56895f5622 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.H +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -211,6 +211,12 @@ public: const bool rhs = false ) const; + //- Add the centrifugal acceleration + void addCentrifugalAcceleration + ( + volVectorField& centrifugalAcceleration + ) const; + //- Make the given absolute velocity relative within the MRF region void makeRelative(volVectorField& U) const; diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C index 0644b4853a..755762123c 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -107,20 +107,20 @@ bool Foam::MRFZoneList::writeData(Ostream& os) const } -void Foam::MRFZoneList::addAcceleration +void Foam::MRFZoneList::addCoriolis ( const volVectorField& U, volVectorField& ddtU ) const { forAll(*this, i) - { + { operator[](i).addCoriolis(U, ddtU); } } -void Foam::MRFZoneList::addAcceleration(fvVectorMatrix& UEqn) const +void Foam::MRFZoneList::addCoriolis(fvVectorMatrix& UEqn) const { forAll(*this, i) { @@ -129,7 +129,7 @@ void Foam::MRFZoneList::addAcceleration(fvVectorMatrix& UEqn) const } -void Foam::MRFZoneList::addAcceleration +void Foam::MRFZoneList::addCoriolis ( const volScalarField& rho, fvVectorMatrix& UEqn @@ -147,23 +147,23 @@ Foam::tmp Foam::MRFZoneList::DDt const volVectorField& U ) const { - tmp tacceleration + tmp tDDt ( volVectorField::New ( - "MRFZoneList:acceleration", + "MRFZoneList:DDt", U.mesh(), dimensionedVector(U.dimensions()/dimTime, Zero) ) ); - volVectorField& acceleration = tacceleration.ref(); + volVectorField& DDt = tDDt.ref(); forAll(*this, i) { - operator[](i).addCoriolis(U, acceleration); + operator[](i).addCoriolis(U, DDt); } - return tacceleration; + return tDDt; } @@ -177,6 +177,30 @@ Foam::tmp Foam::MRFZoneList::DDt } +Foam::tmp +Foam::MRFZoneList::centrifugalAcceleration() const +{ + tmp tcentrifugalAcceleration + ( + volVectorField::New + ( + "MRFZoneList:centrifugalAcceleration", + mesh_, + dimensionedVector(dimAcceleration, Zero) + ) + ); + volVectorField& centrifugalAcceleration = tcentrifugalAcceleration.ref(); + + forAll(*this, i) + { + operator[](i).addCentrifugalAcceleration(centrifugalAcceleration); + } + + return tcentrifugalAcceleration; +} + + + void Foam::MRFZoneList::makeRelative(volVectorField& U) const { forAll(*this, i) diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.H b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.H index e752a9e280..f21cabb80c 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.H +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -81,42 +81,42 @@ public: // Member Functions - //- Return active status - bool active(const bool warn = false) const; - //- Reset the source list void reset(const dictionary& dict); - //- Add the frame acceleration - void addAcceleration + //- Add the Coriolis acceleration + void addCoriolis ( const volVectorField& U, volVectorField& ddtU ) const; - //- Add the frame acceleration contribution to the momentum equation - void addAcceleration(fvVectorMatrix& UEqn) const; + //- Add the Coriolis acceleration to the momentum equation + void addCoriolis(fvVectorMatrix& UEqn) const; - //- Add the frame acceleration contribution to the momentum equation - void addAcceleration + //- Add the Coriolis acceleration to the momentum equation + void addCoriolis ( const volScalarField& rho, fvVectorMatrix& UEqn ) const; - //- Return the frame acceleration + //- Return the Coriolis acceleration tmp DDt ( const volVectorField& U ) const; - //- Return the frame acceleration + //- Return the Coriolis acceleration tmp DDt ( const volScalarField& rho, const volVectorField& U ) const; + //- Return the centrifugal acceleration + tmp centrifugalAcceleration() const; + //- Make the given absolute velocity relative within the MRF region void makeRelative(volVectorField& U) const; diff --git a/tutorials/multiphase/driftFluxFoam/RAS/dahl/constant/phaseProperties b/tutorials/multiphase/driftFluxFoam/RAS/dahl/constant/phaseProperties index cac2e81e5a..ab3e083876 100644 --- a/tutorials/multiphase/driftFluxFoam/RAS/dahl/constant/phaseProperties +++ b/tutorials/multiphase/driftFluxFoam/RAS/dahl/constant/phaseProperties @@ -20,7 +20,7 @@ relativeVelocityModel simple; "(simple|general)Coeffs" { - V0 (0 -0.002198 0); + Vc 2.241e-4; a 285.84; a1 0.1; residualAlpha 0; diff --git a/tutorials/multiphase/driftFluxFoam/RAS/mixerVessel2D/constant/g b/tutorials/multiphase/driftFluxFoam/RAS/mixerVessel2D/constant/g index 5b7d3ef780..bf67fe74a5 100644 --- a/tutorials/multiphase/driftFluxFoam/RAS/mixerVessel2D/constant/g +++ b/tutorials/multiphase/driftFluxFoam/RAS/mixerVessel2D/constant/g @@ -15,6 +15,6 @@ FoamFile // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -2 0 0 0 0]; -value (0 -9.81 0); +value (0 0 0); // ************************************************************************* // diff --git a/tutorials/multiphase/driftFluxFoam/RAS/mixerVessel2D/constant/phaseProperties b/tutorials/multiphase/driftFluxFoam/RAS/mixerVessel2D/constant/phaseProperties index cac2e81e5a..ab3e083876 100644 --- a/tutorials/multiphase/driftFluxFoam/RAS/mixerVessel2D/constant/phaseProperties +++ b/tutorials/multiphase/driftFluxFoam/RAS/mixerVessel2D/constant/phaseProperties @@ -20,7 +20,7 @@ relativeVelocityModel simple; "(simple|general)Coeffs" { - V0 (0 -0.002198 0); + Vc 2.241e-4; a 285.84; a1 0.1; residualAlpha 0; diff --git a/tutorials/multiphase/driftFluxFoam/RAS/tank3D/constant/phaseProperties b/tutorials/multiphase/driftFluxFoam/RAS/tank3D/constant/phaseProperties index ad675be3c0..c33fb55af5 100644 --- a/tutorials/multiphase/driftFluxFoam/RAS/tank3D/constant/phaseProperties +++ b/tutorials/multiphase/driftFluxFoam/RAS/tank3D/constant/phaseProperties @@ -20,7 +20,7 @@ relativeVelocityModel simple; "(simple|general)Coeffs" { - V0 (0 -0.002198 0); + Vc 2.241e-4; a 8.84; a1 0.1; residualAlpha 0;