diff --git a/applications/test/passiveParticle/Make/files b/applications/test/passiveParticle/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..1a93cde7a33102e063006fafb51cdf51757ef47e --- /dev/null +++ b/applications/test/passiveParticle/Make/files @@ -0,0 +1,4 @@ + +passiveParticleTest.C + +EXE = $(FOAM_USER_APPBIN)/passiveParticleTest diff --git a/applications/test/passiveParticle/Make/options b/applications/test/passiveParticle/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..ca034169554b9f83b8defb8c62f85d1df0068be6 --- /dev/null +++ b/applications/test/passiveParticle/Make/options @@ -0,0 +1,8 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/lagrangian/basic/lnInclude + +EXE_LIBS = \ + -lfiniteVolume \ + -lmeshTools \ + -llagrangian diff --git a/applications/test/passiveParticle/passiveParticleTest.C b/applications/test/passiveParticle/passiveParticleTest.C new file mode 100644 index 0000000000000000000000000000000000000000..15ba56f4faef9275bf25eee2d798395e94461a53 --- /dev/null +++ b/applications/test/passiveParticle/passiveParticleTest.C @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Application + testPassiveParticle + +Description + Test cloud of passive particles. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "passiveParticleCloud.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + argList::validArgs.append("cloudName"); + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + runTime.functionObjects().off(); + + const word cloudName(args.additionalArgs()[0]); + + { + // Start with empty cloud + passiveParticleCloud particles + ( + mesh, + cloudName, + IDLList<passiveParticle>() + ); + Pout<< "Starting particles:" << particles.size() << endl; + + Pout<< "Adding a particle." << endl; + particles.addParticle(new passiveParticle(particles, vector::zero, -1)); + + forAllConstIter(passiveParticleCloud, particles, iter) + { + Pout<< " " << iter().position() << " cell:" << iter().cell() + << " origProc:" << iter().origProc() + << " origId:" << iter().origId() + << endl; + } + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + + runTime++; + Pout<< "Writing particles to time " << runTime.timeName() << endl; + particles.write(); + } + + { + Pout<< "Rereading particles from time " << runTime.timeName() + << endl; + passiveParticleCloud particles(mesh, cloudName); + Pout<< "Reread particles:" << particles.size() << endl; + + forAllConstIter(passiveParticleCloud, particles, iter) + { + Pout<< " " << iter().position() << " cell:" << iter().cell() + << " origProc:" << iter().origProc() + << " origId:" << iter().origId() + << endl; + } + } + + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/test/tokenizeTest/tokenizeTest.C b/applications/test/tokenizeTest/tokenizeTest.C index deb675ee00c29ccfde4dce9148bd52908734c6f0..99bc5999845358534bd4d777a0defcd14713264a 100644 --- a/applications/test/tokenizeTest/tokenizeTest.C +++ b/applications/test/tokenizeTest/tokenizeTest.C @@ -33,6 +33,7 @@ Description #include "IOstreams.H" #include "IFstream.H" #include "IStringStream.H" +#include "cpuTime.H" using namespace Foam; @@ -44,41 +45,76 @@ int main(int argc, char *argv[]) argList::noParallel(); argList::validArgs.insert("string .. stringN"); argList::validOptions.insert("file", "name"); + argList::validOptions.insert("repeat", "count"); argList args(argc, argv, false, true); - forAll(args.additionalArgs(), argI) - { - const string& rawArg = args.additionalArgs()[argI]; - Info<< "input string: " << rawArg << nl; + label repeat = 1; + args.optionReadIfPresent<label>("repeat", repeat); + + cpuTime timer; - IStringStream is(rawArg); - - while (is.good()) + for (label count = 0; count < repeat; ++count) + { + forAll(args.additionalArgs(), argI) { - token tok(is); - Info<< "token: " << tok.info() << endl; + const string& rawArg = args.additionalArgs()[argI]; + if (count == 0) + { + Info<< "input string: " << rawArg << nl; + } + + IStringStream is(rawArg); + + while (is.good()) + { + token tok(is); + if (count == 0) + { + Info<< "token: " << tok.info() << endl; + } + } + + if (count == 0) + { + Info<< nl; + IOobject::writeDivider(Info); + } } - - Info<< nl; - IOobject::writeDivider(Info); - } - - + } + + Info<< "tokenized args " << repeat << " times in " + << timer.cpuTimeIncrement() << " s\n\n"; + if (args.optionFound("file")) { - IFstream is(args.option("file")); - - Info<< "tokenizing file: " << args.option("file") << nl; - - while (is.good()) + for (label count = 0; count < repeat; ++count) { - token tok(is); - Info<< "token: " << tok.info() << endl; + IFstream is(args.option("file")); + + if (count == 0) + { + Info<< "tokenizing file: " << args.option("file") << nl; + } + + while (is.good()) + { + token tok(is); + if (count == 0) + { + Info<< "token: " << tok.info() << endl; + } + } + + if (count == 0) + { + Info<< nl; + IOobject::writeDivider(Info); + } } - - Info<< nl; - IOobject::writeDivider(Info); + + Info<< "tokenized file " << repeat << " times in " + << timer.cpuTimeIncrement() << " s\n\n"; } return 0; diff --git a/applications/utilities/surface/surfaceSplitNonManifolds/surfaceSplitNonManifolds.C b/applications/utilities/surface/surfaceSplitNonManifolds/surfaceSplitNonManifolds.C index 8608fe33af6a6c8291bf8fbf06264b809b3049be..c14771030f4480d7d1152a36ec734b1ececbcc88 100644 --- a/applications/utilities/surface/surfaceSplitNonManifolds/surfaceSplitNonManifolds.C +++ b/applications/utilities/surface/surfaceSplitNonManifolds/surfaceSplitNonManifolds.C @@ -157,14 +157,14 @@ void testSortedEdgeFaces(const triSurface& surf) { if (findIndex(sortMyFaces, myFaces[i]) == -1) { - FatalErrorIn("testSortedEdgeFaces") << abort(FatalError); + FatalErrorIn("testSortedEdgeFaces(..)") << abort(FatalError); } } forAll(sortMyFaces, i) { if (findIndex(myFaces, sortMyFaces[i]) == -1) { - FatalErrorIn("testSortedEdgeFaces") << abort(FatalError); + FatalErrorIn("testSortedEdgeFaces(..)") << abort(FatalError); } } } @@ -304,7 +304,7 @@ label findEdge } - FatalErrorIn("findEdge") << "Cannot find edge with labels " << v0 + FatalErrorIn("findEdge(..)") << "Cannot find edge with labels " << v0 << ' ' << v1 << " in candidates " << edgeLabels << " with vertices:" << UIndirectList<edge>(surf.edges(), edgeLabels)() << abort(FatalError); @@ -343,7 +343,7 @@ label otherEdge } } - FatalErrorIn("otherEdge") << "Cannot find other edge on face " << faceI + FatalErrorIn("otherEdge(..)") << "Cannot find other edge on face " << faceI << " verts:" << surf.localPoints()[faceI] << " connected to point " << pointI << " faceEdges:" << UIndirectList<edge>(surf.edges(), fEdges)() @@ -409,7 +409,9 @@ void walkSplitLine if (eFaces.size() != 2) { - FatalErrorIn("walkSplitPoint") << abort(FatalError); + FatalErrorIn("walkSplitPoint(..)") + << "Can only handle edges with 2 or 4 edges for now." + << abort(FatalError); } if (eFaces[0] == faceI) @@ -422,7 +424,7 @@ void walkSplitLine } else { - FatalErrorIn("walkSplitPoint") << abort(FatalError); + FatalErrorIn("walkSplitPoint(..)") << abort(FatalError); } } while (true); @@ -547,7 +549,7 @@ void calcPointVecs surf.write("errorSurf.ftr"); - FatalErrorIn("calcPointVecs") + FatalErrorIn("calcPointVecs(..)") << "Cannot find two faces using border edge " << edgeI << " verts:" << edges[edgeI] << " eFaces:" << eFaces << endl diff --git a/src/OpenFOAM/Make/options b/src/OpenFOAM/Make/options index c5c5809076e0947f38c928f4ea3880b13ba60ac0..4eba86ae56d914aed88f7c06eb8d50c24b6f492b 100644 --- a/src/OpenFOAM/Make/options +++ b/src/OpenFOAM/Make/options @@ -1,5 +1,4 @@ -EXE_INC = \ - -I$(WM_THIRD_PARTY_DIR)/zlib-1.2.3 +EXE_INC = LIB_LIBS = \ $(FOAM_LIBBIN)/libOSspecific.o \ diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/IPstream.C b/src/OpenFOAM/db/IOstreams/Pstreams/IPstream.C index 3d889af9615eebd56225102cf0353b9e73799d2b..4ad3f6bbeceea29c60afeb80465e0a1d9f8db7b2 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/IPstream.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/IPstream.C @@ -78,7 +78,15 @@ inline void Foam::IPstream::readFromBuffer // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::IPstream::~IPstream() -{} +{ + if (bufPosition_ < messageSize_) + { + FatalErrorIn("IPstream::~IPstream()") + << "Message not fully consumed. messageSize:" << messageSize_ + << " bytes of which only " << bufPosition_ + << " consumed." << Foam::abort(FatalError); + } +} diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/Pstream.H b/src/OpenFOAM/db/IOstreams/Pstreams/Pstream.H index dff94c259f78ee2cbe7811d244432f43576a7c7f..5e8e5cbbb787269c506833f83167a41ba235d7d2 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/Pstream.H +++ b/src/OpenFOAM/db/IOstreams/Pstreams/Pstream.H @@ -350,6 +350,31 @@ public: return oldCommsType; } + //- Transfer buffer + const List<char>& buf() const + { + return buf_; + } + + //- Transfer buffer + List<char>& buf() + { + return buf_; + } + + //- Current buffer read/write location + int bufPosition() const + { + return bufPosition_; + } + + //- Current buffer read/write location + int& bufPosition() + { + return bufPosition_; + } + + //- Exit program static void exit(int errnum = 1); diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C b/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C index 21057c3f396f0aa01c75bae6f4d252d706787dbc..8f1ebc754d377bb2169c3f1ff00713c7173eb4e4 100644 --- a/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C +++ b/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C @@ -42,7 +42,7 @@ char Foam::ISstream::nextValid() while (get(c) && isspace(c)) {} - // Return if stream is bad + // Return if stream is bad - ie, previous get() failed if (bad() || isspace(c)) { return 0; @@ -102,7 +102,8 @@ char Foam::ISstream::nextValid() Foam::Istream& Foam::ISstream::read(token& t) { - static char charBuffer[128]; + static const int maxLen = 128; + static char buf[maxLen]; // Return the put back token if it exists if (Istream::getBack(t)) @@ -114,7 +115,7 @@ Foam::Istream& Foam::ISstream::read(token& t) // Lines are counted by '\n' // Get next 'valid character': i.e. proceed through any whitespace - // and/or comments until a semantically valid character is hit upon. + // and/or comments until a semantically valid character is found char c = nextValid(); @@ -131,7 +132,7 @@ Foam::Istream& Foam::ISstream::read(token& t) // Analyse input starting with this character. switch (c) { - // First check for punctuation characters. + // Check for punctuation first case token::END_STATEMENT : case token::BEGIN_LIST : @@ -144,7 +145,7 @@ Foam::Istream& Foam::ISstream::read(token& t) case token::COMMA : case token::ASSIGN : case token::ADD : - // case token::SUBTRACT : // Handled later as the possible start of a number + // NB: token::SUBTRACT handled later as the possible start of a Number case token::MULTIPLY : case token::DIVIDE : { @@ -153,26 +154,27 @@ Foam::Istream& Foam::ISstream::read(token& t) } - // Strings: enclosed by double quotes. + // String: enclosed by double quotes. case token::BEGIN_STRING : { putback(c); string* sPtr = new string; - if (!read(*sPtr).bad()) + if (read(*sPtr).bad()) { - t = sPtr; + delete sPtr; + t.setBad(); } else { - delete sPtr; - t.setBad(); + t = sPtr; } + return *this; } - // Numbers: do not distinguish at this point between Types. + // Number: integer or floating point // // ideally match the equivalent of this regular expression // @@ -185,10 +187,11 @@ Foam::Istream& Foam::ISstream::read(token& t) { bool asLabel = (c != '.'); - unsigned int nChar = 0; - charBuffer[nChar++] = c; + int nChar = 0; + buf[nChar++] = c; - // get everything that could reasonable look like a number + // get everything that could resemble a number and let + // strtod() determine the validity while ( is_.get(c) @@ -202,24 +205,38 @@ Foam::Istream& Foam::ISstream::read(token& t) ) ) { - asLabel = asLabel && isdigit(c); + if (asLabel) + { + asLabel = isdigit(c); + } - charBuffer[nChar++] = c; - if (nChar >= sizeof(charBuffer)) + buf[nChar++] = c; + if (nChar == maxLen) { // runaway argument - avoid buffer overflow + buf[maxLen-1] = '\0'; + + FatalIOErrorIn("ISstream::read(token&)", *this) + << "number '" << buf << "...'\n" + << " is too long (max. " << maxLen << " characters)" + << exit(FatalIOError); + t.setBad(); return *this; } } - charBuffer[nChar] = '\0'; + buf[nChar] = '\0'; setState(is_.rdstate()); - if (!is_.bad()) + if (is_.bad()) + { + t.setBad(); + } + else { is_.putback(c); - if (nChar == 1 && charBuffer[0] == '-') + if (nChar == 1 && buf[0] == '-') { // a single '-' is punctuation t = token::punctuationToken(token::SUBTRACT); @@ -230,31 +247,43 @@ Foam::Istream& Foam::ISstream::read(token& t) if (asLabel) { - long longval = strtol(charBuffer, &endptr, 10); - t = label(longval); + long longVal(strtol(buf, &endptr, 10)); + t = label(longVal); // return as a scalar if doesn't fit in a label - if (t.labelToken() != longval) + if (t.labelToken() != longVal) { - t = scalar(strtod(charBuffer, &endptr)); + t = scalar(strtod(buf, &endptr)); } } else { - t = scalar(strtod(charBuffer, &endptr)); + scalar scalarVal(strtod(buf, &endptr)); + t = scalarVal; + +// --------------------------------------- +// this would also be possible if desired: +// --------------------------------------- +// // return as a label when possible +// // eg, 1E6 -> 1000000 +// if (scalarVal <= labelMax && scalarVal >= labelMin) +// { +// label labelVal(scalarVal); +// +// if (labelVal == scalarVal) +// { +// t = labelVal; +// } +// } } // nothing converted (bad format), or trailing junk - if (endptr == charBuffer || *endptr != '\0') + if (endptr == buf || *endptr != '\0') { t.setBad(); } } } - else - { - t.setBad(); - } return *this; } @@ -266,23 +295,21 @@ Foam::Istream& Foam::ISstream::read(token& t) putback(c); word* wPtr = new word; - if (!read(*wPtr).bad()) + if (read(*wPtr).bad()) { - if (token::compound::isCompound(*wPtr)) - { - t = token::compound::New(*wPtr, *this).ptr(); - delete wPtr; - } - else - { - t = wPtr; - } + delete wPtr; + t.setBad(); } - else + else if (token::compound::isCompound(*wPtr)) { + t = token::compound::New(*wPtr, *this).ptr(); delete wPtr; - t.setBad(); } + else + { + t = wPtr; + } + return *this; } } @@ -302,69 +329,64 @@ Foam::Istream& Foam::ISstream::read(word& str) static const int errLen = 80; // truncate error message for readability static char buf[maxLen]; - register int i = 0; - register int bc = 0; + register int nChar = 0; + register int listDepth = 0; char c; while (get(c) && word::valid(c)) { - if (fail()) + if (c == token::BEGIN_LIST) + { + listDepth++; + } + else if (c == token::END_LIST) { - if (i < maxLen-1) + if (listDepth) { - buf[i] = '\0'; + listDepth--; } else { - buf[maxLen-1] = '\0'; + break; } - buf[errLen] = '\0'; - - FatalIOErrorIn("ISstream::read(word&)", *this) - << "problem while reading word '" << buf << "'\n" - << exit(FatalIOError); - - return *this; } - if (i >= maxLen) + buf[nChar++] = c; + if (nChar == maxLen) { - buf[maxLen-1] = '\0'; buf[errLen] = '\0'; FatalIOErrorIn("ISstream::read(word&)", *this) - << "word '" << buf << "' ...\n" + << "word '" << buf << "...'\n" << " is too long (max. " << maxLen << " characters)" << exit(FatalIOError); return *this; } + } - if (c == token::BEGIN_LIST) - { - bc++; - } - else if (c == token::END_LIST) - { - bc--; + // we could probably skip this check + if (bad()) + { + buf[errLen] = buf[nChar] = '\0'; - if (bc == -1) - { - break; - } - } + FatalIOErrorIn("ISstream::read(word&)", *this) + << "problem while reading word '" << buf << "...' after " + << nChar << " characters\n" + << exit(FatalIOError); - buf[i++] = c; + return *this; } - if (i == 0) + if (nChar == 0) { FatalIOErrorIn("ISstream::read(word&)", *this) << "invalid first character found : " << c << exit(FatalIOError); } - buf[i] = '\0'; // Terminator + // done reading + buf[nChar] = '\0'; str = buf; putback(c); @@ -382,8 +404,6 @@ Foam::Istream& Foam::ISstream::read(string& str) if (!get(c)) { - buf[0] = '\0'; - FatalIOErrorIn("ISstream::read(string&)", *this) << "cannot read start of string" << exit(FatalIOError); @@ -391,36 +411,32 @@ Foam::Istream& Foam::ISstream::read(string& str) return *this; } - char endTok = token::END_STRING; - // Note, we could also handle single-quoted strings here (if desired) if (c != token::BEGIN_STRING) { - buf[0] = '\0'; - FatalIOErrorIn("ISstream::read(string&)", *this) - << "Incorrect start of string character" + << "Incorrect start of string character found : " << c << exit(FatalIOError); return *this; } - register int i = 0; + register int nChar = 0; bool escaped = false; while (get(c)) { - if (c == endTok) + if (c == token::END_STRING) { if (escaped) { escaped = false; - i--; // overwrite backslash + nChar--; // overwrite backslash } else { - // done reading string - buf[i] = '\0'; + // done reading + buf[nChar] = '\0'; str = buf; return *this; } @@ -430,12 +446,11 @@ Foam::Istream& Foam::ISstream::read(string& str) if (escaped) { escaped = false; - i--; // overwrite backslash + nChar--; // overwrite backslash } else { - buf[i] = '\0'; - buf[errLen] = '\0'; + buf[errLen] = buf[nChar] = '\0'; FatalIOErrorIn("ISstream::read(string&)", *this) << "found '\\n' while reading string \"" @@ -454,10 +469,9 @@ Foam::Istream& Foam::ISstream::read(string& str) escaped = false; } - buf[i] = c; - if (i++ == maxLen) + buf[nChar++] = c; + if (nChar == maxLen) { - buf[maxLen-1] = '\0'; buf[errLen] = '\0'; FatalIOErrorIn("ISstream::read(string&)", *this) @@ -471,8 +485,7 @@ Foam::Istream& Foam::ISstream::read(string& str) // don't worry about a dangling backslash if string terminated prematurely - buf[i] = '\0'; - buf[errLen] = '\0'; + buf[errLen] = buf[nChar] = '\0'; FatalIOErrorIn("ISstream::read(string&)", *this) << "problem while reading string \"" << buf << "...\"" diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index 16f216adf6f58368c4cce88ff19d875925917121..73a753157ea54880b08bcd30c2aef3c00dfe1920 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -60,8 +60,8 @@ Foam::argList::initValidTables dummyInitValidTables; // transform sequences with "(" ... ")" into string lists in the process bool Foam::argList::regroupArgv(int& argc, char**& argv) { - int level = 0; int nArgs = 0; + int listDepth = 0; string tmpString; // note: we also re-write directly into args_ @@ -70,16 +70,16 @@ bool Foam::argList::regroupArgv(int& argc, char**& argv) { if (strcmp(argv[argI], "(") == 0) { - level++; + listDepth++; tmpString += "("; } else if (strcmp(argv[argI], ")") == 0) { - if (level >= 1) + if (listDepth) { - level--; + listDepth--; tmpString += ")"; - if (level == 0) + if (listDepth == 0) { args_[nArgs++] = tmpString; tmpString.clear(); @@ -90,7 +90,7 @@ bool Foam::argList::regroupArgv(int& argc, char**& argv) args_[nArgs++] = argv[argI]; } } - else if (level) + else if (listDepth) { // quote each string element tmpString += "\""; diff --git a/src/Pstream/mpi/IPread.C b/src/Pstream/mpi/IPread.C index 2b6953765abadd555e2c2cf8ab10d2b82eb787b9..c08c6b56ab2430cea6d264e433e39ec0cb01a7a6 100644 --- a/src/Pstream/mpi/IPread.C +++ b/src/Pstream/mpi/IPread.C @@ -61,24 +61,38 @@ Foam::IPstream::IPstream MPI_Status status; + // Cannot use buf_.size() since appends a few bytes extra + label realBufSize = bufSize; + // If the buffer size is not specified, probe the incomming message // and set it if (!bufSize) { + if (commsType == nonBlocking) + { + FatalErrorIn + ( + "IPstream::IPstream(const commsTypes, const int, " + "const label, streamFormat, versionNumber)" + ) << "Can use nonBlocking mode only with pre-allocated buffers" + << Foam::abort(FatalError); + } + MPI_Probe(procID(fromProcNo_), msgType(), MPI_COMM_WORLD, &status); MPI_Get_count(&status, MPI_BYTE, &messageSize_); buf_.setSize(messageSize_); + realBufSize = buf_.size(); } - messageSize_ = read(commsType, fromProcNo_, buf_.begin(), buf_.size()); + messageSize_ = read(commsType, fromProcNo_, buf_.begin(), realBufSize); if (!messageSize_) { FatalErrorIn ( - "IPstream::IPstream(const int fromProcNo, " - "const label bufSize, streamFormat format, versionNumber version)" + "IPstream::IPstream(const commsTypes, const int, " + "const label, streamFormat, versionNumber)" ) << "read failed" << Foam::abort(FatalError); } @@ -173,7 +187,8 @@ Foam::label Foam::IPstream::read IPstream_outstandingRequests_.append(request); - return 1; + // Assume the message is completely received. + return bufSize; } else { diff --git a/src/triSurface/Make/options b/src/triSurface/Make/options index cd3f5ed69c3b97c7bd5a38c86e0a230089feb8f4..41306609f208806f0c6f42a2426867d3e10d4897 100644 --- a/src/triSurface/Make/options +++ b/src/triSurface/Make/options @@ -1,3 +1 @@ -EXE_INC = \ - -I$(WM_THIRD_PARTY_DIR)/zlib-1.2.3 - +EXE_INC = diff --git a/src/triSurface/triSurface/interfaces/OBJ/writeOBJ.C b/src/triSurface/triSurface/interfaces/OBJ/writeOBJ.C index 7207bdae325e2716e04b18382f105caf944433cc..300cdddf9571d3591371dc4f97643d6b38b98dc0 100644 --- a/src/triSurface/triSurface/interfaces/OBJ/writeOBJ.C +++ b/src/triSurface/triSurface/interfaces/OBJ/writeOBJ.C @@ -41,8 +41,8 @@ namespace Foam void triSurface::writeOBJ(const bool writeSorted, Ostream& os) const { // Write header - os << "# Wavefront OBJ file" << endl - << "# Regions:" << endl; + os << "# Wavefront OBJ file" << nl + << "# Regions:" << nl; labelList faceMap; @@ -54,13 +54,13 @@ void triSurface::writeOBJ(const bool writeSorted, Ostream& os) const forAll(myPatches, patchI) { os << "# " << patchI << " " - << myPatches[patchI].name() << endl; + << myPatches[patchI].name() << nl; } - os << "#" << endl; + os << "#" << nl; - os << "# points : " << ps.size() << endl - << "# triangles : " << size() << endl - << "#" << endl; + os << "# points : " << ps.size() << nl + << "# triangles : " << size() << nl + << "#" << nl; // Write vertex coords @@ -69,7 +69,7 @@ void triSurface::writeOBJ(const bool writeSorted, Ostream& os) const os << "v " << ps[pointi].x() << ' ' << ps[pointi].y() << ' ' - << ps[pointi].z() << endl; + << ps[pointi].z() << nl; } if (writeSorted) @@ -80,7 +80,7 @@ void triSurface::writeOBJ(const bool writeSorted, Ostream& os) const { // Print all faces belonging to this patch - os << "g " << myPatches[patchI].name() << endl; + os << "g " << myPatches[patchI].name() << nl; for ( @@ -96,20 +96,39 @@ void triSurface::writeOBJ(const bool writeSorted, Ostream& os) const << operator[](faceI)[1] + 1 << ' ' << operator[](faceI)[2] + 1 //<< " # " << operator[](faceI).region() - << endl; + << nl; } } } else { + // Get patch (=compact region) per face + labelList patchIDs(size()); + forAll(myPatches, patchI) + { + label faceI = myPatches[patchI].start(); + + forAll(myPatches[patchI], i) + { + patchIDs[faceMap[faceI++]] = patchI; + } + } + + + label prevPatchI = -1; + forAll(*this, faceI) { + if (prevPatchI != patchIDs[faceI]) + { + prevPatchI = patchIDs[faceI]; + os << "g " << myPatches[patchIDs[faceI]].name() << nl; + } os << "f " << operator[](faceI)[0] + 1 << ' ' << operator[](faceI)[1] + 1 << ' ' << operator[](faceI)[2] + 1 - //<< " # " << operator[](faceI).region() - << endl; + << nl; } } } diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C index 7bc772eead4b77ed37092e3b3ff3cc0abe913f05..c848c2b413524724643bf9d3033fa900ae1c27d0 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C @@ -70,8 +70,7 @@ tmp<scalarField> mutURoughWallFunctionFvPatchScalarField::calcYPlus // of the wall will depend on yPlus forAll(yPlus, facei) { - const scalar magUpara = magUp[facei]; - const scalar Re = rho[facei]*magUpara*y[facei]/muw[facei]; + const scalar Re = rho[facei]*magUp[facei]*y[facei]/muw[facei]; const scalar kappaRe = kappa_*Re; scalar yp = yPlusLam_; @@ -142,8 +141,7 @@ tmp<scalarField> mutURoughWallFunctionFvPatchScalarField::calcYPlus // Smooth Walls forAll(yPlus, facei) { - const scalar magUpara = magUp[facei]; - const scalar Re = rho[facei]*magUpara*y[facei]/muw[facei]; + const scalar Re = rho[facei]*magUp[facei]*y[facei]/muw[facei]; const scalar kappaRe = kappa_*Re; scalar yp = yPlusLam_; @@ -193,7 +191,8 @@ tmp<scalarField> mutURoughWallFunctionFvPatchScalarField::calcMut() const { if (yPlus[facei] > yPlusLam_) { - const scalar Re = rho[facei]*magUp[facei]*y[facei]/muw[facei]; + const scalar Re = + rho[facei]*magUp[facei]*y[facei]/muw[facei] + ROOTVSMALL; mutw[facei] = muw[facei]*(sqr(yPlus[facei])/Re - 1); } } diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C index 0fcfe72c4c7f0ea8e365abe4ab0d6b88c873244d..0c63d7c8a01b65f3eb0a8b6eca67395fca54880f 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C @@ -66,10 +66,9 @@ tmp<scalarField> mutUSpaldingWallFunctionFvPatchScalarField::calcUTau forAll(mutw, faceI) { - scalar magUpara = magUp[faceI]; - scalar ut = - sqrt((mutw[faceI] + muw[faceI])*magGradU[faceI]/rhow[faceI]); + sqrt((mutw[faceI] + muw[faceI])*magGradU[faceI]/rhow[faceI]) + + ROOTVSMALL; if (ut > VSMALL) { @@ -78,17 +77,17 @@ tmp<scalarField> mutUSpaldingWallFunctionFvPatchScalarField::calcUTau do { - scalar kUu = min(kappa_*magUpara/ut, 50); + scalar kUu = min(kappa_*magUp[faceI]/ut, 50); scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu); scalar f = - ut*y[faceI]/(muw[faceI]/rhow[faceI]) - + magUpara/ut + + magUp[faceI]/ut + 1/E_*(fkUu - 1.0/6.0*kUu*sqr(kUu)); scalar df = y[faceI]/(muw[faceI]/rhow[faceI]) - + magUpara/sqr(ut) + + magUp[faceI]/sqr(ut) + 1/E_*kUu*fkUu/ut; scalar uTauNew = ut + f/df; @@ -111,7 +110,7 @@ tmp<scalarField> mutUSpaldingWallFunctionFvPatchScalarField::calcMut() const const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magGradU = mag(Uw.snGrad()); + const scalarField magGradU = mag(Uw.snGrad()) + ROOTVSMALL; const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; const scalarField& muw = rasModel.mu().boundaryField()[patchI]; diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C index a85c647467c5fd0766dc220008a587fc39a5237e..c202ac479c8e3c71f3a9d2fb744cd853e6e4975e 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C @@ -63,7 +63,7 @@ tmp<scalarField> nutURoughWallFunctionFvPatchScalarField::calcNut() const { if (yPlus[facei] > yPlusLam_) { - const scalar Re = magUp[facei]*y[facei]/nuw[facei]; + const scalar Re = magUp[facei]*y[facei]/nuw[facei] + ROOTVSMALL; nutw[facei] = nuw[facei]*(sqr(yPlus[facei])/Re - 1); } } diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C index f24001bc6e83b6e2d91b0288124c413f3e3cc0f5..4adf3227abafcb93694e80fe78c71127f0fe1e53 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C @@ -47,7 +47,7 @@ tmp<scalarField> nutUSpaldingWallFunctionFvPatchScalarField::calcNut() const const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magGradU = mag(Uw.snGrad()); + const scalarField magGradU = mag(Uw.snGrad()) + ROOTVSMALL; const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; return max(scalar(0), sqr(calcUTau(magGradU))/magGradU - nuw); @@ -74,9 +74,8 @@ tmp<scalarField> nutUSpaldingWallFunctionFvPatchScalarField::calcUTau forAll(uTau, facei) { - scalar magUpara = magUp[facei]; - - scalar ut = sqrt((nutw[facei] + nuw[facei])*magGradU[facei]); + scalar ut = + sqrt((nutw[facei] + nuw[facei])*magGradU[facei]) + ROOTVSMALL; if (ut > VSMALL) { @@ -85,17 +84,17 @@ tmp<scalarField> nutUSpaldingWallFunctionFvPatchScalarField::calcUTau do { - scalar kUu = min(kappa_*magUpara/ut, 50); + scalar kUu = min(kappa_*magUp[facei]/ut, 50); scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu); scalar f = - ut*y[facei]/nuw[facei] - + magUpara/ut + + magUp[facei]/ut + 1/E_*(fkUu - 1.0/6.0*kUu*sqr(kUu)); scalar df = y[facei]/nuw[facei] - + magUpara/sqr(ut) + + magUp[facei]/sqr(ut) + 1/E_*kUu*fkUu/ut; scalar uTauNew = ut + f/df; @@ -103,6 +102,7 @@ tmp<scalarField> nutUSpaldingWallFunctionFvPatchScalarField::calcUTau ut = uTauNew; } while (ut > VSMALL && err > 0.01 && ++iter < 10); + uTau[facei] = max(0.0, ut); } } diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/T b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/T new file mode 100644 index 0000000000000000000000000000000000000000..c15520f99480bc62f8cee42c8c9682936da065f4 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/T @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 293; + +boundaryField +{ + frontAndBack + { + type zeroGradient; + } + + topAndBottom + { + type zeroGradient; + } + + hot + { + type fixedValue; + value uniform 307.75; // 34.6 degC + } + + cold + { + type fixedValue; + value uniform 288.15; // 15 degC + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/U b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/U new file mode 100644 index 0000000000000000000000000000000000000000..3e850b913b8e4e22f89efb090f72b55cc95df55b --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/U @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ 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 +{ + frontAndBack + { + type fixedValue; + value uniform (0 0 0); + } + + topAndBottom + { + type fixedValue; + value uniform (0 0 0); + } + + hot + { + type fixedValue; + value uniform (0 0 0); + } + + cold + { + type fixedValue; + value uniform (0 0 0); + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/alphat b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/alphat new file mode 100644 index 0000000000000000000000000000000000000000..5addae2ddf1b5d228badc933f2fb84cd66b08ce5 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/alphat @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alphat; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + frontAndBack + { + type compressible::alphatWallFunction; + Prt 0.85; + value uniform 0; + } + topAndBottom + { + type compressible::alphatWallFunction; + Prt 0.85; + value uniform 0; + } + hot + { + type compressible::alphatWallFunction; + Prt 0.85; + value uniform 0; + } + cold + { + type compressible::alphatWallFunction; + Prt 0.85; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/epsilon b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/epsilon new file mode 100644 index 0000000000000000000000000000000000000000..f4a2099bc87c9d1022d0aaa8b7008678598febab --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/epsilon @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 4e-06; + +boundaryField +{ + frontAndBack + { + type compressible::epsilonWallFunction; + value uniform 4e-06; + } + topAndBottom + { + type compressible::epsilonWallFunction; + value uniform 4e-06; + } + hot + { + type compressible::epsilonWallFunction; + value uniform 4e-06; + } + cold + { + type compressible::epsilonWallFunction; + value uniform 4e-06; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/k b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/k new file mode 100644 index 0000000000000000000000000000000000000000..eb1640eabda9510a6d36314b37211ebce555eb11 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/k @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 3.75e-04; + +boundaryField +{ + frontAndBack + { + type compressible::kqRWallFunction; + value uniform 3.75e-04; + } + topAndBottom + { + type compressible::kqRWallFunction; + value uniform 3.75e-04; + } + hot + { + type compressible::kqRWallFunction; + value uniform 3.75e-04; + } + cold + { + type compressible::kqRWallFunction; + value uniform 3.75e-04; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/mut b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/mut new file mode 100644 index 0000000000000000000000000000000000000000..1ce1d05f30d11af07738917ea15dacd55d7e3435 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/mut @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object mut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + frontAndBack + { + type mutUWallFunction; + value uniform 0; + } + topAndBottom + { + type mutUWallFunction; + value uniform 0; + } + hot + { + type mutUWallFunction; + value uniform 0; + } + cold + { + type mutUWallFunction; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/omega b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/omega new file mode 100644 index 0000000000000000000000000000000000000000..f1b0c5bfbfb05f6aad7e25b06f811d081ae7e427 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/omega @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object omega; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 -1 0 0 0 0]; + +internalField uniform 0.12; + +boundaryField +{ + frontAndBack + { + type compressible::omegaWallFunction; + value uniform 0.12; + } + topAndBottom + { + type compressible::omegaWallFunction; + value uniform 0.12; + } + hot + { + type compressible::omegaWallFunction; + value uniform 0.12; + } + cold + { + type compressible::omegaWallFunction; + value uniform 0.12; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/p b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/p new file mode 100644 index 0000000000000000000000000000000000000000..19224ed2b042a1d302968794cc34529c1300e58a --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/p @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + frontAndBack + { + type buoyantPressure; + value uniform 1e5; + } + + topAndBottom + { + type buoyantPressure; + value uniform 1e5; + } + + hot + { + type buoyantPressure; + value uniform 1e5; + } + + cold + { + type buoyantPressure; + value uniform 1e5; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/Allclean b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..c5ab4caba94811d29469e8e18c311acbcdd7d69c --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/Allclean @@ -0,0 +1,7 @@ +#!/bin/sh +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase +rm -rf sets +(cd validation && rm -f *.eps) diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/Allrun b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..5a8beb93c57efb85cfe982b15205321c64249a67 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/Allrun @@ -0,0 +1,11 @@ +#!/bin/sh +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +# Set application name +application="buoyantSimpleFoam" + +runApplication blockMesh +runApplication $application +runApplication sample -latestTime +(cd validation && ./createGraphs) diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/RASProperties b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/RASProperties new file mode 100644 index 0000000000000000000000000000000000000000..8abafb5ce5cf041f2557f35504df2a499bfe75b7 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/RASProperties @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel kOmegaSST; + +turbulence on; + +printCoeffs on; + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/g b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/g new file mode 100644 index 0000000000000000000000000000000000000000..27d4d324881b52b2a37d45b4cfbed46ed94d8051 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/g @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value ( 0 -9.81 0 ); + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/polyMesh/blockMeshDict b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..318288028686d750f4296b265ae9d58b23ce7f34 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/polyMesh/blockMeshDict @@ -0,0 +1,68 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 0.001; + +vertices +( + ( 0 0 -260) + (76 0 -260) + (76 2180 -260) + ( 0 2180 -260) + ( 0 0 260) + (76 0 260) + (76 2180 260) + ( 0 2180 260) +); + +edges +( +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (35 150 15) simpleGrading (1 1 1) +); + +patches +( + wall frontAndBack + ( + (0 1 5 4) + (2 3 7 6) + ) + + wall topAndBottom + ( + (4 5 6 7) + (3 2 1 0) + ) + + wall hot + ( + (6 5 1 2) + ) + + wall cold + ( + (4 7 3 0) + ) +); + +mergePatchPairs +( +); + diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/polyMesh/boundary b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/polyMesh/boundary new file mode 100644 index 0000000000000000000000000000000000000000..3d13809c69fb293defe12d6b57e7948511a2aa96 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/polyMesh/boundary @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +4 +( + frontAndBack + { + type wall; + nFaces 1050; + startFace 228225; + } + topAndBottom + { + type wall; + nFaces 10500; + startFace 229275; + } + hot + { + type wall; + nFaces 2250; + startFace 239775; + } + cold + { + type wall; + nFaces 2250; + startFace 242025; + } +) + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/thermophysicalProperties new file mode 100644 index 0000000000000000000000000000000000000000..6f5a818e17daaa710530bcf2d17628d8f1a71fd5 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/thermophysicalProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; + +mixture air 1 28.96 1004.4 0 1.831e-05 0.705; + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/controlDict b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..aecc274b4b029c6919585ee2ac06f48eac7f972e --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/controlDict @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application buoyantSimpleFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 1000; + +deltaT 1; + +writeControl timeStep; + +writeInterval 50; + +purgeWrite 3; + +writeFormat ascii; + +writePrecision 6; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..517ebe571ff909252e2a8706f196144db76d11f5 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSchemes @@ -0,0 +1,66 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss limitedLinear 0.2; + div(phi,h) Gauss limitedLinear 0.2; + div(phi,k) Gauss limitedLinear 0.2; + div(phi,epsilon) Gauss limitedLinear 0.2; + div(phi,omega) Gauss limitedLinear 0.2; + div((muEff*dev2(grad(U).T()))) Gauss linear; +} + +laplacianSchemes +{ + default none; + laplacian(muEff,U) Gauss linear uncorrected; + laplacian((rho*(1|A(U))),p) Gauss linear uncorrected; + laplacian(alphaEff,h) Gauss linear uncorrected; + laplacian(DkEff,k) Gauss linear uncorrected; + laplacian(DepsilonEff,epsilon) Gauss linear uncorrected; + laplacian(DomegaEff,omega) Gauss linear uncorrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default uncorrected; +} + +fluxRequired +{ + default no; + p; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSolution b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..451f5da1aa16dc28ff7cc1e0e9ed9b9b696034b7 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSolution @@ -0,0 +1,60 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver GAMG; + tolerance 1e-7; + relTol 0.1; + + smoother DICGaussSeidel; + + cacheAgglomeration true; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + } + + "(U|h|k|epsilon|omega)" + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-8; + relTol 0.1; + } +} + +SIMPLE +{ + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 100000; + convergence 1e-04; +} + +relaxationFactors +{ + p 0.3; + U 0.7; + h 0.7; + "(k|epsilon|omega)" 0.7; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/sampleDict b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/sampleDict new file mode 100644 index 0000000000000000000000000000000000000000..b095bf050377bce46b7b0e6e846754e036c67917 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/sampleDict @@ -0,0 +1,100 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object sampleDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +interpolationScheme cellPointFace; + +setFormat raw; + +sets +( + y0.1 + { + type face; + axis x; + start (-1 0.218 0); + end (1 0.218 0); + } + y0.2 + { + type face; + axis x; + start (-1 0.436 0); + end (1 0.436 0); + } + y0.3 + { + type face; + axis x; + start (-1 0.654 0); + end (1 0.654 0); + } + y0.4 + { + type face; + axis x; + start (-1 0.872 0); + end (1 0.872 0); + } + y0.5 + { + type face; + axis x; + start (-1 1.09 0); + end (1 1.09 0); + } + y0.6 + { + type face; + axis x; + start (-1 1.308 0); + end (1 1.308 0); + } + y0.7 + { + type face; + axis x; + start (-1 1.526 0); + end (1 1.526 0); + } + y0.8 + { + type face; + axis x; + start (-1 1.744 0); + end (1 1.744 0); + } + y0.9 + { + type face; + axis x; + start (-1 1.962 0); + end (1 1.962 0); + } +); + +surfaces (); + +fields +( + T + U +); + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/createGraphs b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/createGraphs new file mode 100755 index 0000000000000000000000000000000000000000..74eadd7127105f690ce6101f03c3a8b4c6125d85 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/createGraphs @@ -0,0 +1,115 @@ +#!/bin/sh +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. +# \\/ 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 2 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, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +# Script +# createGraphs +# +# Description +# Creates .eps graphs of OpenFOAM results vs experiment for the buoyant +# cavity case +# +#------------------------------------------------------------------------------ + +createEpsT() { + index=$1 + OF=$2 + EXPT=$3 + + gnuplot<<EOF + set terminal postscript eps color enhanced + set output "OF_vs_EXPT_T$i.eps" + set xlabel "Channel width, x / [m]" + set ylabel "Temperature / [K]" + set grid + set key left top + set size 0.6, 0.6 + set xrange [0:0.08] + set yrange [285:310] + plot \ + "$EXPT" u (\$1/1000):(\$2+273.15) title "Expt 0.$index" with points lt 1 pt 6, \ + "$OF" title "OpenFOAM 0.$index" with lines linetype -1 +EOF +} + + +createEpsU() { + index=$1 + OF=$2 + EXPT=$3 + + gnuplot<<EOF + set terminal postscript eps color enhanced + set output "OF_vs_EXPT_U$i.eps" + set xlabel "Channel width, x / [m]" + set ylabel "Vertical velocity component, Uy / [m/s]" + set grid + set key left top + set size 0.6, 0.6 + set xrange [0:0.08] + set yrange [-0.2:0.2] + plot \ + "$EXPT" u (\$1/1000):(\$2) title "Expt 0.$index" with points lt 1 pt 6, \ + "$OF" u 1:3 title "OpenFOAM 0.$index" with lines linetype -1 +EOF +} + + +# test if gnuplot exists on the system +type -P gnuplot &>/dev/null || { + echo "gnuplot not found - skipping graph creation" >&2; exit 1; +} + +# paths to data +LATESTTIME=`ls ../sets` +OFDATAROOT=../sets/$LATESTTIME + +EXPTDATAROOT=./exptData + +# generate temperature profiles +TSets="1 3 4 5 6 7 9" +for i in $TSets; do + echo " processing temperature profile at y/yMax of 0.$i" + + OF="$OFDATAROOT/y0.${i}_T.xy" + EXPT="$EXPTDATAROOT/mt_z0_${i}0_lo.dat" + + createEpsT $i $OF $EXPT +done + + +# generate velocity profiles +USets="1 3 4 5 6 7 9" +for i in $USets; do + echo " processing velocity profile at y/yMax of 0.$i" + + OF="$OFDATAROOT/y0.${i}_U.xy" + EXPT="$EXPTDATAROOT/mv_z0_${i}0_lo.dat" + + createEpsU $i $OF $EXPT +done + +echo "done" + +#------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mt_z0_10_lo.dat b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mt_z0_10_lo.dat new file mode 100644 index 0000000000000000000000000000000000000000..f89c5756bb4fa7ff605738145717b42ad845f0ba --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mt_z0_10_lo.dat @@ -0,0 +1,55 @@ +# Natural Convection in Tall Cavity: Ra=8.6E+5 +# Expts of Betts and Bokhari +# Mean temperature profile through z=0, y/H=0.10 +# x (mm) T (deg C) + 0.33 15.13 + 0.58 15.38 + 0.84 15.65 + 1.09 15.82 + 1.6 16.29 + 2.11 16.72 + 2.61 17.15 + 3.25 17.44 + 3.88 17.79 + 5.15 18.37 + 6.42 18.72 + 7.69 19.04 + 8.96 19.14 + 10.23 19.57 + 11.5 19.62 + 12.77 19.8 + 15.31 20.02 + 17.85 20.23 + 20.39 20.46 + 22.93 20.48 + 25.47 20.48 + 28.01 20.67 + 30.55 20.69 + 33.09 20.71 + 35.63 20.87 + 38.17 20.79 +# 40.57 24.66 spurious value + 43.11 20.73 +# 45.65 25.36 spurious value + 48.19 20.87 +# 50.73 25.62 spurious value + 53.27 20.93 +# 55.81 26.09 spurious value + 58.35 21.25 + 60.89 21.29 + 63.43 21.72 + 64.7 21.77 + 65.97 22.52 + 67.24 23.09 + 68.51 23.87 + 69.78 24.99 + 71.05 26.42 + 72.32 28.32 + 72.95 29.14 + 73.59 30.1 + 74.09 31.15 + 74.6 32.06 + 75.11 33.15 + 75.36 33.52 + 75.62 33.99 + 75.87 34.6 diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mt_z0_30_lo.dat b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mt_z0_30_lo.dat new file mode 100644 index 0000000000000000000000000000000000000000..499d599acaf7e6c4d9f07884d95474fa3fdfde15 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mt_z0_30_lo.dat @@ -0,0 +1,51 @@ +# Natural Convection in Tall Cavity: Ra=8.6E+5 +# Expts of Betts and Bokhari +# Mean temperature profile through z=0, y/H=0.30 +# x (mm) T (deg C) + 0.33 15.4 + 0.58 15.81 + 0.84 16.52 + 1.09 16.52 + 1.6 17.24 + 2.11 17.98 + 2.61 18.5 + 3.25 18.89 + 3.88 19.55 + 5.15 20.56 + 6.42 20.84 + 7.69 21.49 + 8.96 21.69 + 10.23 21.97 + 11.5 22.07 + 12.77 22.52 + 15.31 22.64 + 17.85 23.17 + 20.39 23.31 + 22.93 23.61 + 25.47 23.51 + 28.01 23.79 + 30.55 24.38 + 33.09 24.28 + 35.63 24.81 + 38.17 25.09 + 43.11 25.01 + 48.19 25.44 + 53.27 25.76 + 58.35 26.33 + 60.89 26.79 + 63.43 27.2 + 64.7 27.32 + 65.97 27.4 + 67.24 27.87 + 68.51 28.04 + 69.78 28.5 + 71.05 29.03 + 72.32 29.72 + 72.95 30.41 + 73.59 31.27 + 74.09 31.6 + 74.6 32.55 + 75.11 33.3 + 75.36 33.52 + 75.62 34.14 + 75.87 34.43 diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mt_z0_40_lo.dat b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mt_z0_40_lo.dat new file mode 100644 index 0000000000000000000000000000000000000000..1ecdbccd8f7ec4945ae33bacfddfc75bfa6ac5d9 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mt_z0_40_lo.dat @@ -0,0 +1,55 @@ +# Natural Convection in Tall Cavity: Ra=8.6E+5 +# Expts of Betts and Bokhari +# Mean temperature profile through z=0, y/H=0.40 +# x (mm) T (deg C) + 0.33 15.55 + 0.58 16.03 + 0.84 16.45 + 1.09 16.98 + 1.6 17.53 + 2.11 18.1 + 2.61 18.71 + 3.25 19.68 + 3.88 19.88 + 5.15 20.78 + 6.42 21.44 + 7.69 21.47 + 8.96 22.13 + 10.23 22.48 + 11.5 22.64 + 12.77 22.87 + 15.31 23.09 + 17.85 23.42 + 20.39 23.9 + 22.93 23.84 + 25.47 24.18 + 28.01 24.26 + 30.55 24.67 + 33.09 25.08 + 35.63 25.29 + 38.17 25.3 + 40.57 25.12 + 43.11 25.4 + 45.65 25.69 + 48.19 25.92 + 50.73 25.95 + 53.27 26.07 + 55.81 26.77 + 58.35 26.75 + 60.89 27.02 + 63.43 27.61 + 64.7 27.51 + 65.97 27.8 + 67.24 28.21 + 68.51 28.32 + 69.78 28.94 + 71.05 29.36 + 72.32 30.26 + 72.95 30.74 + 73.59 31.16 + 74.09 31.82 + 74.6 32.28 + 75.11 33.09 + 75.36 33.47 + 75.62 33.92 + 75.87 34.16 diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mt_z0_50_lo.dat b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mt_z0_50_lo.dat new file mode 100644 index 0000000000000000000000000000000000000000..c0784b2a16f7ce9640325b23eb4492c8215c8540 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mt_z0_50_lo.dat @@ -0,0 +1,55 @@ +# Natural Convection in Tall Cavity: Ra=8.6E+5 +# Expts of Betts and Bokhari +# Mean temperature profile through z=0, y/H=0.50 +# x (mm) T (deg C) + 0.33 15.62 + 0.58 15.94 + 0.84 16.45 + 1.09 16.78 + 1.6 17.58 + 2.11 18.48 + 2.61 19.05 + 3.25 19.43 + 3.88 19.96 + 5.15 20.46 + 6.42 21.32 + 7.69 21.74 + 8.96 22.01 + 10.23 22.21 + 11.5 22.53 + 12.77 22.74 + 15.31 23.02 + 17.85 23.35 + 20.39 23.76 + 22.93 23.69 + 25.47 24.17 + 28.01 24.25 + 30.55 25.08 + 33.09 25.15 + 35.63 25.33 + 38.17 25.26 + 40.57 25.23 + 43.11 25.57 + 45.65 25.92 + 48.19 26.12 + 50.73 25.87 + 53.27 26.3 + 55.81 26.55 + 58.35 26.99 + 60.89 27.05 + 63.43 27.53 + 64.7 27.65 + 65.97 27.77 + 67.24 27.71 + 68.51 28.38 + 69.78 28.61 + 71.05 29.44 + 72.32 30.06 + 72.95 30.5 + 73.59 31.12 + 74.09 31.66 + 74.6 32.37 + 75.11 33.08 + 75.36 33.37 + 75.62 33.94 + 75.87 34.21 diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mt_z0_60_lo.dat b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mt_z0_60_lo.dat new file mode 100644 index 0000000000000000000000000000000000000000..0d8d74f538572ec2ec4316bc12346c89ad6df20b --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mt_z0_60_lo.dat @@ -0,0 +1,49 @@ +# Natural Convection in Tall Cavity: Ra=8.6E+5 +# Expts of Betts and Bokhari +# Mean temperature profile through z=0, y/H=0.60 +# x (mm) T (deg C) + 0.33 15.59 + 0.58 16.15 + 0.84 16.44 + 1.09 16.81 + 1.6 17.52 + 2.11 18.15 + 2.61 18.89 + 3.25 19.63 + 3.88 20.03 + 5.15 20.75 + 6.42 21.11 + 7.69 21.5 + 8.96 21.94 + 10.23 22.51 + 11.5 22.56 + 12.77 22.92 + 15.31 23.27 + 17.85 23.66 + 20.39 23.96 + 22.93 24.01 + 28.01 24.57 + 33.09 25.16 + 38.17 24.98 + 43.11 25.57 + 48.19 25.95 + 53.27 26.32 + 55.81 26.71 + 58.35 27.13 + 60.89 27.12 + 63.43 27.51 + 64.7 27.84 + 65.97 28.2 + 67.24 28.2 + 68.51 28.43 + 69.78 28.76 + 71.05 29.4 + 72.32 29.86 + 72.95 30.7 + 73.59 31.43 + 74.09 31.72 + 74.6 32.47 + 75.11 33.07 + 75.36 33.45 + 75.62 33.95 + 75.87 34.23 diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mt_z0_70_lo.dat b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mt_z0_70_lo.dat new file mode 100644 index 0000000000000000000000000000000000000000..c50c726cbcc22bca85698964a99337a7335a5985 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mt_z0_70_lo.dat @@ -0,0 +1,55 @@ +# Natural Convection in Tall Cavity: Ra=8.6E+5 +# Expts of Betts and Bokhari +# Mean temperature profile through z=0, y/H=0.70 +# x (mm) T (deg C) + 0.33 15.84 + 0.58 16.3 + 0.84 16.61 + 1.09 16.92 + 1.6 17.9 + 2.11 18.77 + 2.61 19.1 + 3.25 20.04 + 3.88 20.44 + 5.15 21.13 + 6.42 21.78 + 7.69 22.22 + 8.96 22.46 + 10.23 22.94 + 11.5 23.11 + 12.77 23.45 + 15.31 23.51 + 17.85 24.08 + 20.39 24.32 + 22.93 24.44 + 25.47 24.98 + 28.01 24.88 + 30.55 24.81 + 33.09 25.3 + 35.63 25.5 + 38.17 25.38 + 40.57 25.65 + 43.11 25.94 + 45.65 26.25 + 48.19 26.41 + 50.73 26.65 + 53.27 26.96 + 55.81 27.16 + 58.35 27.46 + 60.89 27.6 + 63.43 27.7 + 64.7 27.84 + 65.97 28.24 + 67.24 28.58 + 68.51 28.87 + 69.78 29.1 + 71.05 29.75 + 72.32 30.4 + 72.95 30.62 + 73.59 31.37 + 74.09 32.07 + 74.6 32.38 + 75.11 33.3 + 75.36 33.6 + 75.62 34.13 + 75.87 34.37 diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mt_z0_90_lo.dat b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mt_z0_90_lo.dat new file mode 100644 index 0000000000000000000000000000000000000000..b59b04e5c2f1003e26e0a3db2593d025b8da4174 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mt_z0_90_lo.dat @@ -0,0 +1,55 @@ +# Natural Convection in Tall Cavity: Ra=8.6E+5 +# Expts of Betts and Bokhari +# Mean temperature profile through z=0, y/H=0.90 +# x (mm) T (deg C) + 0.33 15.61 + 0.58 16.32 + 0.84 16.8 + 1.09 17.38 + 1.6 18.36 + 2.11 19.52 + 2.61 20.39 + 3.25 21.64 + 3.88 22.49 + 5.15 24.23 + 6.42 25.68 + 7.69 26.84 + 8.96 27.48 + 10.23 28.1 + 11.5 28.55 + 12.77 28.97 + 15.31 29.26 + 17.85 29.52 + 20.39 29.53 + 22.93 29.54 + 25.47 29.55 + 28.01 29.6 + 30.55 29.67 + 33.09 29.71 + 35.63 29.74 + 38.17 29.73 + 40.57 29.93 + 43.11 29.99 + 45.65 30.07 + 48.19 30.1 + 50.73 30.12 + 53.27 30.18 + 55.81 30.29 + 58.35 30.4 + 60.89 30.57 + 63.43 30.69 + 64.7 30.85 + 65.97 31.02 + 67.24 31.19 + 68.51 31.48 + 69.78 31.68 + 71.05 32.06 + 72.32 32.52 + 72.95 32.77 + 73.59 33.2 + 74.09 33.49 + 74.6 33.78 + 75.11 34.19 + 75.36 34.38 + 75.62 34.6 + 75.87 34.77 diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mv_z0_10_lo.dat b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mv_z0_10_lo.dat new file mode 100644 index 0000000000000000000000000000000000000000..a86a625a15c04dfe6da57cdc73a98612cc25f9a4 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mv_z0_10_lo.dat @@ -0,0 +1,34 @@ +# Natural Convection in Tall Cavity: Ra=8.6E+5 +# Expts of Betts and Bokhari +# Vertical mean velocity profile through z=0, y/H=0.10 +# x (mm) V (m/s) + 1.5 -0.049 + 3.5 -0.086 + 5.5 -0.095 + 7.5 -0.101 + 9.5 -0.098 + 10.5 -0.096 + 12.5 -0.087 + 14.5 -0.081 + 16.5 -0.078 + 18.5 -0.07 + 20.5 -0.064 + 25.5 -0.052 + 30.5 -0.044 + 35.5 -0.028 + 38.2 -0.019 + 43.2 -0.011 + 48.2 0.003 + 53.2 0.023 + 58.2 0.038 + 60.2 0.055 + 62.2 0.07 + 64.2 0.09 + 66.2 0.121 + 68.2 0.151 + 69.2 0.168 + 70.2 0.18 + 71.2 0.19 + 72.2 0.192 + 73.2 0.193 + 74.2 0.16 diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mv_z0_30_lo.dat b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mv_z0_30_lo.dat new file mode 100644 index 0000000000000000000000000000000000000000..56cc9ec06566f8941c245bafab3cc3966c72537b --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mv_z0_30_lo.dat @@ -0,0 +1,33 @@ +# Natural Convection in Tall Cavity: Ra=8.6E+5 +# Expts of Betts and Bokhari +# Vertical mean velocity profile through z=0, y/H=0.30 +# x (mm) V (m/s) + 3 -0.114 + 5 -0.123 + 7 -0.131 + 8 -0.135 + 9 -0.129 + 10 -0.121 + 12 -0.11 + 14 -0.099 + 16 -0.09 + 18 -0.08 + 23 -0.059 + 28 -0.043 + 33 -0.02 + 38 -0.006 + 43 0.016 + 48 0.051 + 51.2 0.063 + 56.2 0.092 + 58.2 0.097 + 60.2 0.105 + 62.2 0.118 + 64.2 0.124 + 66.2 0.132 + 68.2 0.136 + 70.2 0.142 + 71.2 0.141 + 72.2 0.14 + 73.2 0.121 + 74.2 0.089 diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mv_z0_40_lo.dat b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mv_z0_40_lo.dat new file mode 100644 index 0000000000000000000000000000000000000000..3cd97eceb6b3b7cf6db53b1522987fdcc9ae2d01 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mv_z0_40_lo.dat @@ -0,0 +1,32 @@ +# Natural Convection in Tall Cavity: Ra=8.6E+5 +# Expts of Betts and Bokhari +# Vertical mean velocity profile through z=0, y/H=0.40 +# x (mm) V (m/s) + 2.2 -0.101 + 3.2 -0.119 + 4.2 -0.123 + 6.2 -0.127 + 8.2 -0.123 + 10.2 -0.121 + 12.2 -0.113 + 14.2 -0.1 + 16.2 -0.088 + 18.2 -0.08 + 23.2 -0.065 + 28.2 -0.036 + 33.2 -0.008 + 38.2 0.006 + 43.2 0.018 + 48.2 0.047 + 53.2 0.063 + 58.2 0.077 + 60.2 0.097 + 62.2 0.104 + 64.2 0.117 + 66.2 0.124 + 68.2 0.133 + 69.2 0.137 + 70.2 0.146 + 71.2 0.137 + 72.2 0.131 + 73.2 0.125 diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mv_z0_50_lo.dat b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mv_z0_50_lo.dat new file mode 100644 index 0000000000000000000000000000000000000000..4780933d18f16e1fee090352205cb25579d948ff --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mv_z0_50_lo.dat @@ -0,0 +1,32 @@ +# Natural Convection in Tall Cavity: Ra=8.6E+5 +# Expts of Betts and Bokhari +# Vertical mean velocity profile through z=0, y/H=0.50 +# x (mm) V (m/s) + 1.2 -0.081 + 2.2 -0.115 + 3.2 -0.124 + 4.2 -0.133 + 6.2 -0.135 + 8.2 -0.134 + 10.2 -0.12 + 12.2 -0.112 + 14.2 -0.11 + 16.2 -0.1 + 18.2 -0.089 + 23.2 -0.062 + 28.2 -0.048 + 33.2 -0.011 + 38.2 0.012 + 43.2 0.041 + 48.2 0.054 + 53.2 0.077 + 58.2 0.091 + 60.2 0.099 + 62.2 0.106 + 64.2 0.12 + 66.2 0.127 + 68.2 0.133 + 70.2 0.137 + 71.2 0.14 + 72.2 0.131 + 73.2 0.121 diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mv_z0_60_lo.dat b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mv_z0_60_lo.dat new file mode 100644 index 0000000000000000000000000000000000000000..e56a31ad2fd57823369319887df50782a69ad420 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mv_z0_60_lo.dat @@ -0,0 +1,30 @@ +# Natural Convection in Tall Cavity: Ra=8.6E+5 +# Expts of Betts and Bokhari +# Vertical mean velocity profile through z=0, y/H=0.60 +# x (mm) V (m/s) + 3 -0.12 + 4 -0.137 + 5 -0.144 + 7 -0.134 + 8 -0.122 + 9 -0.116 + 11 -0.107 + 13 -0.09 + 17 -0.072 + 22 -0.058 + 27 -0.041 + 32 -0.014 + 37 -0.003 + 43.2 0.029 + 48.2 0.05 + 53.2 0.066 + 58.2 0.083 + 60.2 0.093 + 62.2 0.105 + 64.2 0.116 + 66.2 0.124 + 69.2 0.132 + 71.2 0.139 + 72.2 0.121 + 73.2 0.11 + 74.2 0.099 diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mv_z0_70_lo.dat b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mv_z0_70_lo.dat new file mode 100644 index 0000000000000000000000000000000000000000..594915389297d0ff3595aff24a468aad972675c3 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mv_z0_70_lo.dat @@ -0,0 +1,31 @@ +# Natural Convection in Tall Cavity: Ra=8.6E+5 +# Expts of Betts and Bokhari +# Vertical mean velocity profile through z=0, y/H=0.70 +# x (mm) V (m/s) + 1.2 -0.069 + 2.2 -0.106 + 4.2 -0.137 + 6.2 -0.15 + 8.2 -0.141 + 10.2 -0.135 + 12.2 -0.134 + 14.2 -0.109 + 16.2 -0.102 + 18.2 -0.101 + 23.2 -0.065 + 28.2 -0.044 + 33.2 -0.025 + 38.2 0.017 + 43.2 0.039 + 48.2 0.057 + 53.2 0.08 + 58.2 0.095 + 60.2 0.112 + 62.2 0.112 + 64.2 0.128 + 66.2 0.128 + 68.2 0.128 + 70.2 0.131 + 72.2 0.118 + 73.2 0.103 + 74.2 0.094 diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mv_z0_90_lo.dat b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mv_z0_90_lo.dat new file mode 100644 index 0000000000000000000000000000000000000000..96822cf415a7b14c3bcc20cfb65292154fd711aa --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/exptData/mv_z0_90_lo.dat @@ -0,0 +1,38 @@ +# Natural Convection in Tall Cavity: Ra=8.6E+5 +# Expts of Betts and Bokhari +# Vertical mean velocity profile through z=0, y/H=0.90 +# x (mm) V (m/s) + 1.7 -0.14 + 2.7 -0.172 + 3.7 -0.18 + 4.7 -0.179 + 5.7 -0.164 + 6.7 -0.15 + 7.7 -0.133 + 8.7 -0.122 + 10.7 -0.09 + 12.7 -0.067 + 14.7 -0.051 + 16.7 -0.036 + 18.7 -0.025 + 23.7 -0.006 + 28.7 0.012 + 33.7 0.02 + 38.7 0.032 + 43.7 0.04 + 48.7 0.058 + 53.7 0.067 + 58.7 0.08 + 60.7 0.088 + 62.7 0.09 + 64.7 0.096 + 65.7 0.097 + 66.7 0.101 + 67.7 0.102 + 68.7 0.103 + 69.7 0.102 + 70.7 0.096 + 71.7 0.089 + 72.7 0.085 + 73.7 0.069 + 74.7 0.052