From 7135a403cd11c219d99a61dca82296ec2925cbc2 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 1 Feb 2012 17:32:08 +0000 Subject: [PATCH 1/8] ENH: Exposed weightField to all face/cell source function object operations --- .../field/fieldValues/cellSource/cellSource.C | 7 ++--- .../field/fieldValues/cellSource/cellSource.H | 10 +++--- .../cellSource/cellSourceTemplates.C | 31 ++++++++++--------- .../field/fieldValues/faceSource/faceSource.C | 9 +++--- .../field/fieldValues/faceSource/faceSource.H | 15 ++++----- .../faceSource/faceSourceTemplates.C | 24 +++++++------- 6 files changed, 49 insertions(+), 47 deletions(-) diff --git a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C index 3bbb078c86..b42f15e6b3 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,9 +55,9 @@ namespace Foam { "none", "sum", + "average", "volAverage", "volIntegrate", - "weightedAverage", "min", "max", "CoV" @@ -143,9 +143,8 @@ void Foam::fieldValues::cellSource::initialise(const dictionary& dict) << " total volume = " << gSum(filterField(mesh().V())) << nl << endl; - if (operation_ == opWeightedAverage) + if (dict.readIfPresent("weightField", weightFieldName_)) { - dict.lookup("weightField") >> weightFieldName_; Info<< " weight field = " << weightFieldName_; } diff --git a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.H b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.H index 259c2aff88..573b53f522 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.H +++ b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,6 +39,7 @@ Description source cellZone; // Type of cell source sourceName c0; operation volAverage; + weightField alpha1; // optional weight field fields ( p @@ -49,9 +50,9 @@ Description where operation is one of: - none - sum + - average - volAverage - volIntegrate - - weightedAverage - CoV (Coefficient of variation: standard deviation/mean) SourceFiles @@ -103,9 +104,9 @@ public: { opNone, opSum, + opAverage, opVolAverage, opVolIntegrate, - opWeightedAverage, opMin, opMax, opCoV @@ -168,8 +169,7 @@ protected: Type processValues ( const Field& values, - const scalarField& V, - const scalarField& weightField + const scalarField& V ) const; //- Output file header information diff --git a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceTemplates.C b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceTemplates.C index 9a3263465c..61d39a43c9 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,8 +78,7 @@ template Type Foam::fieldValues::cellSource::processValues ( const Field& values, - const scalarField& V, - const scalarField& weightField + const scalarField& V ) const { Type result = pTraits::zero; @@ -90,6 +89,11 @@ Type Foam::fieldValues::cellSource::processValues result = sum(values); break; } + case opAverage: + { + result = sum(values)/values.size(); + break; + } case opVolAverage: { result = sum(values*V)/sum(V); @@ -100,11 +104,6 @@ Type Foam::fieldValues::cellSource::processValues result = sum(values*V); break; } - case opWeightedAverage: - { - result = sum(values*weightField)/sum(weightField); - break; - } case opMin: { result = min(values); @@ -152,23 +151,25 @@ bool Foam::fieldValues::cellSource::writeValues(const word& fieldName) if (ok) { Field values(setFieldValues(fieldName)); - combineFields(values); - scalarField V(filterField(mesh().V())); - combineFields(V); + scalarField weightField(values.size(), 1.0); - scalarField weightField; - - if (operation_ == opWeightedAverage) + if (weightFieldName_ != "none") { weightField = setFieldValues(weightFieldName_, true); } + // Combine onto master + combineFields(values); + combineFields(V); combineFields(weightField); + // apply weight field + values *= weightField; + if (Pstream::master()) { - Type result = processValues(values, V, weightField); + Type result = processValues(values, V); if (valueOutput_) { diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C index 98a45084bf..68befe8fd9 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -58,9 +58,9 @@ namespace Foam { "none", "sum", + "average", "areaAverage", "areaIntegrate", - "weightedAverage", "min", "max", "CoV" @@ -282,9 +282,8 @@ void Foam::fieldValues::faceSource::initialise(const dictionary& dict) << " total area = " << totalArea << nl; - if (operation_ == opWeightedAverage) + if (dict.readIfPresent("weightField", weightFieldName_)) { - dict.lookup("weightField") >> weightFieldName_; Info<< " weight field = " << weightFieldName_; } @@ -326,7 +325,7 @@ Foam::fieldValues::faceSource::faceSource fieldValue(name, obr, dict, loadFromFiles), source_(sourceTypeNames_.read(dict.lookup("source"))), operation_(operationTypeNames_.read(dict.lookup("operation"))), - weightFieldName_("undefinedWeightedFieldName"), + weightFieldName_("none"), nFaces_(0), faceId_(), facePatchId_(), diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H index 90f972c574..3c5ab78624 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H @@ -40,6 +40,7 @@ Description // faceZone,patch,sampledSurface sourceName f0; // faceZone name, see below operation sum; + weightField alpha1; // optional weight field fields ( p @@ -57,19 +58,20 @@ Description operation is one of: - none - sum + - average - areaAverage - areaIntegrate - - weightedAverage - min - max - CoV (Coefficient of variation: standard deviation/mean) + Notes: - faces on empty patches get ignored - if the field is a volField the faceZone can only consist of boundary - faces. + faces. - all fields get oriented according to the faceZone (so you might e.g. see - negative pressure) + negative pressure) - using sampledSurfaces: - they do not do surface fields - they use cell values - they do not do any interpolation. @@ -129,9 +131,9 @@ public: { opNone, opSum, + opAverage, opAreaAverage, opAreaIntegrate, - opWeightedAverage, opMin, opMax, opCoV @@ -165,7 +167,7 @@ protected: //- Operation to apply to values operationType operation_; - //- Weight field name - only used for opWeightedAverage mode + //- Weight field name - optional word weightFieldName_; //- Global number of faces @@ -213,8 +215,7 @@ protected: Type processValues ( const Field& values, - const scalarField& magSf, - const scalarField& weightField + const scalarField& magSf ) const; //- Output file header information diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C index 821fda5f6a..bf83e811bc 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -97,8 +97,7 @@ template Type Foam::fieldValues::faceSource::processValues ( const Field& values, - const scalarField& magSf, - const scalarField& weightField + const scalarField& magSf ) const { Type result = pTraits::zero; @@ -109,6 +108,11 @@ Type Foam::fieldValues::faceSource::processValues result = sum(values); break; } + case opAverage: + { + result = sum(values)/values.size(); + break; + } case opAreaAverage: { result = sum(values*magSf)/sum(magSf); @@ -119,11 +123,6 @@ Type Foam::fieldValues::faceSource::processValues result = sum(values*magSf); break; } - case opWeightedAverage: - { - result = sum(values*weightField)/sum(weightField); - break; - } case opMin: { result = min(values); @@ -173,9 +172,9 @@ bool Foam::fieldValues::faceSource::writeValues(const word& fieldName) if (ok) { Field values(getFieldValues(fieldName)); - scalarField weightField; + scalarField weightField(values.size(), 1.0); - if (operation_ == opWeightedAverage) + if (weightFieldName_ != "none") { weightField = getFieldValues(weightFieldName_, true); } @@ -198,10 +197,13 @@ bool Foam::fieldValues::faceSource::writeValues(const word& fieldName) combineFields(magSf); combineFields(weightField); + // apply weight field + values *= weightField; + if (Pstream::master()) { - Type result = processValues(values, magSf, weightField); + Type result = processValues(values, magSf); if (valueOutput_) { From 0463b16608cf3f216a7ffe9d82740afd743c327b Mon Sep 17 00:00:00 2001 From: sergio Date: Thu, 2 Feb 2012 10:20:33 +0000 Subject: [PATCH 2/8] ENH: nutAtmRoughWallFunction for atm boundary layer following the U profile described on atmVelocityinlet BC --- .../incompressible/RAS/Make/files | 1 + ...tkAtmRoughWallFunctionFvPatchScalarField.C | 220 ++++++++++++++++++ ...tkAtmRoughWallFunctionFvPatchScalarField.H | 198 ++++++++++++++++ 3 files changed, 419 insertions(+) create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.H diff --git a/src/turbulenceModels/incompressible/RAS/Make/files b/src/turbulenceModels/incompressible/RAS/Make/files index e28a685903..d667a8b26e 100644 --- a/src/turbulenceModels/incompressible/RAS/Make/files +++ b/src/turbulenceModels/incompressible/RAS/Make/files @@ -29,6 +29,7 @@ $(nutWallFunctions)/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScal $(nutWallFunctions)/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C $(nutWallFunctions)/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C $(nutWallFunctions)/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C +$(nutWallFunctions)/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C epsilonWallFunctions = $(wallFunctions)/epsilonWallFunctions $(epsilonWallFunctions)/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C new file mode 100644 index 0000000000..2ec45c7f60 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C @@ -0,0 +1,220 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "nutkAtmRoughWallFunctionFvPatchScalarField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + + +tmp nutkAtmRoughWallFunctionFvPatchScalarField::calcNut() const +{ + const label patchI = patch().index(); + + const RASModel& rasModel = db().lookupObject("RASProperties"); + const scalarField& y = rasModel.y()[patchI]; + const tmp tk = rasModel.k(); + const volScalarField& k = tk(); + const tmp tnu = rasModel.nu(); + const volScalarField& nu = tnu(); + const scalarField& nuw = nu.boundaryField()[patchI]; + + const scalar Cmu25 = pow025(Cmu_); + + tmp tnutw(new scalarField(*this)); + scalarField& nutw = tnutw(); + + forAll(nutw, faceI) + { + label faceCellI = patch().faceCells()[faceI]; + + scalar uStar = Cmu25*sqrt(k[faceCellI]); + scalar yPlus = uStar*y[faceI]/nuw[faceI]; + + scalar Edash = (y[faceI] + z0_[faceI] - zGround_[faceI])/z0_[faceI]; + + scalar limitingNutw = max(nutw[faceI], nuw[faceI]); + + // To avoid oscillations limit the change in the wall viscosity + // which is particularly important if it temporarily becomes zero + nutw[faceI] = + max + ( + min + ( + nuw[faceI] + *(yPlus*kappa_/log(max(Edash, 1+1e-4)) - 1), + 2*limitingNutw + ), 0.5*limitingNutw + ); + + if (debug) + { + Info<< "yPlus = " << yPlus + << ", Edash = " << Edash + << ", nutw = " << nutw[faceI] + << endl; + } + } + + return tnutw; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +nutkAtmRoughWallFunctionFvPatchScalarField:: +nutkAtmRoughWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF +) +: + nutkWallFunctionFvPatchScalarField(p, iF), + z0_(p.size(), 0.0), + zGround_(p.size(), 0.0) +{} + + +nutkAtmRoughWallFunctionFvPatchScalarField:: +nutkAtmRoughWallFunctionFvPatchScalarField +( + const nutkAtmRoughWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + nutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper), + z0_(ptf.z0_, mapper), + zGround_(ptf.zGround_, mapper) +{} + + +nutkAtmRoughWallFunctionFvPatchScalarField:: +nutkAtmRoughWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + nutkWallFunctionFvPatchScalarField(p, iF, dict), + z0_("z0", dict, p.size()), + zGround_("zGround", dict, p.size()) +{} + + +nutkAtmRoughWallFunctionFvPatchScalarField:: +nutkAtmRoughWallFunctionFvPatchScalarField +( + const nutkAtmRoughWallFunctionFvPatchScalarField& rwfpsf +) +: + nutkWallFunctionFvPatchScalarField(rwfpsf), + z0_(rwfpsf.z0_), + zGround_(rwfpsf.zGround_) +{} + + +nutkAtmRoughWallFunctionFvPatchScalarField:: +nutkAtmRoughWallFunctionFvPatchScalarField +( + const nutkAtmRoughWallFunctionFvPatchScalarField& rwfpsf, + const DimensionedField& iF +) +: + nutkWallFunctionFvPatchScalarField(rwfpsf, iF), + z0_(rwfpsf.z0_), + zGround_(rwfpsf.zGround_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void nutkAtmRoughWallFunctionFvPatchScalarField::autoMap +( + const fvPatchFieldMapper& m +) +{ + nutkWallFunctionFvPatchScalarField::autoMap(m); + z0_.autoMap(m); + zGround_.autoMap(m); +} + + +void nutkAtmRoughWallFunctionFvPatchScalarField::rmap +( + const fvPatchScalarField& ptf, + const labelList& addr +) +{ + nutkWallFunctionFvPatchScalarField::rmap(ptf, addr); + + const nutkAtmRoughWallFunctionFvPatchScalarField& nrwfpsf = + refCast(ptf); + + z0_.rmap(nrwfpsf.z0_, addr); + zGround_.rmap(nrwfpsf.zGround_, addr); +} + + +void nutkAtmRoughWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fvPatchField::write(os); + writeLocalEntries(os); + z0_.writeEntry("z0", os); + zGround_.writeEntry("zGround", os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + nutkAtmRoughWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.H new file mode 100644 index 0000000000..803985ced7 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.H @@ -0,0 +1,198 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::incompressible::RASModels:: + nutkAtmRoughWallFunctionFvPatchScalarField + +Description + Boundary condition for turbulent (kinematic) viscosity for atmospheric + velocity profiles. + Desinged to be used togheter with atmBoundaryLayerInletVelocity. + It follows U = (Ustar/K) ln((z - zGround + z0)/z0) + + where: + + Ustar is the frictional velocity + K is karman's constant + z0 is the surface roughness lenght + z is the verical coordinate + zGround is the minumum coordinate value in z direction. + + +SourceFiles + nutkAtmRoughWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef nutkAtmRoughWallFunctionFvPatchScalarField_H +#define nutkAtmRoughWallFunctionFvPatchScalarField_H + +#include "nutkWallFunctionFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class nutkAtmRoughWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class nutkAtmRoughWallFunctionFvPatchScalarField +: + public nutkWallFunctionFvPatchScalarField +{ +protected: + + // Protected data + + //- Surface roughness lenght + scalarField z0_; + + //- Minimum corrdinate value in z direction + scalarField zGround_; + + + // Protected Member Functions + + + //- Calculate the turbulence viscosity + virtual tmp calcNut() const; + + +public: + + //- Runtime type information + TypeName("nutkAtmRoughWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + nutkAtmRoughWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + nutkAtmRoughWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given + // nutkAtmRoughWallFunctionFvPatchScalarField + // onto a new patch + nutkAtmRoughWallFunctionFvPatchScalarField + ( + const nutkAtmRoughWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + nutkAtmRoughWallFunctionFvPatchScalarField + ( + const nutkAtmRoughWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp clone() const + { + return tmp + ( + new nutkAtmRoughWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + nutkAtmRoughWallFunctionFvPatchScalarField + ( + const nutkAtmRoughWallFunctionFvPatchScalarField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp clone + ( + const DimensionedField& iF + ) const + { + return tmp + ( + new nutkAtmRoughWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Acces functions + + // Return z0 + scalarField& z0() + { + return z0_; + } + + + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + virtual void autoMap(const fvPatchFieldMapper&); + + //- Reverse map the given fvPatchField onto this fvPatchField + virtual void rmap + ( + const fvPatchScalarField&, + const labelList& + ); + + + // I-O + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From 5eca8bd935af8c393da377217a54476ac89bc4b7 Mon Sep 17 00:00:00 2001 From: sergio Date: Thu, 2 Feb 2012 15:17:50 +0000 Subject: [PATCH 3/8] ENH: actuation disk modifications and rough Wall function for atm inlet --- .../actuationDiskSource/actuationDiskSource.C | 12 ++++++- .../actuationDiskSource/actuationDiskSource.H | 7 ++++ .../actuationDiskSourceTemplates.C | 15 +++++--- .../radialActuationDiskSource.H | 1 + .../radialActuationDiskSourceTemplates.C | 22 +++++++----- ...ndaryLayerInletEpsilonFvPatchScalarField.C | 21 ++++++++++-- ...ndaryLayerInletEpsilonFvPatchScalarField.H | 22 ++++++++++-- ...daryLayerInletVelocityFvPatchVectorField.C | 22 ++++++------ ...daryLayerInletVelocityFvPatchVectorField.H | 4 +-- ...tkAtmRoughWallFunctionFvPatchScalarField.C | 34 ++++--------------- ...tkAtmRoughWallFunctionFvPatchScalarField.H | 3 -- 11 files changed, 101 insertions(+), 62 deletions(-) diff --git a/src/fieldSources/basicSource/actuationDiskSource/actuationDiskSource.C b/src/fieldSources/basicSource/actuationDiskSource/actuationDiskSource.C index 68f0c2a5bf..878398220e 100644 --- a/src/fieldSources/basicSource/actuationDiskSource/actuationDiskSource.C +++ b/src/fieldSources/basicSource/actuationDiskSource/actuationDiskSource.C @@ -66,6 +66,12 @@ void Foam::actuationDiskSource::checkData() const << "disk direction vector is approximately zero" << exit(FatalIOError); } + if (returnReduce(upstreamCellId_, maxOp