From 463296eb40217650230a5a1a962fbd519c24f9ac Mon Sep 17 00:00:00 2001 From: sergio Date: Tue, 2 Feb 2016 09:10:52 -0800 Subject: [PATCH 1/4] Adding corrections folder to fvOptions library (Fixes #63) --- src/fvOptions/Make/files | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/fvOptions/Make/files b/src/fvOptions/Make/files index a32c535177..e3778435f7 100644 --- a/src/fvOptions/Make/files +++ b/src/fvOptions/Make/files @@ -62,4 +62,8 @@ $(derivedConstraints)/fixedTemperatureConstraint/fixedTemperatureConstraint.C $(derivedConstraints)/velocityDampingConstraint/velocityDampingConstraint.C +/* Corrections */ + +corrections/limitTemperature/limitTemperature.C + LIB = $(FOAM_LIBBIN)/libfvOptions From b98a5c104173cd0bf34e2aa29f81ce36f753e63a Mon Sep 17 00:00:00 2001 From: sergio Date: Mon, 15 Feb 2016 10:10:57 -0800 Subject: [PATCH 2/4] BUG: Renaming k field in applyBoundaryLayer.C (fixes #70) --- .../preProcessing/applyBoundaryLayer/applyBoundaryLayer.C | 1 + 1 file changed, 1 insertion(+) diff --git a/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C b/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C index 94c7f53f84..4473b8391d 100644 --- a/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C +++ b/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C @@ -100,6 +100,7 @@ Foam::tmp calcK volScalarField& k = tk(); scalar ck0 = pow025(Cmu)*kappa; k = (1 - mask)*k + mask*sqr(nut/(ck0*min(y, ybl))); + k.rename("k"); // Do not correct BC // - operation may use inconsistent fields wrt these local manipulations From 6e829fb32ed451cabd01b3ad15ba19efbd60530c Mon Sep 17 00:00:00 2001 From: sergio Date: Wed, 17 Feb 2016 15:16:57 -0800 Subject: [PATCH 3/4] ENH: renaming epsilon field in applyBoundaryLayer --- .../preProcessing/applyBoundaryLayer/applyBoundaryLayer.C | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C b/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C index 4473b8391d..3ec45ddfc9 100644 --- a/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C +++ b/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C @@ -104,7 +104,7 @@ Foam::tmp calcK // Do not correct BC // - operation may use inconsistent fields wrt these local manipulations - // k.correctBoundaryConditions(); + //k.correctBoundaryConditions(); correctProcessorPatches(k); Info<< "Writing k\n" << endl; @@ -132,6 +132,7 @@ Foam::tmp calcEpsilon scalar ce0 = ::pow(Cmu, 0.75)/kappa; epsilon = (1 - mask)*epsilon + mask*ce0*k*sqrt(k)/min(y, ybl); epsilon.max(SMALL); + epsilon.rename("epsilon"); // Do not correct BC // - operation may use inconsistent fields wrt these local manipulations @@ -297,6 +298,7 @@ void calcIncompressible // Calculate nut - reference nut is calculated by the turbulence model // on its construction volScalarField& nut = tnut(); + volScalarField S(mag(dev(symm(fvc::grad(U))))); nut = (1 - mask)*nut + mask*sqr(kappa*min(y, ybl))*::sqrt(2)*S; From 907c3627547959600d5d04d193bae3a1f03f2cf1 Mon Sep 17 00:00:00 2001 From: sergio Date: Thu, 18 Feb 2016 14:13:15 -0800 Subject: [PATCH 4/4] BUG: Adding correct turbulent in applyBoundaryLayer --- .../applyBoundaryLayer/applyBoundaryLayer.C | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C b/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C index 3ec45ddfc9..402cd63154 100644 --- a/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C +++ b/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C @@ -62,7 +62,6 @@ void correctProcessorPatches(volScalarField& vf) // Not possible to use correctBoundaryConditions on fields as they may // use local info as opposed to the constraint values employed here, // but still need to update processor patches - volScalarField::GeometricBoundaryField& bf = vf.boundaryField(); forAll(bf, patchI) @@ -249,6 +248,7 @@ void calcCompressible ) ); + turbulence->correct(); // Calculate nut - reference nut is calculated by the turbulence model // on its construction tmp tnut = turbulence->nut(); @@ -295,11 +295,13 @@ void calcIncompressible tmp tnut = turbulence->nut(); + turbulence->correct(); + // Calculate nut - reference nut is calculated by the turbulence model // on its construction volScalarField& nut = tnut(); - volScalarField S(mag(dev(symm(fvc::grad(U))))); + volScalarField S("S", mag(dev(symm(fvc::grad(U))))); nut = (1 - mask)*nut + mask*sqr(kappa*min(y, ybl))*::sqrt(2)*S; // Do not correct BC - wall functions will 'undo' manipulation above @@ -367,7 +369,6 @@ int main(int argc, char *argv[]) // Modify velocity by applying a 1/7th power law boundary-layer // u/U0 = (y/ybl)^(1/7) // assumes U0 is the same as the current cell velocity - Info<< "Setting boundary layer velocity" << nl << endl; scalar yblv = ybl.value(); forAll(U, cellI) @@ -380,6 +381,8 @@ int main(int argc, char *argv[]) } mask.correctBoundaryConditions(); + + Info<< "Writing U\n" << endl; U.write();