diff --git a/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C b/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C index 4320ed70f3..7ec7a6c9ed 100644 --- a/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C +++ b/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C @@ -261,13 +261,8 @@ tmp calcNut incompressible::turbulenceModel::New(U, phi, laminarTransport) ); - // Hack to correct nut - // Note: in previous versions of the code, nut was initialised on - // construction of the turbulence model. This is no longer the - // case for the Templated Turbulence models. The call to correct - // below will evolve the turbulence model equations and update - // nut, whereas only nut update is required. Need to revisit. - turbulence->correct(); + // Correct nut + turbulence->validate(); return tmp(new volScalarField(turbulence->nut())); } @@ -296,6 +291,11 @@ int main(int argc, char *argv[]) "scalar", "boundary-layer thickness as Cbl * mean distance to wall" ); + argList::addBoolOption + ( + "write-nut", + "Write the turbulence viscosity field" + ); #include "setRootCase.H" @@ -316,6 +316,8 @@ int main(int argc, char *argv[]) << exit(FatalError); } + bool writeNut = args.optionFound("write-nut"); + #include "createTime.H" #include "createNamedMesh.H" #include "createFields.H" @@ -348,7 +350,11 @@ int main(int argc, char *argv[]) // Do not correct BC - wall functions will 'undo' manipulation above // by using nut from turbulence model correctProcessorPatches(nut); - nut.write(); + if (writeNut) + { + Info<< "Writing nut\n" << endl; + nut.write(); + } // Boundary layer turbulence kinetic energy scalar ck0 = pow025(Cmu)*kappa; @@ -362,7 +368,7 @@ int main(int argc, char *argv[]) blendField("k", mesh, mask, kBL); blendField("epsilon", mesh, mask, epsilonBL); calcOmegaField(mesh, mask, kBL, epsilonBL); - setField(mesh, "nuTilda", nut); + if (writeNut) setField(mesh, "nuTilda", nut); // Write the updated U field Info<< "Writing U\n" << endl;