From 1449a6736452bf25a2c8a6bb402dc3f4b374af2d Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 27 Mar 2015 15:20:18 +0000 Subject: [PATCH] atmBoundaryLayer: Removed the hard-coded limit on z0 Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1638 --- .../atmBoundaryLayerInletEpsilonFvPatchScalarField.C | 2 +- .../atmBoundaryLayerInletVelocityFvPatchVectorField.C | 8 ++------ .../atmBoundaryLayer/atmBoundaryLayer.C | 4 ++-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C index 70d8b13e..4c4a12f3 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C @@ -110,7 +110,7 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField { Ustar_[i] = kappa_*Uref_ - /(log((Href_ + z0_[i])/max(z0_[i] , scalar(0.001)))); + /(log((Href_ + z0_[i])/z0_[i])); } z_ /= mag(z_); diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C index f0ef9c81..251bd2c2 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C @@ -116,7 +116,7 @@ atmBoundaryLayerInletVelocityFvPatchVectorField { Ustar_[i] = kappa_*Uref_ - /(log((Href_ + z0_[i])/max(z0_[i] , scalar(0.001)))); + /(log((Href_ + z0_[i])/z0_[i])); } const vectorField& c = patch().Cf(); @@ -129,11 +129,7 @@ atmBoundaryLayerInletVelocityFvPatchVectorField { Un[i] = (Ustar_[i]/kappa_) - *log - ( - (coord[i] - zGround_[i] + z0_[i]) - /max(z0_[i], scalar(0.001)) - ); + *log((coord[i] - zGround_[i] + z0_[i])/z0_[i]); } else { diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.C index eeb30de7..eb2ccf73 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.C @@ -73,7 +73,7 @@ atmBoundaryLayer::atmBoundaryLayer(const vectorField& p, const dictionary& dict) flowDir_ /= mag(flowDir_); zDir_ /= mag(zDir_); - Ustar_ = kappa_*Uref_/(log((Zref_ + z0_)/max(z0_, scalar(0.001)))); + Ustar_ = kappa_*Uref_/(log((Zref_ + z0_)/z0_)); } @@ -136,7 +136,7 @@ tmp atmBoundaryLayer::U(const vectorField& p) const scalarField Un ( (Ustar_/kappa_) - *log(((zDir_ & p) - zGround_ + z0_)/max(z0_, scalar(0.001))) + *log(((zDir_ & p) - zGround_ + z0_)/z0_) ); return flowDir_*Un;