diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H index c12602536870ab39e1a63a81062b143d5d360c00..d152baba0bb44a1f2cd042596f94030157e0f713 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H @@ -3,7 +3,11 @@ ( fvm::ddt(alpha1) + fvm::div(phi, alpha1) - - fvm::laplacian(Dab, alpha1) + - fvm::laplacian + ( + Dab + alphatab*turbulence->nut(), alpha1, + "laplacian(Dab,alpha1)" + ) ); alpha1Eqn.solve(); diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H b/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H index a38135dc19a968cd10cf38beec6b3a35a4e4165b..3b5e064372bae2278984d8585dd4a3fc95e385fb 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H @@ -50,6 +50,9 @@ dimensionedScalar Dab(twoPhaseProperties.lookup("Dab")); + // Read the reciprocal of the turbulent Schmidt number + dimensionedScalar alphatab(twoPhaseProperties.lookup("alphatab")); + // Need to store rho for ddt(rho, U) volScalarField rho("rho", alpha1*rho1 + (scalar(1) - alpha1)*rho2); rho.oldTime(); diff --git a/applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C b/applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C index dc92aade57b699d0a6b4816c1825684b304b2575..54acae002582bfa1dcb5e09c5c20255be2c7bac4 100644 --- a/applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C +++ b/applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) // Give patch area if (isType<cyclicPolyPatch>(mesh.boundaryMesh()[patchi])) { - Info<< " Cyclic patch area: " << nl; + Info<< " Cyclic patch vector area: " << nl; label nFaces = mesh.boundaryMesh()[patchi].size(); vector sum1 = vector::zero; vector sum2 = vector::zero; @@ -92,12 +92,18 @@ int main(int argc, char *argv[]) Info<< " - half 1 = " << sum1 << ", " << mag(sum1) << nl << " - half 2 = " << sum2 << ", " << mag(sum2) << nl << " - total = " << (sum1 + sum2) << ", " - << mag(sum1 + sum2) << endl;; + << mag(sum1 + sum2) << endl; + Info<< " Cyclic patch area magnitude = " + << gSum(mesh.magSf().boundaryField()[patchi])/2.0 << endl; } else { - Info<< " Patch area = " + Info<< " Area vector of patch " + << patchName << '[' << patchi << ']' << " = " << gSum(mesh.Sf().boundaryField()[patchi]) << endl; + Info<< " Area magnitude of patch " + << patchName << '[' << patchi << ']' << " = " + << gSum(mesh.magSf().boundaryField()[patchi]) << endl; } // Read field and calc integral @@ -107,15 +113,26 @@ int main(int argc, char *argv[]) << fieldName << endl; volScalarField field(fieldHeader, mesh); - vector sumField = gSum - ( - mesh.Sf().boundaryField()[patchi] - *field.boundaryField()[patchi] - ); - Info<< " Integral of " << fieldName << " over patch " + Info<< " Integral of " << fieldName + << " over vector area of patch " << patchName << '[' << patchi << ']' << " = " - << sumField << nl; + << gSum + ( + mesh.Sf().boundaryField()[patchi] + *field.boundaryField()[patchi] + ) + << nl; + + Info<< " Integral of " << fieldName + << " over area magnitude of patch " + << patchName << '[' << patchi << ']' << " = " + << gSum + ( + mesh.magSf().boundaryField()[patchi] + *field.boundaryField()[patchi] + ) + << nl; } else if ( diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C index c31f5acc5c3888b49479e7f11b791ae28d51c25c..b6f48ff6ada8e214e41f83c848bafabdb32de46e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C @@ -113,7 +113,17 @@ void fixedFluxBuoyantPressureFvPatchScalarField::updateCoeffs() const fvPatchField<scalar>& rho = patch().lookupPatchField<volScalarField, scalar>("rho"); - gradient() = -rho.snGrad()*(g.value() & patch().Cf()); + // If the variable name is "pd" assume it is p - rho*g.h + // and set the gradient appropriately. + // Otherwise assume the variable is the static pressure. + if (dimensionedInternalField().name() == "pd") + { + gradient() = -rho.snGrad()*(g.value() & patch().Cf()); + } + else + { + gradient() = rho*(g.value() & patch().nf()); + } fixedGradientFvPatchScalarField::updateCoeffs(); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.H index 3ce584bf873cef5a8a88804dd0076b82145be4c5..8e433cb8f167f0304ec840bb270c4521c9230e5b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.H @@ -26,7 +26,10 @@ Class Foam::fixedFluxBuoyantPressureFvPatchScalarField Description - Foam::fixedFluxBuoyantPressureFvPatchScalarField + Set the pressure gradient boundary condition appropriately for buoyant flow. + + If the variable name is "pd" assume it is p - rho*g.h and set the gradient + appropriately. Otherwise assume the variable is the static pressure. SourceFiles fixedFluxBuoyantPressureFvPatchScalarField.C