diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C index 916c34146d9ce7721568b8363798f14caed8142d..b5936628ef02473ebdbb8a8826d883cedff794b9 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,7 +49,7 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField z_(vector::zero), kappa_(0.41), Uref_(0), - Href_(0), + Zref_(0), z0_(0), zGround_(0), Ustar_(0) @@ -69,7 +69,7 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField z_(ptf.z_), kappa_(ptf.kappa_), Uref_(ptf.Uref_), - Href_(ptf.Href_), + Zref_(ptf.Zref_), z0_(ptf.z0_, mapper), zGround_(ptf.zGround_, mapper), Ustar_(ptf.Ustar_, mapper) @@ -88,7 +88,7 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField z_(dict.lookup("z")), kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)), Uref_(readScalar(dict.lookup("Uref"))), - Href_(readScalar(dict.lookup("Href"))), + Zref_(readScalar(dict.lookup("Zref"))), z0_("z0", dict, p.size()), zGround_("zGround", dict, p.size()), Ustar_(p.size()) @@ -108,15 +108,15 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField << abort(FatalError); } - forAll (Ustar_, i) - { - Ustar_[i] = kappa_*Uref_/(log((Href_ + z0_[i])/max(z0_[i] , 0.001))); - } - + // Ensure direction vectors are normalized z_ /= mag(z_); - const vectorField& c = patch().Cf(); - scalarField::operator=(pow3(Ustar_)/(kappa_*((c & z_) - zGround_ + z0_))); + Ustar_ = kappa_*Uref_/(log((Zref_ + z0_)/max(z0_, 0.001))); + + scalarField::operator= + ( + pow3(Ustar_)/(kappa_*((z_ & patch().Cf()) - zGround_ + z0_)) + ); } @@ -131,7 +131,7 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField z_(blpsf.z_), kappa_(blpsf.kappa_), Uref_(blpsf.Uref_), - Href_(blpsf.Href_), + Zref_(blpsf.Zref_), z0_(blpsf.z0_), zGround_(blpsf.zGround_), Ustar_(blpsf.Ustar_) @@ -178,8 +178,8 @@ void atmBoundaryLayerInletEpsilonFvPatchScalarField::write(Ostream& os) const << kappa_ << token::END_STATEMENT << nl; os.writeKeyword("Uref") << Uref_ << token::END_STATEMENT << nl; - os.writeKeyword("Href") - << Href_ << token::END_STATEMENT << nl; + os.writeKeyword("Zref") + << Zref_ << token::END_STATEMENT << nl; z0_.writeEntry("z0", os); zGround_.writeEntry("zGround", os); writeEntry("value", os); diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.H index e01d679f78b588a234301c768703279b12a2e6f3..34a9966baa15a088a19ddb56afd0f4ea93747eac 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,57 +29,56 @@ Group Description This boundary condition specifies an inlet value for the turbulence - dissipation, \f$\epsilon\f$ (\c epsilon), appropriate for atmospheric - boundary layers (ABL), and designed to be used in conjunction with the - \c ABLInletVelocity inlet velocity boundary condition. + dissipation, \f$\epsilon\f$, appropriate for atmospheric boundary layers + (ABL), and designed to be used in conjunction with the + atmBoundaryLayerInletVelocity inlet velocity boundary condition. \f[ - \epsilon = \frac{(U^*)^3}{K(z - z_g + z_0)} + \epsilon = \frac{(U^*)^3}{\kappa(z - z_g + z_0)} \f] where \vartable - U^* | frictional velocity - K | Karman's constant - z | vertical co-ordinate [m] - z_0 | surface roughness length [m] - z_g | minimum vlaue in z direction [m] + U^* | Friction velocity + \kappa | von Karman's constant + z | Vertical coordinate + z_0 | Surface roughness height [m] + z_g | Minimum z-coordinate [m] \endvartable - + and: \f[ - U^* = K \frac{U_{ref}}{ln\left(\frac{Z_{ref} + z_0}{z_0}\right)} + U^* = \kappa\frac{U_{ref}}{ln\left(\frac{Z_{ref} + z_0}{z_0}\right)} \f] where: \vartable - U_{ref} | reference velocity at \f$Z_{ref}\f$ [m/s] - Z_{ref} | reference height [m] + U_{ref} | Reference velocity at \f$Z_{ref}\f$ [m/s] + Z_{ref} | Reference height [m] \endvartable \heading Patch usage \table - Property | Description | Required | Default value - z | vertical direction of z-axis | yes | - kappa | Karman's constanat | no | 0.41 - Uref | reference velocity [m/s] | yes | - Href | reference height [m] | yes | - z0 | surface roughness length [m] | yes | - zGround | minimum z co-ordinate [m] | yes | + Property | Description | Required | Default value + z | Vertical direction | yes | + kappa | von Karman's constant | no | 0.41 + Uref | Reference velocity [m/s] | yes | + Zref | Reference height [m] | yes | + z0 | Surface roughness height [m] | yes | + zGround | Minimum z coordinate [m] | yes | \endtable Example of the boundary condition specification: \verbatim - myPatch + ground { type atmBoundaryLayerInletEpsilon; - z (0 1 0); - kappa 0.41; - Uref 1.0; - Href 0.0; - z0 uniform 0.0; + z (0 0 1); + Uref 10.0; + Zref 20.0; + z0 uniform 0.1; zGround uniform 0.0; } \endverbatim @@ -121,22 +120,22 @@ class atmBoundaryLayerInletEpsilonFvPatchScalarField //- Direction of the z-coordinate vector z_; - //- Von Karman constant + //- von Karman constant const scalar kappa_; //- Reference velocity const scalar Uref_; //- Reference height - const scalar Href_; + const scalar Zref_; - //- Surface roughness length + //- Surface roughness height scalarField z0_; - //- Minimum co-ordinate value in z direction + //- Minimum coordinate value in z direction scalarField zGround_; - //- Frictional velocity + //- Friction velocity scalarField Ustar_; @@ -206,13 +205,13 @@ public: // Access - //- Return max value + //- Return friction velocity const scalarField& Ustar() const { return Ustar_; } - //- Return z direction + //- Return z-direction const vector& z() const { return z_; diff --git a/src/turbulenceModels/incompressible/turbulenceModel/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C b/src/turbulenceModels/incompressible/turbulenceModel/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C index 85f8438318aa60955ba8d99d9f2e7ccbbddae654..f46b9bbdb3e9d2644f120d4333cf337b1be1568c 100644 --- a/src/turbulenceModels/incompressible/turbulenceModel/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C +++ b/src/turbulenceModels/incompressible/turbulenceModel/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C @@ -46,14 +46,14 @@ atmBoundaryLayerInletVelocityFvPatchVectorField ) : fixedValueFvPatchVectorField(p, iF), - Ustar_(0), n_(pTraits<vector>::zero), z_(pTraits<vector>::zero), - z0_(0), kappa_(0.41), Uref_(0), - Href_(0), - zGround_(0) + Zref_(0), + z0_(0), + zGround_(0), + Ustar_(0) {} @@ -67,14 +67,14 @@ atmBoundaryLayerInletVelocityFvPatchVectorField ) : fixedValueFvPatchVectorField(ptf, p, iF, mapper), - Ustar_(ptf.Ustar_, mapper), n_(ptf.n_), z_(ptf.z_), - z0_(ptf.z0_, mapper), kappa_(ptf.kappa_), Uref_(ptf.Uref_), - Href_(ptf.Href_), - zGround_(ptf.zGround_, mapper) + Zref_(ptf.Zref_), + z0_(ptf.z0_, mapper), + zGround_(ptf.zGround_, mapper), + Ustar_(ptf.Ustar_, mapper) {} @@ -87,14 +87,14 @@ atmBoundaryLayerInletVelocityFvPatchVectorField ) : fixedValueFvPatchVectorField(p, iF), - Ustar_(p.size()), n_(dict.lookup("n")), z_(dict.lookup("z")), - z0_("z0", dict, p.size()), kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)), Uref_(readScalar(dict.lookup("Uref"))), - Href_(readScalar(dict.lookup("Href"))), - zGround_("zGround", dict, p.size()) + Zref_(readScalar(dict.lookup("Zref"))), + z0_("z0", dict, p.size()), + zGround_("zGround", dict, p.size()), + Ustar_(p.size()) { if (mag(n_) < SMALL || mag(z_) < SMALL) { @@ -115,7 +115,7 @@ atmBoundaryLayerInletVelocityFvPatchVectorField n_ /= mag(n_); z_ /= mag(z_); - Ustar_ = kappa_*Uref_/(log((Href_ + z0_)/max(z0_, 0.001))); + Ustar_ = kappa_*Uref_/(log((Zref_ + z0_)/max(z0_, 0.001))); scalarField Un ( (Ustar_/kappa_) @@ -134,14 +134,14 @@ atmBoundaryLayerInletVelocityFvPatchVectorField ) : fixedValueFvPatchVectorField(blpvf, iF), - Ustar_(blpvf.Ustar_), n_(blpvf.n_), z_(blpvf.z_), - z0_(blpvf.z0_), kappa_(blpvf.kappa_), Uref_(blpvf.Uref_), - Href_(blpvf.Href_), - zGround_(blpvf.zGround_) + Zref_(blpvf.Zref_), + z0_(blpvf.z0_), + zGround_(blpvf.zGround_), + Ustar_(blpvf.Ustar_) {} @@ -188,8 +188,8 @@ void atmBoundaryLayerInletVelocityFvPatchVectorField::write(Ostream& os) const << kappa_ << token::END_STATEMENT << nl; os.writeKeyword("Uref") << Uref_ << token::END_STATEMENT << nl; - os.writeKeyword("Href") - << Href_ << token::END_STATEMENT << nl; + os.writeKeyword("Zref") + << Zref_ << token::END_STATEMENT << nl; zGround_.writeEntry("zGround", os) ; writeEntry("value", os); } diff --git a/src/turbulenceModels/incompressible/turbulenceModel/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H b/src/turbulenceModels/incompressible/turbulenceModel/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H index c766c5ad96c2397db7bd92a0ec86a1713c7d1490..39262b259898c27f9e76516104f5e82c1123ac0b 100644 --- a/src/turbulenceModels/incompressible/turbulenceModel/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H +++ b/src/turbulenceModels/incompressible/turbulenceModel/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,34 +30,33 @@ Group Description This boundary condition specifies a velocity inlet profile appropriate for atmospheric boundary layers (ABL). The profile is derived from the - friction velocity, flow direction and the direction of the parabolic - co-ordinate \c z. + friction velocity, flow direction and "vertical" direction. \f[ - U = \frac{U^*}{K} ln\left(\frac{z - z_g + z_0}{z_0}\right) + U = \frac{U^*}{\kappa} ln\left(\frac{z - z_g + z_0}{z_0}\right) \f] where \vartable - U^* | frictional velocity - K | Karman's constant - z | vertical co-ordinate [m] - z_0 | surface roughness length [m] - z_g | minimum vlaue in z direction [m] + U^* | Friction velocity + \kappa | von Karman's constant + z | Vertical coordinate + z_0 | Surface roughness height [m] + z_g | Minimum z-coordinate [m] \endvartable - - and: - + and \f[ - U^* = K \frac{U_{ref}}{ln\left(\frac{Z_{ref} + z_0}{z_0}\right)} + U^* = \kappa\frac{U_{ref}}{ln\left(\frac{Z_{ref} + z_0}{z_0}\right)} \f] - - where: + where \vartable - U_{ref} | reference velocity at \f$Z_{ref}\f$ [m/s] - Z_{ref} | reference height [m] + U_{ref} | Reference velocity at \f$Z_{ref}\f$ [m/s] + Z_{ref} | Reference height [m] \endvartable + Use in conjunction with the atmBoundaryLayerInletEpsilon boundary + condition if using an \f$\epsilon\f$ based turbulence model. + Reference: D.M. Hargreaves and N.G. Wright, "On the use of the k-epsilon model in commercial CFD software to model the neutral atmospheric boundary @@ -67,27 +66,26 @@ Description \heading Patch usage \table - Property | Description | Required | Default value - n | flow direction | yes | - z | vertical direction of z-axis | yes | - kappa | Karman's constanat | no | 0.41 - Uref | reference velocity [m/s] | yes | - Href | reference height [m] | yes | - z0 | surface roughness length [m] | yes | - zGround | minimum z co-ordinate [m] | yes | + Property | Description | Required | Default value + n | Flow direction | yes | + z | Vertical direction | yes | + kappa | von Karman's constant | no | 0.41 + Uref | Reference velocity [m/s] | yes | + Zref | Reference height [m] | yes | + z0 | Surface roughness height [m] | yes | + zGround | Minimum z-coordinate [m] | yes | \endtable Example of the boundary condition specification: \verbatim - myPatch + ground { type atmBoundaryLayerInletVelocity; - n (0 1 0); - z (0 1 0); - kappa 0.41; - Uref 1.0; - Href 0.0; - z0 uniform 0.0; + n (1 0 0); + z (0 0 1); + Uref 10.0; + Zref 20.0; + z0 uniform 0.1; zGround uniform 0.0; } \endverbatim @@ -126,30 +124,30 @@ class atmBoundaryLayerInletVelocityFvPatchVectorField { // Private data - //- Frictional velocity - scalarField Ustar_; - //- Flow direction vector n_; //- Direction of the z-coordinate vector z_; - //- Surface roughness length - scalarField z0_; - - //- Von Karman constant + //- von Karman constant const scalar kappa_; //- Reference velocity const scalar Uref_; - //- Reference hight - const scalar Href_; + //- Reference height + const scalar Zref_; + + //- Surface roughness height + scalarField z0_; - //- Minimum corrdinate value in z direction + //- Minimum coordinate value in z direction scalarField zGround_; + //- Friction velocity + scalarField Ustar_; + public: @@ -217,7 +215,7 @@ public: // Access - //- Return Ustar + //- Return friction velocity const scalarField& Ustar() const { return Ustar_; @@ -229,7 +227,7 @@ public: return n_; } - //- Return z direction + //- Return z-direction const vector& z() const { return z_; diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/0.org/U b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/U index f3174864c419d449596f4d343b041bf691d773d3..3aa64952c969d694475bf0b9009e4dcf55b52ff6 100644 --- a/tutorials/incompressible/simpleFoam/turbineSiting/0.org/U +++ b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/U @@ -36,7 +36,7 @@ boundaryField { type atmBoundaryLayerInletVelocity; Uref $Uref; - Href $Href; + Zref $Zref; n $windDirection; z $zDirection; z0 $z0; diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/0.org/epsilon b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/epsilon index 57d3eceea53ab4e50cf56ab4899f0d235431c13c..bd65224dab25d6b41df91210bc020e976dec8030 100644 --- a/tutorials/incompressible/simpleFoam/turbineSiting/0.org/epsilon +++ b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/epsilon @@ -45,7 +45,7 @@ boundaryField { type atmBoundaryLayerInletEpsilon; Uref $Uref; - Href $Href; + Zref $Zref; z $zDirection; z0 $z0; value $internalField; diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/0.org/include/ABLConditions b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/include/ABLConditions index b63b50f4175e2d921da42ba7fbf516706c4df3e4..78f948e5c0a63137a1ab7bfde8d195a01136bb5e 100644 --- a/tutorials/incompressible/simpleFoam/turbineSiting/0.org/include/ABLConditions +++ b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/include/ABLConditions @@ -7,7 +7,7 @@ \*---------------------------------------------------------------------------*/ Uref 10.0; -Href 20; +Zref 20; z0 uniform 0.1; turbulentKE 1.3; windDirection (1 0 0);