From 0581a9d8842943f5a7447619ea019882b630ccc5 Mon Sep 17 00:00:00 2001 From: kuti Date: Sun, 26 May 2019 21:38:00 +0100 Subject: [PATCH 01/11] ENH: new forceCoeffs functionObject output - additional coefficients: - Side force coefficient: direction in curl(lift,drag), - Yaw moment coefficient: rotation axis in dir(lift) - Roll moment coefficient: rotation axis in dir(drag) Order of output - forces(drag,side,lift) - moments(roll,pitch,yaw) Note - For force coeffs, front and rear axles' contributions are computed --- .../forces/forceCoeffs/forceCoeffs.C | 215 +++++++++++++----- .../forces/forceCoeffs/forceCoeffs.H | 99 +++++--- 2 files changed, 219 insertions(+), 95 deletions(-) diff --git a/src/functionObjects/forces/forceCoeffs/forceCoeffs.C b/src/functionObjects/forces/forceCoeffs/forceCoeffs.C index be744320a7..71c142e3b8 100644 --- a/src/functionObjects/forces/forceCoeffs/forceCoeffs.C +++ b/src/functionObjects/forces/forceCoeffs/forceCoeffs.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015-2017 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2015-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -42,12 +42,37 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(forceCoeffs, 0); - addToRunTimeSelectionTable(functionObject, forceCoeffs, dictionary); } } +// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * // + +namespace Foam +{ + // Read vector and normalise if present, or set default + inline vector readVectorOrDefault + ( + const dictionary& dict, + const word& key, + const vector::components axis + ) + { + vector vec(Zero); // Zero initialise! + + if (dict.readIfPresent(key, vec)) + { + return normalised(vec); + } + + vec[axis] = 1; + return vec; + } + +} // End namespace Foam + + // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // void Foam::functionObjects::forceCoeffs::createFiles() @@ -61,12 +86,18 @@ void Foam::functionObjects::forceCoeffs::createFiles() if (nBin_ > 1) { - CmBinFilePtr_ = createFile("CmBin"); - writeBinHeader("Moment coefficient bins", CmBinFilePtr_()); CdBinFilePtr_ = createFile("CdBin"); writeBinHeader("Drag coefficient bins", CdBinFilePtr_()); + CsBinFilePtr_ = createFile("CsBin"); + writeBinHeader("Side coefficient bins", CsBinFilePtr_()); ClBinFilePtr_ = createFile("ClBin"); writeBinHeader("Lift coefficient bins", ClBinFilePtr_()); + CmRollBinFilePtr_ = createFile("CmRollBin"); + writeBinHeader("Roll moment coefficient bins", CmRollBinFilePtr_()); + CmPitchBinFilePtr_ = createFile("CmPitchBin"); + writeBinHeader("Moment coefficient bins", CmPitchBinFilePtr_()); + CmYawBinFilePtr_ = createFile("CmYawBin"); + writeBinHeader("Yaw moment coefficient bins", CmYawBinFilePtr_()); } } } @@ -79,18 +110,28 @@ void Foam::functionObjects::forceCoeffs::writeIntegratedHeader ) const { writeHeader(os, "Force coefficients"); - writeHeaderValue(os, "liftDir", liftDir_); writeHeaderValue(os, "dragDir", dragDir_); + writeHeaderValue(os, "sideDir", sideDir_); + writeHeaderValue(os, "liftDir", liftDir_); + writeHeaderValue(os, "rollAxis", rollAxis_); writeHeaderValue(os, "pitchAxis", pitchAxis_); + writeHeaderValue(os, "yawAxis", yawAxis_); writeHeaderValue(os, "magUInf", magUInf_); writeHeaderValue(os, "lRef", lRef_); writeHeaderValue(os, "Aref", Aref_); writeHeaderValue(os, "CofR", coordSys_.origin()); writeHeader(os, ""); writeCommented(os, "Time"); - writeTabbed(os, "Cm"); writeTabbed(os, "Cd"); + writeTabbed(os, "Cs"); writeTabbed(os, "Cl"); + writeTabbed(os, "CmRoll"); + writeTabbed(os, "CmPitch"); + writeTabbed(os, "CmYaw"); + writeTabbed(os, "Cd(f)"); + writeTabbed(os, "Cd(r)"); + writeTabbed(os, "Cs(f)"); + writeTabbed(os, "Cs(r)"); writeTabbed(os, "Cl(f)"); writeTabbed(os, "Cl(r)"); os << endl; @@ -114,30 +155,30 @@ void Foam::functionObjects::forceCoeffs::writeBinHeader forAll(binPoints, pointi) { binPoints[pointi] = (binMin_ + (pointi + 1)*binDx_)*binDir_; - os << tab << binPoints[pointi].x(); + os << tab << binPoints[pointi].x(); } - os << nl; + os << nl; writeCommented(os, "y co-ords :"); forAll(binPoints, pointi) { - os << tab << binPoints[pointi].y(); + os << tab << binPoints[pointi].y(); } - os << nl; + os << nl; writeCommented(os, "z co-ords :"); forAll(binPoints, pointi) { - os << tab << binPoints[pointi].z(); + os << tab << binPoints[pointi].z(); } - os << nl; + os << nl; writeHeader(os, ""); writeCommented(os, "Time"); - for (label j = 0; j < nBin_; j++) + for (label j = 0; j < nBin_; ++j) { - word jn(Foam::name(j) + ':'); + const word jn(Foam::name(j) + ':'); writeTabbed(os, jn + "total"); writeTabbed(os, jn + "pressure"); writeTabbed(os, jn + "viscous"); @@ -163,13 +204,13 @@ void Foam::functionObjects::forceCoeffs::writeIntegratedData return; } - scalar pressure = sum(coeff[0]); - scalar viscous = sum(coeff[1]); - scalar porous = sum(coeff[2]); - scalar total = pressure + viscous + porous; + const scalar pressure = sum(coeff[0]); + const scalar viscous = sum(coeff[1]); + const scalar porous = sum(coeff[2]); + const scalar total = pressure + viscous + porous; Info<< " " << title << " : " << total << token::TAB - << "(" + << '(' << "pressure: " << pressure << token::TAB << "viscous: " << viscous; @@ -178,7 +219,7 @@ void Foam::functionObjects::forceCoeffs::writeIntegratedData Info<< token::TAB << "porous: " << porous; } - Info<< ")" << endl; + Info<< ')' << endl; } @@ -190,7 +231,7 @@ void Foam::functionObjects::forceCoeffs::writeBinData { writeTime(os); - for (label bini = 0; bini < nBin_; bini++) + for (label bini = 0; bini < nBin_; ++bini) { scalar total = coeffs[0][bini] + coeffs[1][bini] + coeffs[2][bini]; @@ -216,45 +257,49 @@ Foam::functionObjects::forceCoeffs::forceCoeffs ) : forces(name, runTime, dict), - liftDir_(Zero), dragDir_(Zero), + sideDir_(Zero), + liftDir_(Zero), + rollAxis_(Zero), pitchAxis_(Zero), - magUInf_(0.0), - lRef_(0.0), - Aref_(0.0), + yawAxis_(Zero), + magUInf_(Zero), + lRef_(Zero), + Aref_(Zero), coeffFilePtr_(), - CmBinFilePtr_(), CdBinFilePtr_(), - ClBinFilePtr_() + CsBinFilePtr_(), + ClBinFilePtr_(), + CmRollBinFilePtr_(), + CmPitchBinFilePtr_(), + CmYawBinFilePtr_() { read(dict); Info<< endl; } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::forceCoeffs::~forceCoeffs() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::forceCoeffs::read(const dictionary& dict) { forces::read(dict); - // Directions for lift and drag forces, and pitch moment - dict.readEntry("liftDir", liftDir_); - dict.readEntry("dragDir", dragDir_); - dict.readEntry("pitchAxis", pitchAxis_); + // Standard (default) definitions + dragDir_ = readVectorOrDefault(dict, "dragDir", vector::X); + sideDir_ = readVectorOrDefault(dict, "sideDir", vector::Y); + liftDir_ = readVectorOrDefault(dict, "liftDir", vector::Z); + rollAxis_ = readVectorOrDefault(dict, "rollAxis", vector::X); + pitchAxis_ = readVectorOrDefault(dict, "pitchAxis", vector::Y); + yawAxis_ = readVectorOrDefault(dict, "yawAxis", vector::Z); + // Free stream velocity magnitude dict.readEntry("magUInf", magUInf_); // If case is compressible we must read rhoInf (store in rhoRef_) to // calculate the reference dynamic pressure - // - note: for incompressible, rhoRef_ is already initialised + // Note: for incompressible, rhoRef_ is already initialised if (rhoName_ != "rhoInf") { dict.readEntry("rhoInf", rhoRef_); @@ -315,55 +360,90 @@ bool Foam::functionObjects::forceCoeffs::execute() createFiles(); - scalar pDyn = 0.5*rhoRef_*magUInf_*magUInf_; - // Storage for pressure, viscous and porous contributions to coeffs - List> momentCoeffs(3); List> dragCoeffs(3); + List> sideCoeffs(3); List> liftCoeffs(3); + List> rollMomentCoeffs(3); + List> pitchMomentCoeffs(3); + List> yawMomentCoeffs(3); + forAll(liftCoeffs, i) { - momentCoeffs[i].setSize(nBin_); dragCoeffs[i].setSize(nBin_); + sideCoeffs[i].setSize(nBin_); liftCoeffs[i].setSize(nBin_); + rollMomentCoeffs[i].setSize(nBin_); + pitchMomentCoeffs[i].setSize(nBin_); + yawMomentCoeffs[i].setSize(nBin_); } // Calculate coefficients - scalar CmTot = 0; scalar CdTot = 0; + scalar CsTot = 0; scalar ClTot = 0; + scalar CmRollTot = 0; + scalar CmPitchTot = 0; + scalar CmYawTot = 0; + + const scalar pDyn = 0.5*rhoRef_*sqr(magUInf_); + // Avoid divide by zero in 2D cases + const scalar momentScaling = 1.0/(Aref_*pDyn*lRef_ + SMALL); + const scalar forceScaling = 1.0/(Aref_*pDyn + SMALL); + forAll(liftCoeffs, i) { - momentCoeffs[i] = (moment_[i] & pitchAxis_)/(Aref_*pDyn*lRef_); - dragCoeffs[i] = (force_[i] & dragDir_)/(Aref_*pDyn); - liftCoeffs[i] = (force_[i] & liftDir_)/(Aref_*pDyn); + dragCoeffs[i] = forceScaling*(force_[i] & dragDir_); + sideCoeffs[i] = forceScaling*(force_[i] & sideDir_); + liftCoeffs[i] = forceScaling*(force_[i] & liftDir_); + rollMomentCoeffs[i] = momentScaling*(moment_[i] & rollAxis_); + pitchMomentCoeffs[i] = momentScaling*(moment_[i] & pitchAxis_); + yawMomentCoeffs[i] = momentScaling*(moment_[i] & yawAxis_); - CmTot += sum(momentCoeffs[i]); CdTot += sum(dragCoeffs[i]); + CsTot += sum(sideCoeffs[i]); ClTot += sum(liftCoeffs[i]); + CmRollTot += sum(rollMomentCoeffs[i]); + CmPitchTot += sum(pitchMomentCoeffs[i]); + CmYawTot += sum(yawMomentCoeffs[i]); } - scalar ClfTot = ClTot/2.0 + CmTot; - scalar ClrTot = ClTot/2.0 - CmTot; + // Single contributions to the front and rear axles + const scalar CdfTot = 0.5*CdTot + CmRollTot; + const scalar CdrTot = 0.5*CdTot - CmRollTot; + const scalar CsfTot = 0.5*CsTot + CmYawTot; + const scalar CsrTot = 0.5*CsTot - CmYawTot; + const scalar ClfTot = 0.5*ClTot + CmPitchTot; + const scalar ClrTot = 0.5*ClTot - CmPitchTot; Log << type() << " " << name() << " execute:" << nl << " Coefficients" << nl; - writeIntegratedData("Cm", momentCoeffs); writeIntegratedData("Cd", dragCoeffs); + writeIntegratedData("Cs", sideCoeffs); writeIntegratedData("Cl", liftCoeffs); + writeIntegratedData("CmRoll", rollMomentCoeffs); + writeIntegratedData("CmPitch", pitchMomentCoeffs); + writeIntegratedData("CmYaw", yawMomentCoeffs); + + Log << " Cd(f) : " << CdfTot << nl + << " Cd(r) : " << CdrTot << nl; + + Log << " Cs(f) : " << CsfTot << nl + << " Cs(r) : " << CsrTot << nl; Log << " Cl(f) : " << ClfTot << nl - << " Cl(r) : " << ClrTot << nl - << endl; + << " Cl(r) : " << ClrTot << nl; if (writeToFile()) { writeTime(coeffFilePtr_()); coeffFilePtr_() - << tab << CmTot << tab << CdTot - << tab << ClTot << tab << ClfTot << tab << ClrTot << endl; - + << tab << CdTot << tab << CsTot << tab << ClTot + << tab << CmRollTot << tab << CmPitchTot << tab << CmYawTot + << tab << CdfTot << tab << CdrTot + << tab << CsfTot << tab << CsrTot + << tab << ClfTot << tab << ClrTot << endl; if (nBin_ > 1) { @@ -371,26 +451,41 @@ bool Foam::functionObjects::forceCoeffs::execute() { forAll(liftCoeffs, i) { - for (label bini = 1; bini < nBin_; bini++) + for (label bini = 1; bini < nBin_; ++bini) { - liftCoeffs[i][bini] += liftCoeffs[i][bini-1]; dragCoeffs[i][bini] += dragCoeffs[i][bini-1]; - momentCoeffs[i][bini] += momentCoeffs[i][bini-1]; + sideCoeffs[i][bini] += sideCoeffs[i][bini-1]; + liftCoeffs[i][bini] += liftCoeffs[i][bini-1]; + rollMomentCoeffs[i][bini] += + rollMomentCoeffs[i][bini-1]; + pitchMomentCoeffs[i][bini] += + pitchMomentCoeffs[i][bini-1]; + yawMomentCoeffs[i][bini] += yawMomentCoeffs[i][bini-1]; } } } writeBinData(dragCoeffs, CdBinFilePtr_()); + writeBinData(sideCoeffs, CsBinFilePtr_()); writeBinData(liftCoeffs, ClBinFilePtr_()); - writeBinData(momentCoeffs, CmBinFilePtr_()); + writeBinData(rollMomentCoeffs, CmRollBinFilePtr_()); + writeBinData(pitchMomentCoeffs, CmPitchBinFilePtr_()); + writeBinData(yawMomentCoeffs, CmYawBinFilePtr_()); } } // Write state/results information { - setResult("Cm", CmTot); setResult("Cd", CdTot); + setResult("Cs", CsTot); setResult("Cl", ClTot); + setResult("CmRoll", CmRollTot); + setResult("CmPitch", CmPitchTot); + setResult("CmYaw", CmYawTot); + setResult("Cd(f)", CdfTot); + setResult("Cd(r)", CdrTot); + setResult("Cs(f)", CsfTot); + setResult("Cs(r)", CsrTot); setResult("Cl(f)", ClfTot); setResult("Cl(r)", ClrTot); } diff --git a/src/functionObjects/forces/forceCoeffs/forceCoeffs.H b/src/functionObjects/forces/forceCoeffs/forceCoeffs.H index d68b47f185..c82002f908 100644 --- a/src/functionObjects/forces/forceCoeffs/forceCoeffs.H +++ b/src/functionObjects/forces/forceCoeffs/forceCoeffs.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -30,9 +30,10 @@ Group grpForcesFunctionObjects Description - Extends the forces functionObject by providing lift, drag and moment - coefficients. The data can optionally be output into bins, defined in a - given direction. + Extends the forces functionObject by providing coefficients for: + - drag, side and lift forces + - roll, pitch and yaw moments + The data can optionally be output into bins, defined in a given direction. The binned data provides the total and consitituent components per bin: - total coefficient @@ -43,9 +44,12 @@ Description Data is written into multiple files in the postProcessing/\ directory: - coefficient.dat : integrated coefficients over all geometries - - CmBin.dat : moment coefficient bins - CdBin.dat : drag coefficient bins + - CsBin.dat : side coefficient bins - ClBin.dat : lift coefficient bins + - CmRollBin.dat : roll moment coefficient bins + - CmPitchBin.dat : pitch moment coefficient bins + - CmYawBin.dat : yaw moment coefficient bins Usage Example of function object specification: @@ -58,9 +62,12 @@ Usage log yes; writeFields yes; patches (walls); - liftDir (0 1 0); - dragDir (-1 0 0); - pitchAxis (0 0 1); + dragDir (1 0 0); + sideDir (0 1 0); + liftDir (0 0 1); + rollAxis (1 0 0); + pitchAxis (0 1 0); + yawAxis (0 0 1); magUInf 100; lRef 3.5; Aref 2.2; @@ -76,26 +83,29 @@ Usage Where the entries comprise: \table - Property | Description | Required | Default value - type | Type name: forceCoeffs | yes | - log | Write force data to standard output | no | no - writeFields | Write the force and moment coefficient fields | no | no + Property | Description | Required | Default + type | Type name: forceCoeffs | yes | + log | Write force data to standard output | no | no + writeFields | Write force,moment coefficient fields | no | no patches | Patches included in the forces calculation | yes | - liftDir | Lift direction | yes | - dragDir | Drag direction | yes | - pitchAxis | Picth axis | yes | - magUInf | Free stream velocity magnitude | yes | + dragDir | Drag direction | no | (1 0 0) + sideDir | Side force direction | no | (0 1 0) + liftDir | Lift direction | no | (0 0 1) + rollAxis | Roll axis | no | (1 0 0) + pitchAxis | Pitch axis | no | (0 1 0) + yawAxis | Yaw axis | no | (0 0 1) + magUInf | Free stream velocity magnitude | yes | lRef | Reference length scale for moment calculations | yes | - Aref | Reference area | yes | - porosity | Flag to include porosity contributions | no | no + Aref | Reference area | yes | + porosity | Include porosity contributions | no | false \endtable Bin data is optional, but if the dictionary is present, the entries must - be defined according o + be defined according to following: \table - nBin | number of data bins | yes | - direction | direction along which bins are defined | yes | - cumulative | bin data accumulated with incresing distance | yes | + nBin | Number of data bins | yes | + direction | Direction along which bins are defined | yes | + cumulative | Bin data accumulated with incresing distance | yes | \endtable See also @@ -130,30 +140,39 @@ class forceCoeffs { // Private data - // Force coefficient geometry + // Force coefficient geometry in global Cartesian coordinate system - //- Lift + //- Drag force direction + vector dragDir_; + + //- Side force direction + vector sideDir_; + + //- Lift force direction vector liftDir_; - //- Drag - vector dragDir_; + //- Roll axis direction + vector rollAxis_; - //- Pitch + //- Pitch axis direction vector pitchAxis_; + //- Yaw axis direction + vector yawAxis_; + // Free-stream conditions - //- Velocity magnitude + //- Free-stream velocity magnitude scalar magUInf_; // Reference scales - //- Length + //- Reference length [m] scalar lRef_; - //- Area + //- Reference area [m^2] scalar Aref_; @@ -162,15 +181,24 @@ class forceCoeffs //- Integrated coefficients autoPtr coeffFilePtr_; - //- Moment coefficient - autoPtr CmBinFilePtr_; - //- Drag coefficient autoPtr CdBinFilePtr_; + //- Side coefficient + autoPtr CsBinFilePtr_; + //- Lift coefficient autoPtr ClBinFilePtr_; + //- Roll moment coefficient + autoPtr CmRollBinFilePtr_; + + //- Pitch moment coefficient + autoPtr CmPitchBinFilePtr_; + + //- Yaw moment coefficient + autoPtr CmYawBinFilePtr_; + // Private Member Functions @@ -223,7 +251,7 @@ public: //- Destructor - virtual ~forceCoeffs(); + virtual ~forceCoeffs() = default; // Member Functions @@ -231,7 +259,7 @@ public: //- Read the forces data virtual bool read(const dictionary&); - //- Execute, currently does nothing + //- Execute virtual bool execute(); //- Write the forces @@ -249,3 +277,4 @@ public: #endif // ************************************************************************* // + From 65f3faa2033f12363c3079bb8558743420c5f80f Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Tue, 11 Jun 2019 11:57:22 +0100 Subject: [PATCH 02/11] WIP: Refactored forces/Coeffs to always use a co-ord system and simplified inputs [UNCHECKED] --- .../forces/forceCoeffs/forceCoeffs.C | 77 +++------ .../forces/forceCoeffs/forceCoeffs.H | 35 +--- src/functionObjects/forces/forces/forces.C | 156 +++++++----------- src/functionObjects/forces/forces/forces.H | 23 +-- 4 files changed, 100 insertions(+), 191 deletions(-) diff --git a/src/functionObjects/forces/forceCoeffs/forceCoeffs.C b/src/functionObjects/forces/forceCoeffs/forceCoeffs.C index 71c142e3b8..7317a9290e 100644 --- a/src/functionObjects/forces/forceCoeffs/forceCoeffs.C +++ b/src/functionObjects/forces/forceCoeffs/forceCoeffs.C @@ -47,32 +47,6 @@ namespace functionObjects } -// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * // - -namespace Foam -{ - // Read vector and normalise if present, or set default - inline vector readVectorOrDefault - ( - const dictionary& dict, - const word& key, - const vector::components axis - ) - { - vector vec(Zero); // Zero initialise! - - if (dict.readIfPresent(key, vec)) - { - return normalised(vec); - } - - vec[axis] = 1; - return vec; - } - -} // End namespace Foam - - // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // void Foam::functionObjects::forceCoeffs::createFiles() @@ -88,14 +62,19 @@ void Foam::functionObjects::forceCoeffs::createFiles() { CdBinFilePtr_ = createFile("CdBin"); writeBinHeader("Drag coefficient bins", CdBinFilePtr_()); + CsBinFilePtr_ = createFile("CsBin"); writeBinHeader("Side coefficient bins", CsBinFilePtr_()); + ClBinFilePtr_ = createFile("ClBin"); writeBinHeader("Lift coefficient bins", ClBinFilePtr_()); + CmRollBinFilePtr_ = createFile("CmRollBin"); writeBinHeader("Roll moment coefficient bins", CmRollBinFilePtr_()); + CmPitchBinFilePtr_ = createFile("CmPitchBin"); writeBinHeader("Moment coefficient bins", CmPitchBinFilePtr_()); + CmYawBinFilePtr_ = createFile("CmYawBin"); writeBinHeader("Yaw moment coefficient bins", CmYawBinFilePtr_()); } @@ -110,12 +89,12 @@ void Foam::functionObjects::forceCoeffs::writeIntegratedHeader ) const { writeHeader(os, "Force coefficients"); - writeHeaderValue(os, "dragDir", dragDir_); - writeHeaderValue(os, "sideDir", sideDir_); - writeHeaderValue(os, "liftDir", liftDir_); - writeHeaderValue(os, "rollAxis", rollAxis_); - writeHeaderValue(os, "pitchAxis", pitchAxis_); - writeHeaderValue(os, "yawAxis", yawAxis_); + writeHeaderValue(os, "dragDir", coordSys_.e1()); + writeHeaderValue(os, "sideDir", coordSys_.e2()); + writeHeaderValue(os, "liftDir", coordSys_.e3()); + writeHeaderValue(os, "rollAxis", coordSys_.e1()); + writeHeaderValue(os, "pitchAxis", coordSys_.e2()); + writeHeaderValue(os, "yawAxis", coordSys_.e3()); writeHeaderValue(os, "magUInf", magUInf_); writeHeaderValue(os, "lRef", lRef_); writeHeaderValue(os, "Aref", Aref_); @@ -257,12 +236,6 @@ Foam::functionObjects::forceCoeffs::forceCoeffs ) : forces(name, runTime, dict), - dragDir_(Zero), - sideDir_(Zero), - liftDir_(Zero), - rollAxis_(Zero), - pitchAxis_(Zero), - yawAxis_(Zero), magUInf_(Zero), lRef_(Zero), Aref_(Zero), @@ -275,6 +248,7 @@ Foam::functionObjects::forceCoeffs::forceCoeffs CmYawBinFilePtr_() { read(dict); + setCoordinateSystem(dict, "liftDir", "dragDir"); Info<< endl; } @@ -285,15 +259,6 @@ bool Foam::functionObjects::forceCoeffs::read(const dictionary& dict) { forces::read(dict); - // Standard (default) definitions - dragDir_ = readVectorOrDefault(dict, "dragDir", vector::X); - sideDir_ = readVectorOrDefault(dict, "sideDir", vector::Y); - liftDir_ = readVectorOrDefault(dict, "liftDir", vector::Z); - rollAxis_ = readVectorOrDefault(dict, "rollAxis", vector::X); - pitchAxis_ = readVectorOrDefault(dict, "pitchAxis", vector::Y); - yawAxis_ = readVectorOrDefault(dict, "yawAxis", vector::Z); - - // Free stream velocity magnitude dict.readEntry("magUInf", magUInf_); @@ -387,18 +352,22 @@ bool Foam::functionObjects::forceCoeffs::execute() scalar CmYawTot = 0; const scalar pDyn = 0.5*rhoRef_*sqr(magUInf_); + // Avoid divide by zero in 2D cases const scalar momentScaling = 1.0/(Aref_*pDyn*lRef_ + SMALL); const scalar forceScaling = 1.0/(Aref_*pDyn + SMALL); forAll(liftCoeffs, i) { - dragCoeffs[i] = forceScaling*(force_[i] & dragDir_); - sideCoeffs[i] = forceScaling*(force_[i] & sideDir_); - liftCoeffs[i] = forceScaling*(force_[i] & liftDir_); - rollMomentCoeffs[i] = momentScaling*(moment_[i] & rollAxis_); - pitchMomentCoeffs[i] = momentScaling*(moment_[i] & pitchAxis_); - yawMomentCoeffs[i] = momentScaling*(moment_[i] & yawAxis_); + const Field localForce(coordSys_.localVector(force_[i])); + const Field localMoment(coordSys_.localVector(moment_[i])); + + dragCoeffs[i] = forceScaling*(localForce.component(0)); + sideCoeffs[i] = forceScaling*(localForce.component(1)); + liftCoeffs[i] = forceScaling*(localForce.component(2)); + rollMomentCoeffs[i] = momentScaling*(localMoment.component(0)); + pitchMomentCoeffs[i] = momentScaling*(localMoment.component(1)); + yawMomentCoeffs[i] = momentScaling*(localMoment.component(2)); CdTot += sum(dragCoeffs[i]); CsTot += sum(sideCoeffs[i]); @@ -408,7 +377,7 @@ bool Foam::functionObjects::forceCoeffs::execute() CmYawTot += sum(yawMomentCoeffs[i]); } - // Single contributions to the front and rear axles + // Single contributions to the front and rear const scalar CdfTot = 0.5*CdTot + CmRollTot; const scalar CdrTot = 0.5*CdTot - CmRollTot; const scalar CsfTot = 0.5*CsTot + CmYawTot; diff --git a/src/functionObjects/forces/forceCoeffs/forceCoeffs.H b/src/functionObjects/forces/forceCoeffs/forceCoeffs.H index c82002f908..e84f497542 100644 --- a/src/functionObjects/forces/forceCoeffs/forceCoeffs.H +++ b/src/functionObjects/forces/forceCoeffs/forceCoeffs.H @@ -62,12 +62,14 @@ Usage log yes; writeFields yes; patches (walls); - dragDir (1 0 0); - sideDir (0 1 0); - liftDir (0 0 1); - rollAxis (1 0 0); - pitchAxis (0 1 0); - yawAxis (0 0 1); + + coordinateSystem + { + type xxx; + dragDir (1 0 0); + liftDir (0 0 1); + } + magUInf 100; lRef 3.5; Aref 2.2; @@ -140,27 +142,6 @@ class forceCoeffs { // Private data - // Force coefficient geometry in global Cartesian coordinate system - - //- Drag force direction - vector dragDir_; - - //- Side force direction - vector sideDir_; - - //- Lift force direction - vector liftDir_; - - //- Roll axis direction - vector rollAxis_; - - //- Pitch axis direction - vector pitchAxis_; - - //- Yaw axis direction - vector yawAxis_; - - // Free-stream conditions //- Free-stream velocity magnitude diff --git a/src/functionObjects/forces/forces/forces.C b/src/functionObjects/forces/forces/forces.C index 07586297ae..06a6e3ba5d 100644 --- a/src/functionObjects/forces/forces/forces.C +++ b/src/functionObjects/forces/forces/forces.C @@ -71,22 +71,6 @@ void Foam::functionObjects::forces::createFiles() momentBinFilePtr_ = createFile("momentBin"); writeBinHeader("Moment", momentBinFilePtr_()); } - - if (localSystem_) - { - localForceFilePtr_ = createFile("localForce"); - writeIntegratedHeader("Force", localForceFilePtr_()); - localMomentFilePtr_ = createFile("localMoment"); - writeIntegratedHeader("Moment", localMomentFilePtr_()); - - if (nBin_ > 1) - { - localForceBinFilePtr_ = createFile("localForceBin"); - writeBinHeader("Force", localForceBinFilePtr_()); - localMomentBinFilePtr_ = createFile("localMomentBin"); - writeBinHeader("Moment", localMomentBinFilePtr_()); - } - } } } @@ -169,6 +153,49 @@ void Foam::functionObjects::forces::writeBinHeader } +void Foam::functionObjects::forces::setCoordinateSystem +( + const dictionary& dict, + const word& e3Name, + const word& e1Name +) +{ + coordSys_.clear(); + + if (dict.readIfPresent("CofR", coordSys_.origin())) + { + const vector e3 = e3Name == word::null ? + vector(0, 0, 1) : dict.get(e3Name); + const vector e1 = e1Name == word::null ? + vector(1, 0, 0) : dict.get(e1Name); + + coordSys_ = + coordSystem::cartesian(coordSys_.origin(), e3, e1); + } + else + { + // The 'coordinateSystem' sub-dictionary is optional, + // but enforce use of a cartesian system if not found. + + if (dict.found(coordinateSystem::typeName_())) + { + // New() for access to indirect (global) coordinate system + coordSys_ = + coordinateSystem::New + ( + obr_, + dict, + coordinateSystem::typeName_() + ); + } + else + { + coordSys_ = coordSystem::cartesian(dict); + } + } + +} + void Foam::functionObjects::forces::initialise() { @@ -586,42 +613,21 @@ void Foam::functionObjects::forces::writeForces() writeIntegratedForceMoment ( "forces", - force_[0], - force_[1], - force_[2], + coordSys_.localVector(force_[0]), + coordSys_.localVector(force_[1]), + coordSys_.localVector(force_[2]), forceFilePtr_ ); writeIntegratedForceMoment ( "moments", - moment_[0], - moment_[1], - moment_[2], + coordSys_.localVector(moment_[0]), + coordSys_.localVector(moment_[1]), + coordSys_.localVector(moment_[2]), momentFilePtr_ ); - if (localSystem_) - { - writeIntegratedForceMoment - ( - "local forces", - coordSys_.localVector(force_[0]), - coordSys_.localVector(force_[1]), - coordSys_.localVector(force_[2]), - localForceFilePtr_ - ); - - writeIntegratedForceMoment - ( - "local moments", - coordSys_.localVector(moment_[0]), - coordSys_.localVector(moment_[1]), - coordSys_.localVector(moment_[2]), - localMomentFilePtr_ - ); - } - Log << endl; } @@ -673,23 +679,17 @@ void Foam::functionObjects::forces::writeBinnedForceMoment void Foam::functionObjects::forces::writeBins() { - writeBinnedForceMoment(force_, forceBinFilePtr_); - writeBinnedForceMoment(moment_, momentBinFilePtr_); + List> lf(3); + List> lm(3); + lf[0] = coordSys_.localVector(force_[0]); + lf[1] = coordSys_.localVector(force_[1]); + lf[2] = coordSys_.localVector(force_[2]); + lm[0] = coordSys_.localVector(moment_[0]); + lm[1] = coordSys_.localVector(moment_[1]); + lm[2] = coordSys_.localVector(moment_[2]); - if (localSystem_) - { - List> lf(3); - List> lm(3); - lf[0] = coordSys_.localVector(force_[0]); - lf[1] = coordSys_.localVector(force_[1]); - lf[2] = coordSys_.localVector(force_[2]); - lm[0] = coordSys_.localVector(moment_[0]); - lm[1] = coordSys_.localVector(moment_[1]); - lm[2] = coordSys_.localVector(moment_[2]); - - writeBinnedForceMoment(lf, localForceBinFilePtr_); - writeBinnedForceMoment(lm, localMomentBinFilePtr_); - } + writeBinnedForceMoment(lf, forceBinFilePtr_); + writeBinnedForceMoment(lm, momentBinFilePtr_); } @@ -711,10 +711,6 @@ Foam::functionObjects::forces::forces momentFilePtr_(), forceBinFilePtr_(), momentBinFilePtr_(), - localForceFilePtr_(), - localMomentFilePtr_(), - localForceBinFilePtr_(), - localMomentBinFilePtr_(), patchSet_(), pName_(word::null), UName_(word::null), @@ -724,7 +720,6 @@ Foam::functionObjects::forces::forces rhoRef_(VGREAT), pRef_(0), coordSys_(), - localSystem_(false), porosity_(false), nBin_(1), binDir_(Zero), @@ -738,6 +733,7 @@ Foam::functionObjects::forces::forces if (readFields) { read(dict); + setCoordinateSystem(dict); Log << endl; } } @@ -759,10 +755,6 @@ Foam::functionObjects::forces::forces momentFilePtr_(), forceBinFilePtr_(), momentBinFilePtr_(), - localForceFilePtr_(), - localMomentFilePtr_(), - localForceBinFilePtr_(), - localMomentBinFilePtr_(), patchSet_(), pName_(word::null), UName_(word::null), @@ -772,7 +764,6 @@ Foam::functionObjects::forces::forces rhoRef_(VGREAT), pRef_(0), coordSys_(), - localSystem_(false), porosity_(false), nBin_(1), binDir_(Zero), @@ -786,6 +777,7 @@ Foam::functionObjects::forces::forces if (readFields) { read(dict); + setCoordinateSystem(dict); Log << endl; } @@ -843,32 +835,6 @@ bool Foam::functionObjects::forces::read(const dictionary& dict) Info<< " Reference pressure (pRef) set to " << pRef_ << endl; } - coordSys_.clear(); - localSystem_ = false; - - // Centre of rotation for moment calculations - // specified directly, from coordinate system, or implicitly (0 0 0) - if (!dict.readIfPresent("CofR", coordSys_.origin())) - { - // The 'coordinateSystem' sub-dictionary is optional, - // but enforce use of a cartesian system. - - if (dict.found(coordinateSystem::typeName_())) - { - // New() for access to indirect (global) coordinate system - coordSys_ = - coordinateSystem::New - ( - obr_, dict, coordinateSystem::typeName_() - ); - } - else - { - coordSys_ = coordSystem::cartesian(dict); - } - - localSystem_ = true; - } dict.readIfPresent("porosity", porosity_); if (porosity_) diff --git a/src/functionObjects/forces/forces/forces.H b/src/functionObjects/forces/forces/forces.H index d3a197d81b..a24fea536d 100644 --- a/src/functionObjects/forces/forces/forces.H +++ b/src/functionObjects/forces/forces/forces.H @@ -192,18 +192,6 @@ protected: //- Moment bins autoPtr momentBinFilePtr_; - //- Local force - autoPtr localForceFilePtr_; - - //- Local moment - autoPtr localMomentFilePtr_; - - //- Local force bins - autoPtr localForceBinFilePtr_; - - //- Local moment bins - autoPtr localMomentBinFilePtr_; - // Read from dictionary @@ -234,9 +222,6 @@ protected: //- Coordinate system used when evaluting forces/moments coordSystem::cartesian coordSys_; - //- Flag to indicate whether we are using a local coordinates - bool localSystem_; - //- Flag to include porosity effects bool porosity_; @@ -283,6 +268,14 @@ protected: //- Write header for binned data void writeBinHeader(const word& header, Ostream& os) const; + //- Set the co-ordinate system from dictionary and axes names + void setCoordinateSystem + ( + const dictionary& dict, + const word& e3Name = word::null, + const word& e1Name = word::null + ); + //- Initialise the fields void initialise(); From a1f92568295be24eb405982fa66bc3fcbb3bbd7b Mon Sep 17 00:00:00 2001 From: Kutalmis Bercin Date: Tue, 11 Jun 2019 16:19:37 +0100 Subject: [PATCH 03/11] ENH: extend header documentation for forceCoeffs --- .../forces/forceCoeffs/forceCoeffs.H | 71 +++++++++++++++---- 1 file changed, 56 insertions(+), 15 deletions(-) diff --git a/src/functionObjects/forces/forceCoeffs/forceCoeffs.H b/src/functionObjects/forces/forceCoeffs/forceCoeffs.H index e84f497542..8427b18f4a 100644 --- a/src/functionObjects/forces/forceCoeffs/forceCoeffs.H +++ b/src/functionObjects/forces/forceCoeffs/forceCoeffs.H @@ -30,9 +30,17 @@ Group grpForcesFunctionObjects Description - Extends the forces functionObject by providing coefficients for: - - drag, side and lift forces - - roll, pitch and yaw moments + Extends the \c forces functionObject by providing coefficients for: + - drag, side and lift forces (Cd, Cs, and Cl) + - roll, pitch and yaw moments (CmRoll, CmPitch, and CmYaw) + - front and rear axle force contributions (C(f) and C(r)) wherein + + \verbatim + Cd(f/r) = 0.5*Cd \pm CmRoll + Cs(f/r) = 0.5*Cs \pm CmYaw + Cl(f/r) = 0.5*Cl \pm CmPitch + \endverbatim + The data can optionally be output into bins, defined in a given direction. The binned data provides the total and consitituent components per bin: @@ -63,16 +71,13 @@ Usage writeFields yes; patches (walls); - coordinateSystem - { - type xxx; - dragDir (1 0 0); - liftDir (0 0 1); - } + // input keywords for directions of force/moment coefficients + // refer below for options, and relations magUInf 100; lRef 3.5; Aref 2.2; + porosity no; binData { @@ -90,12 +95,6 @@ Usage log | Write force data to standard output | no | no writeFields | Write force,moment coefficient fields | no | no patches | Patches included in the forces calculation | yes | - dragDir | Drag direction | no | (1 0 0) - sideDir | Side force direction | no | (0 1 0) - liftDir | Lift direction | no | (0 0 1) - rollAxis | Roll axis | no | (1 0 0) - pitchAxis | Pitch axis | no | (0 1 0) - yawAxis | Yaw axis | no | (0 0 1) magUInf | Free stream velocity magnitude | yes | lRef | Reference length scale for moment calculations | yes | Aref | Reference area | yes | @@ -110,6 +109,48 @@ Usage cumulative | Bin data accumulated with incresing distance | yes | \endtable + Input of force/moment coefficient directions: + - require an origin, and two orthogonal directions; the remaining orthogonal + direction is determined accordingly. + - can be added by the three options below. + + \verbatim + CofR (0 0 0); // Centre of rotation + dragDir (1 0 0); + liftDir (0 0 1); + \endverbatim + + \verbatim + origin (0 0 0); + e1 (1 0 0); + e3 (0 0 1); // combinations: (e1, e2) or (e2, e3) or (e3, e1) + \endverbatim + + \verbatim + coordinateSystem + { + origin (0 0 0); + rotation + { + type axes; + e1 (1 0 0); + e3 (0 0 1); // combinations: (e1, e2) or (e2, e3) or (e3, e1) + } + } + \endverbatim + + The default direction relations are shown below: + + \table + Property | Description | Alias | Direction + dragDir | Drag direction | e1 | (1 0 0) + sideDir | Side force direction | e2 | (0 1 0) + liftDir | Lift direction | e3 | (0 0 1) + rollAxis | Roll axis | e1 | (1 0 0) + pitchAxis | Pitch axis | e2 | (0 1 0) + yawAxis | Yaw axis | e3 | (0 0 1) + \endtable + See also Foam::functionObject Foam::functionObjects::timeControl From beffb00612f786f04e07492fdb9c2faa10e2d950 Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Thu, 13 Jun 2019 12:08:16 +0100 Subject: [PATCH 04/11] TUT: Mangrive tutorial update --- .../mangroveInteraction/0.orig/MangrovesIndex | 29 +++ .../constant/triSurface/seaweed.stl | 171 +++++++++--------- 2 files changed, 115 insertions(+), 85 deletions(-) create mode 100644 tutorials/multiphase/interFoam/laminar/waves/mangroveInteraction/0.orig/MangrovesIndex diff --git a/tutorials/multiphase/interFoam/laminar/waves/mangroveInteraction/0.orig/MangrovesIndex b/tutorials/multiphase/interFoam/laminar/waves/mangroveInteraction/0.orig/MangrovesIndex new file mode 100644 index 0000000000..65cb3332aa --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/mangroveInteraction/0.orig/MangrovesIndex @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1812 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object MangrovesIndex; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + ".*" + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/mangroveInteraction/constant/triSurface/seaweed.stl b/tutorials/multiphase/interFoam/laminar/waves/mangroveInteraction/constant/triSurface/seaweed.stl index 4032531aaa..f548b62df2 100644 --- a/tutorials/multiphase/interFoam/laminar/waves/mangroveInteraction/constant/triSurface/seaweed.stl +++ b/tutorials/multiphase/interFoam/laminar/waves/mangroveInteraction/constant/triSurface/seaweed.stl @@ -1,85 +1,86 @@ -facet normal 0.0 1.0 0.0 - outer loop - vertex 4.065 0.5475 0.25 - vertex 5.7 0.5475 0.0 - vertex 4.065 0.5475 0.0 - endloop -endfacet -facet normal 0.0 1.0 0.0 - outer loop - vertex 5.7 0.5475 0.0 - vertex 4.065 0.5475 0.25 - vertex 5.7 0.5475 0.25 - endloop -endfacet -facet normal 1.0 0.0 0.0 - outer loop - vertex 5.7 0.5475 0.0 - vertex 5.7 0.0025 0.25 - vertex 5.7 0.0025 0.0 - endloop -endfacet -facet normal 1.0 0.0 0.0 - outer loop - vertex 5.7 0.0025 0.25 - vertex 5.7 0.5475 0.0 - vertex 5.7 0.5475 0.25 - endloop -endfacet -facet normal 1.63851263511957e-017 -1.0 0.0 - outer loop - vertex 5.7 0.0025 0.25 - vertex 4.065 0.00249999999999997 0.0 - vertex 5.7 0.0025 0.0 - endloop -endfacet -facet normal 1.63851263511957e-017 -1.0 0.0 - outer loop - vertex 4.065 0.00249999999999997 0.0 - vertex 5.7 0.0025 0.25 - vertex 4.065 0.00249999999999997 0.25 - endloop -endfacet -facet normal 0.0 0.0 -1.0 - outer loop - vertex 5.7 0.5475 0.0 - vertex 4.065 0.00249999999999997 0.0 - vertex 4.065 0.5475 0.0 - endloop -endfacet -facet normal 0.0 0.0 -1.0 - outer loop - vertex 4.065 0.00249999999999997 0.0 - vertex 5.7 0.5475 0.0 - vertex 5.7 0.0025 0.0 - endloop -endfacet -facet normal 0.0 0.0 1.0 - outer loop - vertex 5.7 0.0025 0.25 - vertex 4.065 0.5475 0.25 - vertex 4.065 0.00249999999999997 0.25 - endloop -endfacet -facet normal 0.0 0.0 1.0 - outer loop - vertex 4.065 0.5475 0.25 - vertex 5.7 0.0025 0.25 - vertex 5.7 0.5475 0.25 - endloop -endfacet -facet normal -1.0 0.0 0.0 - outer loop - vertex 4.065 0.5475 0.25 - vertex 4.065 0.00249999999999997 0.0 - vertex 4.065 0.00249999999999997 0.25 - endloop -endfacet -facet normal -1.0 0.0 0.0 - outer loop - vertex 4.065 0.00249999999999997 0.0 - vertex 4.065 0.5475 0.25 - vertex 4.065 0.5475 0.0 - endloop -endfacet -endsolid C +solid C +facet normal 0.0 1.0 0.0 + outer loop + vertex 4.065 0.5475 0.25 + vertex 5.7 0.5475 0.0 + vertex 4.065 0.5475 0.0 + endloop +endfacet +facet normal 0.0 1.0 0.0 + outer loop + vertex 5.7 0.5475 0.0 + vertex 4.065 0.5475 0.25 + vertex 5.7 0.5475 0.25 + endloop +endfacet +facet normal 1.0 0.0 0.0 + outer loop + vertex 5.7 0.5475 0.0 + vertex 5.7 0.0025 0.25 + vertex 5.7 0.0025 0.0 + endloop +endfacet +facet normal 1.0 0.0 0.0 + outer loop + vertex 5.7 0.0025 0.25 + vertex 5.7 0.5475 0.0 + vertex 5.7 0.5475 0.25 + endloop +endfacet +facet normal 1.63851263511957e-017 -1.0 0.0 + outer loop + vertex 5.7 0.0025 0.25 + vertex 4.065 0.00249999999999997 0.0 + vertex 5.7 0.0025 0.0 + endloop +endfacet +facet normal 1.63851263511957e-017 -1.0 0.0 + outer loop + vertex 4.065 0.00249999999999997 0.0 + vertex 5.7 0.0025 0.25 + vertex 4.065 0.00249999999999997 0.25 + endloop +endfacet +facet normal 0.0 0.0 -1.0 + outer loop + vertex 5.7 0.5475 0.0 + vertex 4.065 0.00249999999999997 0.0 + vertex 4.065 0.5475 0.0 + endloop +endfacet +facet normal 0.0 0.0 -1.0 + outer loop + vertex 4.065 0.00249999999999997 0.0 + vertex 5.7 0.5475 0.0 + vertex 5.7 0.0025 0.0 + endloop +endfacet +facet normal 0.0 0.0 1.0 + outer loop + vertex 5.7 0.0025 0.25 + vertex 4.065 0.5475 0.25 + vertex 4.065 0.00249999999999997 0.25 + endloop +endfacet +facet normal 0.0 0.0 1.0 + outer loop + vertex 4.065 0.5475 0.25 + vertex 5.7 0.0025 0.25 + vertex 5.7 0.5475 0.25 + endloop +endfacet +facet normal -1.0 0.0 0.0 + outer loop + vertex 4.065 0.5475 0.25 + vertex 4.065 0.00249999999999997 0.0 + vertex 4.065 0.00249999999999997 0.25 + endloop +endfacet +facet normal -1.0 0.0 0.0 + outer loop + vertex 4.065 0.00249999999999997 0.0 + vertex 4.065 0.5475 0.25 + vertex 4.065 0.5475 0.0 + endloop +endfacet +endsolid C From 5137c1f42065567db09e09ac1af23313f7f74fe7 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 12 Jun 2019 16:51:57 +0100 Subject: [PATCH 05/11] STYLE: typo --- .../searchableSurfaces/searchableCone/searchableCone.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meshTools/searchableSurfaces/searchableCone/searchableCone.H b/src/meshTools/searchableSurfaces/searchableCone/searchableCone.H index d4151f806a..a04539462a 100644 --- a/src/meshTools/searchableSurfaces/searchableCone/searchableCone.H +++ b/src/meshTools/searchableSurfaces/searchableCone/searchableCone.H @@ -30,7 +30,7 @@ Description \heading Dictionary parameters \table Property | Description | Required | Default - type | code / searchableCone | selector | + type | cone / searchableCone | selector | point1 | coordinate of endpoint | yes | radius1 | radius at point1 | yes | innerRadius1| inner radius at point1 | no | 0 From e716d1c073b5482b7f34438dba67f049cf0137bd Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 13 Jun 2019 14:24:58 +0100 Subject: [PATCH 06/11] ENH: surfactantFoam: run cleanly. See #1328 - do not write 0/ directory - clean case in ./Allclean --- .../surfactantFoam/createVolFields.H | 4 +- .../surfactantFoam/planeTransport/0/Cvf | 53 ------------------- .../surfactantFoam/planeTransport/0/U | 53 ------------------- .../surfactantFoam/planeTransport/Allclean | 7 +-- .../polyMesh => system}/blockMeshDict | 0 5 files changed, 3 insertions(+), 114 deletions(-) delete mode 100644 tutorials/finiteArea/surfactantFoam/planeTransport/0/Cvf delete mode 100644 tutorials/finiteArea/surfactantFoam/planeTransport/0/U rename tutorials/finiteArea/surfactantFoam/planeTransport/{constant/polyMesh => system}/blockMeshDict (100%) diff --git a/applications/solvers/finiteArea/surfactantFoam/createVolFields.H b/applications/solvers/finiteArea/surfactantFoam/createVolFields.H index 2f42dae83d..2d1de76a61 100644 --- a/applications/solvers/finiteArea/surfactantFoam/createVolFields.H +++ b/applications/solvers/finiteArea/surfactantFoam/createVolFields.H @@ -16,7 +16,7 @@ ); vsm.mapToVolume(Cs, Cvf.boundaryFieldRef()); - Cvf.write(); + //Cvf.write(); volVectorField U ( @@ -33,4 +33,4 @@ ); vsm.mapToVolume(Us, U.boundaryFieldRef()); - U.write(); + //U.write(); diff --git a/tutorials/finiteArea/surfactantFoam/planeTransport/0/Cvf b/tutorials/finiteArea/surfactantFoam/planeTransport/0/Cvf deleted file mode 100644 index d977dc5f2a..0000000000 --- a/tutorials/finiteArea/surfactantFoam/planeTransport/0/Cvf +++ /dev/null @@ -1,53 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v1812 | -| \\ / A nd | Web: www.OpenFOAM.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class volScalarField; - location "0"; - object Cvf; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 -1 0 0 0 0 0]; - - -internalField uniform 0; - -boundaryField -{ - inlet - { - type calculated; - value uniform 0; - } - bound - { - type calculated; - value uniform 0; - } - outlet - { - type calculated; - value uniform 0; - } - bottom - { - type calculated; - value uniform 0; - } - top - { - type calculated; - value uniform 0; - } -} - - -// ************************************************************************* // diff --git a/tutorials/finiteArea/surfactantFoam/planeTransport/0/U b/tutorials/finiteArea/surfactantFoam/planeTransport/0/U deleted file mode 100644 index 7dc2712cff..0000000000 --- a/tutorials/finiteArea/surfactantFoam/planeTransport/0/U +++ /dev/null @@ -1,53 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v1812 | -| \\ / A nd | Web: www.OpenFOAM.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class volVectorField; - location "0"; - object U; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 1 -1 0 0 0 0]; - - -internalField uniform (0 0 0); - -boundaryField -{ - inlet - { - type calculated; - value uniform (0 0 0); - } - bound - { - type calculated; - value uniform (0 0 0); - } - outlet - { - type calculated; - value uniform (0 0 0); - } - bottom - { - type calculated; - value uniform (0 0 0); - } - top - { - type calculated; - value uniform (0.05 0 0); - } -} - - -// ************************************************************************* // diff --git a/tutorials/finiteArea/surfactantFoam/planeTransport/Allclean b/tutorials/finiteArea/surfactantFoam/planeTransport/Allclean index b1673ba4c1..e852bce316 100755 --- a/tutorials/finiteArea/surfactantFoam/planeTransport/Allclean +++ b/tutorials/finiteArea/surfactantFoam/planeTransport/Allclean @@ -2,12 +2,7 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions -cleanTimeDirectories - -cleanPostProcessing - +cleanCase cleanFaMesh -rm -rf processor* - #------------------------------------------------------------------------------ diff --git a/tutorials/finiteArea/surfactantFoam/planeTransport/constant/polyMesh/blockMeshDict b/tutorials/finiteArea/surfactantFoam/planeTransport/system/blockMeshDict similarity index 100% rename from tutorials/finiteArea/surfactantFoam/planeTransport/constant/polyMesh/blockMeshDict rename to tutorials/finiteArea/surfactantFoam/planeTransport/system/blockMeshDict From 96ed6048499500b912e96021259b01cab45512b1 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 13 Jun 2019 15:00:22 +0100 Subject: [PATCH 07/11] ENH: motorBike: enable residual control. See #1328. --- .../stabilityBlendingFactor/stabilityBlendingFactor.C | 9 +++++---- .../motorBike/motorBike/system/stabilizationSchemes | 10 +++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/functionObjects/field/stabilityBlendingFactor/stabilityBlendingFactor.C b/src/functionObjects/field/stabilityBlendingFactor/stabilityBlendingFactor.C index 8bf214aaf5..526813dff0 100644 --- a/src/functionObjects/field/stabilityBlendingFactor/stabilityBlendingFactor.C +++ b/src/functionObjects/field/stabilityBlendingFactor/stabilityBlendingFactor.C @@ -109,12 +109,13 @@ bool Foam::functionObjects::stabilityBlendingFactor::init(bool first) if (!residualPtr) { WarningInFunction - << "Could not find residual file : " << residualName_ - << ".The residual mode won't be " << nl + << "Could not find residual field : " << residualName_ + << ". The residual mode won't be " << nl << " considered for the blended field in the stability " << "blending factor. " << nl - << " Add the corresponding residual function object. " << nl - << " If the residual function object is already set " + << " Please add the corresponding 'solverInfo'" + << " function object with 'writeResidualFields true'." << nl + << " If the solverInfo function object is already enabled " << "you might need to wait " << nl << " for the first iteration." << nl << endl; diff --git a/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/stabilizationSchemes b/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/stabilizationSchemes index 6285f30aec..48854b2944 100644 --- a/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/stabilizationSchemes +++ b/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/stabilizationSchemes @@ -8,11 +8,11 @@ residuals { - type solverInfo; - libs ("libutilityFunctionObjects.so"); - writeFields true; - writeControl outputTime; - fields (p); + type solverInfo; + libs ("libutilityFunctionObjects.so"); + writeResidualFields true; + writeControl outputTime; + fields (p); } blendingFactor From b01611a12668dc00f726bdcfcecfec70a99b5d4e Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 13 Jun 2019 14:01:08 +0200 Subject: [PATCH 08/11] CONFIG: make default for allowSpaceInFileName platform dependent - enable by default on Windows, disable by default on non-Windows. --- etc/controlDict | 3 ++- src/OpenFOAM/primitives/strings/fileName/fileName.C | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/etc/controlDict b/etc/controlDict index 223f28e3ab..b30bff5d4f 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -68,7 +68,8 @@ InfoSwitches allowSystemOperations 1; // Allow space character in fileName (use with caution) - allowSpaceInFileName 0; + // Default: 0 for non-Windows, 1 for Windows + //// allowSpaceInFileName 0; } diff --git a/src/OpenFOAM/primitives/strings/fileName/fileName.C b/src/OpenFOAM/primitives/strings/fileName/fileName.C index d0af6d8869..cedfa1cdee 100644 --- a/src/OpenFOAM/primitives/strings/fileName/fileName.C +++ b/src/OpenFOAM/primitives/strings/fileName/fileName.C @@ -36,11 +36,18 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // const char* const Foam::fileName::typeName = "fileName"; + int Foam::fileName::debug(Foam::debug::debugSwitch(fileName::typeName, 0)); + int Foam::fileName::allowSpaceInFileName ( + #ifdef _WIN32 + Foam::debug::infoSwitch("allowSpaceInFileName", 1) + #else Foam::debug::infoSwitch("allowSpaceInFileName", 0) + #endif ); + const Foam::fileName Foam::fileName::null; From f05ff817229d07fb7bce0524b173f4df460172df Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 13 Jun 2019 18:22:10 +0200 Subject: [PATCH 09/11] CONFIG: bump API to 1906 (pre-release) - adjust copyright dates for manpages --- META-INFO/api-info | 2 +- src/OpenFOAM/global/argList/argListHelp.C | 8 +++++++- wmake/rules/General/general | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/META-INFO/api-info b/META-INFO/api-info index bade5ef065..4448e7818b 100644 --- a/META-INFO/api-info +++ b/META-INFO/api-info @@ -1,2 +1,2 @@ -api=1904 +api=1906 patch=0 diff --git a/src/OpenFOAM/global/argList/argListHelp.C b/src/OpenFOAM/global/argList/argListHelp.C index 850359654c..bfc8e694ec 100644 --- a/src/OpenFOAM/global/argList/argListHelp.C +++ b/src/OpenFOAM/global/argList/argListHelp.C @@ -33,6 +33,12 @@ License namespace Foam { +// Convert api number (YYMM) -> 20YY. Eg, 1906 -> 2019 +static inline int apiYear() +{ + return 2000 + (foamVersion::api / 100); +} + // manpage Footer static inline void printManFooter() { @@ -40,7 +46,7 @@ static inline void printManFooter() << "Online documentation " << "https://www.openfoam.com/documentation/" << nl << ".SH COPYRIGHT" << nl - << "Copyright \\(co 2018 OpenCFD Ltd." << nl; + << "Copyright \\(co 2018-" << apiYear() << " OpenCFD Ltd." << nl; } diff --git a/wmake/rules/General/general b/wmake/rules/General/general index 4eb70d6c45..6a6c7e130d 100644 --- a/wmake/rules/General/general +++ b/wmake/rules/General/general @@ -1,5 +1,5 @@ #-------------------------------*- makefile -*--------------------------------- -WM_VERSION = OPENFOAM=1904 +WM_VERSION = OPENFOAM=1906 AR = ar ARFLAGS = cr From 4e0222f887ba1b9462d027a32031d722fa3196f2 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 13 Jun 2019 18:43:07 +0200 Subject: [PATCH 10/11] DOC: relocated OpenFOAM etc/README.md to doc/Config.md - relocated BuildIssues.txt -> doc/BuildIssues.md --- BuildIssues.txt | 121 --------------------------------- README.md | 4 +- doc/Build.md | 14 ++-- doc/BuildIssues.md | 111 ++++++++++++++++++++++++++++++ etc/README.md => doc/Config.md | 0 doc/Requirements.md | 9 ++- etc/config.csh/vtk | 2 +- etc/config.sh/vtk | 2 +- 8 files changed, 130 insertions(+), 133 deletions(-) delete mode 100644 BuildIssues.txt create mode 100644 doc/BuildIssues.md rename etc/README.md => doc/Config.md (100%) diff --git a/BuildIssues.txt b/BuildIssues.txt deleted file mode 100644 index a05b5301c3..0000000000 --- a/BuildIssues.txt +++ /dev/null @@ -1,121 +0,0 @@ -OpenFOAM-1712 -================== -Known Build Issues -================== - ---------------------- -Intel MPI (Gcc/Clang) ---------------------- - - Either I_MPI_ROOT or MPI_ROOT can be used to specify the Intel-MPI - installation directory path. - - The ThirdParty build of ptscotch uses `mpiicc` for Intel-MPI - instead of the usual `mpicc`. - When gcc or clang are used, it is highly likely that the - I_MPI_CC environment variable also needs to be set accordingly. - - See `mpiicc -help` for more information about environment variables. - - --------------- -Intel Compiler --------------- - - Since OpenFOAM uses C++11, a fairly recent version is required. - The Intel compiler - icc (ICC) 17.0.1 20161005 is ok, but the - initial release - icc (ICC) 17.0.0 20160721 - has a bug that - will result in these types of error messages. - - MatrixSpaceI.H(492): error: no instance of overloaded function - "Foam::MatrixSpace::Block::operator=" matches the specified type - - ---- -VTK ---- - -If using the runTimePostProcessing to create on-the-fly images, you -can simply just compile ParaView and these libraries will be used. - -If you elect to use a separate VTK compilation (for example for -off-screen rendering), it is advisable to reuse the VTK libraries that -are provided with ParaView by making an appropriate symlink -prior to using makeVTK. This doesn't just reduce disk-space, but works -much better than using the VTK tar file. - -Using runTimePostProcessing with the 'plain' VTK libraries does -generally work, but does not exit cleanly: - - symbol lookup error: .../linux64Gcc/VTK-7.1.0/lib/libvtkCommonExecutionModel-7.1.so.1: - undefined symbol: _ZN33vtkFilteringInformationKeyManager13ClassFinalizeEv - - symbol lookup error: .../linux64Gcc/VTK-7.1.0/lib/libvtkCommonDataModel-7.1.so.1: - undefined symbol: _ZN49vtkInformationQuadratureSchemeDefinitionVectorKeyD1Ev - -This error appears to be suppressed if VTK is compiled with a Debug build-type. - - -------------------------- -Building on older systems -------------------------- - -If the system gcc is too old for building OpenFOAM, a third-party gcc or -clang/llvm installation can be used. If building clang/llvm, note that -there are also minimum gcc/g++ requirements there: - - Min gcc/g++ - =========== ========== - 4.4 llvm-3.4.2 - 4.7 llvm-3.5.2 - llvm-3.7.0 - - -If your system compiler is too old to build the minimum required gcc or -clang/llvm, it is just simply too old. - - ---------------------------------- -ThirdParty clang without gmp/mpfr ---------------------------------- - -If using ThirdParty clang without gmp/mpfr, the ThirdParty makeCGAL -script will need to be run manually and specify that there is no -gmp/mpfr. Eg, - - cd $WM_THIRD_PARTY_DIR - ./makeCGAL gmp-none mpfr-none - -Subequent compilation with Allwmake will now run largely without any -problems, except that the components linking against CGAL -(foamyMesh and surfaceBooleanFeatures) will also try to link against -a nonexistent mpfr library. As a workaround, the link-dependency can -be removed in wmake/rules/General/CGAL : - - CGAL_LIBS = \ - -L$(BOOST_ARCH_PATH)/lib \ - -L$(BOOST_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \ - -L$(CGAL_ARCH_PATH)/lib \ - -L$(CGAL_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \ - -lCGAL - -This is a temporary inconvenience until a more robust solution is found. - - -------------------------- -Building with spack -------------------------- - -If you are building with spack, note that the depends_on for paraview -resolves poorly. The +qt dependency (for building the reader module) -may need to be specified as a preference by including the following in -your `~/.spack/packages.yaml` file: - - packages: - paraview: - variants: +qt - -It appears that spack will otherwise ignore any paraview+qt version -and attempt to install a paraview~qt version instead. - --- diff --git a/README.md b/README.md index 163f443c55..a98a597293 100644 --- a/README.md +++ b/README.md @@ -33,9 +33,9 @@ Please see the relevant guides: [repo openfoam]: https://develop.openfoam.com/Development/OpenFOAM-plus/ [repo third]: https://develop.openfoam.com/Development/ThirdParty-plus/ -[link openfoam-issues]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/BuildIssues.txt [link openfoam-readme]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/README.md -[link openfoam-config]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/etc/README.md +[link openfoam-issues]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/BuildIssues.md +[link openfoam-config]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Config.md [link openfoam-build]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Build.md [link openfoam-require]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Requirements.md [link third-readme]: https://develop.openfoam.com/Development/ThirdParty-plus/blob/develop/README.md diff --git a/doc/Build.md b/doc/Build.md index 97aafcb5f2..a59c8e6aa9 100644 --- a/doc/Build.md +++ b/doc/Build.md @@ -15,7 +15,8 @@ The [third-party][repo third] directory includes a [build guide][link third-build]. Some known build issues related to specific compiler and VTK library versions -can be found in the [$WM_PROJECT_DIR/BuildIssues.txt][link openfoam-issues] file. +can be found in the [$WM_PROJECT_DIR/doc/BuildIssues.md][link openfoam-issues] +file. If you need to change the default versions for third-party libraries, or use system libraries for some components, please some additional @@ -94,10 +95,10 @@ simpleFoam OpenFOAM ships with ParaView sources for post-processing OpenFOAM field results. However, the paraview version distributed with the operating system or a [binary package][download ParaView] -will be sufficient, and avoids additional compilation complexity. +will often be sufficient, and avoids additional compilation complexity. -If do you wish to compile ParaView from sources, it is recommended -that you do so *after* completing an initial compilation of OpenFOAM. +If you do wish to compile ParaView from source, it is recommended +that you do so ***after*** completing an initial compilation of OpenFOAM. This gets the process started much more quickly. At a later stage, OpenFOAM can be updated to compile with paraview. Only the affected applications will be compiled (eg, the blockMesh reader module) and the @@ -123,8 +124,9 @@ More details in the [ThirdParty build guide][link third-build]. [repo openfoam]: https://develop.openfoam.com/Development/OpenFOAM-plus/ [repo third]: https://develop.openfoam.com/Development/ThirdParty-plus/ -[link openfoam-issues]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/BuildIssues.txt -[link openfoam-config]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/etc/README.md +[link openfoam-readme]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/README.md +[link openfoam-issues]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/BuildIssues.md +[link openfoam-config]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Config.md [link openfoam-build]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Build.md [link openfoam-require]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Requirements.md [link third-readme]: https://develop.openfoam.com/Development/ThirdParty-plus/blob/develop/README.md diff --git a/doc/BuildIssues.md b/doc/BuildIssues.md new file mode 100644 index 0000000000..a3a4f5d375 --- /dev/null +++ b/doc/BuildIssues.md @@ -0,0 +1,111 @@ +## Known Build Issues (OpenFOAM-v1906) + +### Intel MPI with Gcc/Clang) + +Either `I_MPI_ROOT` (preferred) or `MPI_ROOT` can be used to specify +the Intel-MPI installation directory path. +The ThirdParty build of ptscotch uses `mpiicc` for Intel-MPI instead +of the usual `mpicc`. When gcc or clang are used, it is quite likely +that the `I_MPI_CC` environment variable also needs to be set +accordingly. +See `mpiicc -help` for more information about environment variables. + + +### VTK + +If using the runTimePostProcessing to create on-the-fly images, you +can simply just compile ParaView and these libraries will be used. +If you elect to use a separate VTK compilation (for example for +off-screen rendering), it is advisable to reuse the VTK libraries that +are provided with ParaView by making an appropriate symlink +prior to using makeVTK. This doesn't just reduce disk-space, but works +much better than using the VTK tar file. + +Using runTimePostProcessing with the *plain* VTK libraries does +generally work, but may not exit cleanly: +``` +symbol lookup error: .../linux64Gcc/VTK-7.1.0/lib/libvtkCommonExecutionModel-7.1.so.1: +undefined symbol: _ZN33vtkFilteringInformationKeyManager13ClassFinalizeEv + +symbol lookup error: .../linux64Gcc/VTK-7.1.0/lib/libvtkCommonDataModel-7.1.so.1: +undefined symbol: _ZN49vtkInformationQuadratureSchemeDefinitionVectorKeyD1Ev +``` + +This error appears to be suppressed if VTK is compiled with a `Debug` build-type. + + +### Building on older systems + +If the system gcc is too old for building OpenFOAM, a third-party gcc or +clang/llvm installation can be used. If building clang/llvm, note that +there are also minimum gcc/g++ requirements as listed in the +detailed [build guide][link third-build]. + +If your system compiler is too old to build the minimum required gcc or +clang/llvm, it is just simply too old. + + +### ThirdParty clang without gmp/mpfr + +If using ThirdParty clang without gmp/mpfr, the ThirdParty makeCGAL +script will need to be run manually and specify that there is no +gmp/mpfr. Eg, +``` +cd $WM_THIRD_PARTY_DIR +./makeCGAL gmp-none mpfr-none +``` + +Subequent compilation with Allwmake will now run largely without any +problems, except that the components linking against CGAL +(foamyMesh and surfaceBooleanFeatures) will also try to link against +a nonexistent mpfr library. As a workaround, the link-dependency can +be removed in wmake/rules/General/CGAL : +``` +CGAL_LIBS = \ + -L$(BOOST_ARCH_PATH)/lib \ + -L$(BOOST_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \ + -L$(CGAL_ARCH_PATH)/lib \ + -L$(CGAL_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \ + -lCGAL +``` + +A robuster solution is still being sought. + + +### Building with spack + +If you are building with spack, note that the `depends_on` for paraview +resolves poorly. The `+qt` dependency (for building the reader module) +may need to be specified as a preference by including the following in +your `~/.spack/packages.yaml` file: +``` +packages: + paraview: + variants: +qt +``` +It appears that spack will otherwise ignore any `paraview+qt` version +and attempt to install a `paraview~qt` version instead. + +-- + + +[page ParaView]: http://www.paraview.org/ +[download ParaView]: https://www.paraview.org/download/ + + + + +[repo openfoam]: https://develop.openfoam.com/Development/OpenFOAM-plus/ +[repo third]: https://develop.openfoam.com/Development/ThirdParty-plus/ + +[link openfoam-readme]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/README.md +[link openfoam-issues]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/BuildIssues.md +[link openfoam-config]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Config.md +[link openfoam-build]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Build.md +[link openfoam-require]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Requirements.md +[link third-readme]: https://develop.openfoam.com/Development/ThirdParty-plus/blob/develop/README.md +[link third-build]: https://develop.openfoam.com/Development/ThirdParty-plus/blob/develop/BUILD.md +[link third-require]: https://develop.openfoam.com/Development/ThirdParty-plus/blob/develop/Requirements.md + +--- +Copyright 2019 OpenCFD Ltd diff --git a/etc/README.md b/doc/Config.md similarity index 100% rename from etc/README.md rename to doc/Config.md diff --git a/doc/Requirements.md b/doc/Requirements.md index 5f9be72dae..a78bbd53cc 100644 --- a/doc/Requirements.md +++ b/doc/Requirements.md @@ -10,15 +10,21 @@ OpenFOAM requires a functioning C++11 compiler and `make` build toolchain. - fftw: 3.3.7 (recommended - required for FFT-related functionality) - paraview: 5.5.2 (for visualization) +If using the Intel® compiler, `17.0.1 20161005` is the minimum +usable version. + + To check the installed versions | Program | To check the version | |---------------|-----------------------| | gcc | gcc --version | +| icc | icc --version | | cmake | cmake --version | | openmpi | orterun --version | + ### Additional utilities - flex @@ -81,7 +87,6 @@ sudo zypper install cmake boost-devel mpfr-devel gmp-devel openmpi-devel gnuplot This installs - | Program | openSUSE | Program version | |-----------|-----------|-----------------| | gcc | 15.0 | 7.4.3 | @@ -157,7 +162,7 @@ A partial list is given in the [ThirdParty requirements][link third-require]. [link openfoam-readme]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/README.md -[link openfoam-config]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/etc/README.md +[link openfoam-config]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Config.md [link openfoam-build]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Build.md [link openfoam-require]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Requirements.md [link third-readme]: https://develop.openfoam.com/Development/ThirdParty-plus/blob/develop/README.md diff --git a/etc/config.csh/vtk b/etc/config.csh/vtk index dbd5edf90c..eaabe27031 100644 --- a/etc/config.csh/vtk +++ b/etc/config.csh/vtk @@ -25,7 +25,7 @@ # # It is recommended to use VTK sources from ParaView (5.0.1 or later) # -# See BuildIssues.txt about problems that can be encountered when using +# See doc/BuildIssues.md about problems that can be encountered when using # the 'plain' VTK sources. #------------------------------------------------------------------------------ # USER EDITABLE PART: Changes made here may be lost with the next upgrade diff --git a/etc/config.sh/vtk b/etc/config.sh/vtk index 4815da2435..38859432d6 100644 --- a/etc/config.sh/vtk +++ b/etc/config.sh/vtk @@ -26,7 +26,7 @@ # # It is recommended to use VTK sources from ParaView (5.0.1 or later) # -# See BuildIssues.txt about problems that can be encountered when using +# See doc/BuildIssues.md about problems that can be encountered when using # the 'plain' VTK sources. #------------------------------------------------------------------------------ # USER EDITABLE PART: Changes made here may be lost with the next upgrade From f86392511258636f008a2eb033d6193ca21325e8 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 13 Jun 2019 19:37:27 +0200 Subject: [PATCH 11/11] STYLE: use uintptr_t instead of long --- applications/test/Matrix/Test-Matrix.C | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/applications/test/Matrix/Test-Matrix.C b/applications/test/Matrix/Test-Matrix.C index dbccf225fa..7eb69af579 100644 --- a/applications/test/Matrix/Test-Matrix.C +++ b/applications/test/Matrix/Test-Matrix.C @@ -30,6 +30,7 @@ License #include "LLTMatrix.H" #include "Random.H" #include "SortList.H" +#include "Switch.H" #include using namespace Foam; @@ -237,22 +238,14 @@ int main(int argc, char *argv[]) Info<< "# SquareMatrix example:" << nl; printMatrix(Info, S) << nl; - const label mRows = S.m(); - const label nCols = S.n(); - const label size = S.size(); - const labelPair sizes = S.sizes(); - const bool isEmpty = S.empty(); - const long constPointer = long(S.cdata()); - long pointer = long(S.data()); - Info - << "Number of rows =" << tab << mRows << nl - << "Number of columns = " << tab << nCols << nl - << "Number of elements = " << tab << size << nl - << "Number of rows/columns = " << tab << sizes << nl - << "Matrix is empty = " << tab << isEmpty << nl - << "Constant pointer = " << tab << constPointer << nl - << "Pointer = " << tab << pointer << nl + << "Number of rows =" << tab << S.m() << nl + << "Number of columns = " << tab << S.n() << nl + << "Number of elements = " << tab << S.size() << nl + << "Number of rows/columns = " << tab << S.sizes() << nl + << "Matrix is empty = " << tab << Switch(S.empty()) << nl + << "Constant pointer = " << tab << uintptr_t(S.cdata()) << nl + << "Pointer = " << tab << uintptr_t(S.data()) << nl << nl; horizontalLine();