From c3e9d8bd20513012feb8c005b9c7f240cd227619 Mon Sep 17 00:00:00 2001 From: Sergio Ferraris Date: Tue, 19 Nov 2013 15:43:03 +0000 Subject: [PATCH 1/5] BUG: Correcting mapping rho and mu to calculate momemtum sink of the master on the slave region --- .../interRegionExplicitPorositySource.C | 53 +++++++++++++++++-- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/src/fvOptions/sources/interRegion/interRegionExplicitPorositySource/interRegionExplicitPorositySource.C b/src/fvOptions/sources/interRegion/interRegionExplicitPorositySource/interRegionExplicitPorositySource.C index 799a901bae..29d72dd112 100644 --- a/src/fvOptions/sources/interRegion/interRegionExplicitPorositySource/interRegionExplicitPorositySource.C +++ b/src/fvOptions/sources/interRegion/interRegionExplicitPorositySource/interRegionExplicitPorositySource.C @@ -173,10 +173,55 @@ void Foam::fv::interRegionExplicitPorositySource::addSup if (eqn.dimensions() == dimForce) { - const volScalarField& rhoNbr = - nbrMesh.lookupObject(rhoName_); - const volScalarField& muNbr = - nbrMesh.lookupObject(muName_); + volScalarField rhoNbr + ( + IOobject + ( + "rho:UNbr", + nbrMesh.time().timeName(), + nbrMesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + nbrMesh, + dimensionedScalar("zero", dimDensity, 0.0) + ); + + volScalarField muNbr + ( + IOobject + ( + "mu:UNbr", + nbrMesh.time().timeName(), + nbrMesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + nbrMesh, + dimensionedScalar("zero", dimViscosity, 0.0) + ); + + const volScalarField& rho = + mesh_.lookupObject(rhoName_); + + const volScalarField& mu = + mesh_.lookupObject(muName_); + + // map local rho onto neighbour region + meshInterp().mapSrcToTgt + ( + rho.internalField(), + plusEqOp(), + rhoNbr.internalField() + ); + + // map local mu onto neighbour region + meshInterp().mapSrcToTgt + ( + mu.internalField(), + plusEqOp(), + muNbr.internalField() + ); porosityPtr_->addResistance(nbrEqn, rhoNbr, muNbr); } From 4bb0f806433539ef778dc4954a8ba396a4fec3e4 Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 25 Nov 2013 10:06:35 +0000 Subject: [PATCH 2/5] Added prghPressureFvPatchScalarField --- src/finiteVolume/Make/files | 1 + 1 file changed, 1 insertion(+) diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 212a22baf5..3cf741ef81 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -192,6 +192,7 @@ $(derivedFvPatchFields)/variableHeightFlowRateInletVelocity/variableHeightFlowRa $(derivedFvPatchFields)/waveTransmissive/waveTransmissiveFvPatchFields.C $(derivedFvPatchFields)/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C $(derivedFvPatchFields)/interstitialInletVelocity/interstitialInletVelocityFvPatchVectorField.C +$(derivedFvPatchFields)/prghPressure/prghPressureFvPatchScalarField.C fvsPatchFields = fields/fvsPatchFields $(fvsPatchFields)/fvsPatchField/fvsPatchFields.C From 1a56cdfd14c912d213f5be09d0c96e258eaecda2 Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 25 Nov 2013 10:10:00 +0000 Subject: [PATCH 3/5] interfaceProperties: Name grad(alpha1) "nHat" so that a specific scheme can be selected for it --- .../interfaceProperties/interfaceProperties.C | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/transportModels/interfaceProperties/interfaceProperties.C b/src/transportModels/interfaceProperties/interfaceProperties.C index cfa20630ae..9387769cae 100644 --- a/src/transportModels/interfaceProperties/interfaceProperties.C +++ b/src/transportModels/interfaceProperties/interfaceProperties.C @@ -112,7 +112,7 @@ void Foam::interfaceProperties::calculateK() const surfaceVectorField& Sf = mesh.Sf(); // Cell gradient of alpha - const volVectorField gradAlpha(fvc::grad(alpha1_)); + const volVectorField gradAlpha(fvc::grad(alpha1_, "nHat")); // Interpolated face-gradient of alpha surfaceVectorField gradAlphaf(fvc::interpolate(gradAlpha)); @@ -123,6 +123,11 @@ void Foam::interfaceProperties::calculateK() // Face unit interface normal surfaceVectorField nHatfv(gradAlphaf/(mag(gradAlphaf) + deltaN_)); + // surfaceVectorField nHatfv + // ( + // (gradAlphaf + deltaN_*vector(0, 0, 1) + // *sign(gradAlphaf.component(vector::Z)))/(mag(gradAlphaf) + deltaN_) + // ); correctContactAngle(nHatfv.boundaryField(), gradAlphaf.boundaryField()); // Face unit interface normal flux From 72530d40ba7f85272212fc5fc458d50f6974a379 Mon Sep 17 00:00:00 2001 From: Sergio Ferraris Date: Mon, 25 Nov 2013 10:46:52 +0000 Subject: [PATCH 4/5] ENH: adding const access to reactingMixture list --- .../mixtures/reactingMixture/reactingMixture.H | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.H index b29c0758ad..210b9771b7 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -96,6 +96,11 @@ public: { return PtrList >::operator[](i); } + + const Reaction& operator [] (const label i) const + { + return PtrList >::operator[](i); + } }; From bcc5b89040b7015862837872d7204e318ffe2bbb Mon Sep 17 00:00:00 2001 From: Sergio Ferraris Date: Mon, 25 Nov 2013 10:56:43 +0000 Subject: [PATCH 5/5] BUG: Changing fvOption source in UEqn.H to the rhs --- .../solvers/heatTransfer/chtMultiRegionFoam/fluid/UEqn.H | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/UEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/UEqn.H index 35881bb544..602a04a6e5 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/UEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/UEqn.H @@ -4,7 +4,8 @@ fvm::ddt(rho, U) + fvm::div(phi, U) + turb.divDevRhoReff(U) - + fvOptions(rho, U) + == + fvOptions(rho, U) ); UEqn().relax();