mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge commit 'OpenCFD/master' into olesenm
This commit is contained in:
@ -124,11 +124,6 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
tmp<volScalarField> mut() const
|
||||
{
|
||||
return mut_;
|
||||
}
|
||||
|
||||
//- Return the effective diffusivity for k
|
||||
tmp<volScalarField> DkEff() const
|
||||
{
|
||||
@ -147,41 +142,44 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//- Return the effective turbulent thermal diffusivity
|
||||
tmp<volScalarField> alphaEff() const
|
||||
//- Return the turbulence viscosity
|
||||
virtual tmp<volScalarField> mut() const
|
||||
{
|
||||
return tmp<volScalarField>
|
||||
(
|
||||
new volScalarField("alphaEff", alphat_ + alpha())
|
||||
);
|
||||
return mut_;
|
||||
}
|
||||
|
||||
//- Return the turbulence thermal diffusivity
|
||||
virtual tmp<volScalarField> alphat() const
|
||||
{
|
||||
return alphat_;
|
||||
}
|
||||
|
||||
//- Return the turbulence kinetic energy
|
||||
tmp<volScalarField> k() const
|
||||
virtual tmp<volScalarField> k() const
|
||||
{
|
||||
return k_;
|
||||
}
|
||||
|
||||
//- Return the turbulence kinetic energy dissipation rate
|
||||
tmp<volScalarField> epsilon() const
|
||||
virtual tmp<volScalarField> epsilon() const
|
||||
{
|
||||
return epsilon_;
|
||||
}
|
||||
|
||||
//- Return the Reynolds stress tensor
|
||||
tmp<volSymmTensorField> R() const;
|
||||
virtual tmp<volSymmTensorField> R() const;
|
||||
|
||||
//- Return the effective stress tensor including the laminar stress
|
||||
tmp<volSymmTensorField> devRhoReff() const;
|
||||
virtual tmp<volSymmTensorField> devRhoReff() const;
|
||||
|
||||
//- Return the source term for the momentum equation
|
||||
tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
|
||||
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
|
||||
|
||||
//- Solve the turbulence equations and correct the turbulence viscosity
|
||||
void correct();
|
||||
virtual void correct();
|
||||
|
||||
//- Read turbulenceProperties dictionary
|
||||
bool read();
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -40,4 +40,3 @@
|
||||
// Momentum corrector
|
||||
U -= fvc::grad(p)/AU;
|
||||
U.correctBoundaryConditions();
|
||||
|
||||
|
||||
@ -40,6 +40,10 @@ geometry
|
||||
{
|
||||
type triSurfaceMesh;
|
||||
|
||||
//tolerance 1E-6; // optional:non-default tolerance on intersections
|
||||
//maxTreeDepth 10; // optional:depth of octree. Decrease only in case
|
||||
// of memory limitations.
|
||||
|
||||
// Per region the patchname. If not provided will be <name>_<region>.
|
||||
regions
|
||||
{
|
||||
|
||||
@ -94,7 +94,7 @@ void backup
|
||||
{
|
||||
if (fromSet.size())
|
||||
{
|
||||
Pout<< " Backing up " << fromName << " into " << toName << endl;
|
||||
Info<< " Backing up " << fromName << " into " << toName << endl;
|
||||
|
||||
topoSet::New(setType, mesh, toName, fromSet)().write();
|
||||
}
|
||||
@ -525,7 +525,7 @@ bool doCommand
|
||||
{
|
||||
topoSet& currentSet = currentSetPtr();
|
||||
|
||||
Pout<< " Set:" << currentSet.name()
|
||||
Info<< " Set:" << currentSet.name()
|
||||
<< " Size:" << currentSet.size()
|
||||
<< " Action:" << actionName
|
||||
<< endl;
|
||||
@ -622,7 +622,7 @@ bool doCommand
|
||||
+ ".vtk"
|
||||
);
|
||||
|
||||
Pout<< " Writing " << currentSet.name()
|
||||
Info<< " Writing " << currentSet.name()
|
||||
<< " (size " << currentSet.size() << ") to "
|
||||
<< currentSet.instance()/currentSet.local()
|
||||
/currentSet.name()
|
||||
@ -634,7 +634,7 @@ bool doCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
Pout<< " Writing " << currentSet.name()
|
||||
Info<< " Writing " << currentSet.name()
|
||||
<< " (size " << currentSet.size() << ") to "
|
||||
<< currentSet.instance()/currentSet.local()
|
||||
/currentSet.name() << endl << endl;
|
||||
@ -683,7 +683,7 @@ enum commandStatus
|
||||
|
||||
void printMesh(const Time& runTime, const polyMesh& mesh)
|
||||
{
|
||||
Pout<< "Time:" << runTime.timeName()
|
||||
Info<< "Time:" << runTime.timeName()
|
||||
<< " cells:" << mesh.nCells()
|
||||
<< " faces:" << mesh.nFaces()
|
||||
<< " points:" << mesh.nPoints()
|
||||
@ -703,19 +703,19 @@ commandStatus parseType
|
||||
{
|
||||
if (setType.empty())
|
||||
{
|
||||
Pout<< "Type 'help' for usage information" << endl;
|
||||
Info<< "Type 'help' for usage information" << endl;
|
||||
|
||||
return INVALID;
|
||||
}
|
||||
else if (setType == "help")
|
||||
{
|
||||
printHelp(Pout);
|
||||
printHelp(Info);
|
||||
|
||||
return INVALID;
|
||||
}
|
||||
else if (setType == "list")
|
||||
{
|
||||
printAllSets(mesh, Pout);
|
||||
printAllSets(mesh, Info);
|
||||
|
||||
return INVALID;
|
||||
}
|
||||
@ -726,7 +726,7 @@ commandStatus parseType
|
||||
|
||||
label nearestIndex = Time::findClosestTimeIndex(Times, requestedTime);
|
||||
|
||||
Pout<< "Changing time from " << runTime.timeName()
|
||||
Info<< "Changing time from " << runTime.timeName()
|
||||
<< " to " << Times[nearestIndex].name()
|
||||
<< endl;
|
||||
|
||||
@ -737,24 +737,24 @@ commandStatus parseType
|
||||
{
|
||||
case polyMesh::UNCHANGED:
|
||||
{
|
||||
Pout<< " mesh not changed." << endl;
|
||||
Info<< " mesh not changed." << endl;
|
||||
break;
|
||||
}
|
||||
case polyMesh::POINTS_MOVED:
|
||||
{
|
||||
Pout<< " points moved; topology unchanged." << endl;
|
||||
Info<< " points moved; topology unchanged." << endl;
|
||||
break;
|
||||
}
|
||||
case polyMesh::TOPO_CHANGE:
|
||||
{
|
||||
Pout<< " topology changed; patches unchanged." << nl
|
||||
Info<< " topology changed; patches unchanged." << nl
|
||||
<< " ";
|
||||
printMesh(runTime, mesh);
|
||||
break;
|
||||
}
|
||||
case polyMesh::TOPO_PATCH_CHANGE:
|
||||
{
|
||||
Pout<< " topology changed and patches changed." << nl
|
||||
Info<< " topology changed and patches changed." << nl
|
||||
<< " ";
|
||||
printMesh(runTime, mesh);
|
||||
|
||||
@ -773,7 +773,7 @@ commandStatus parseType
|
||||
}
|
||||
else if (setType == "quit")
|
||||
{
|
||||
Pout<< "Quitting ..." << endl;
|
||||
Info<< "Quitting ..." << endl;
|
||||
|
||||
return QUIT;
|
||||
}
|
||||
@ -864,7 +864,7 @@ int main(int argc, char *argv[])
|
||||
printMesh(runTime, mesh);
|
||||
|
||||
// Print current sets
|
||||
printAllSets(mesh, Pout);
|
||||
printAllSets(mesh, Info);
|
||||
|
||||
|
||||
|
||||
@ -874,7 +874,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
fileName batchFile(args.option("batch"));
|
||||
|
||||
Pout<< "Reading commands from file " << batchFile << endl;
|
||||
Info<< "Reading commands from file " << batchFile << endl;
|
||||
|
||||
// we cannot handle .gz files
|
||||
if (!isFile(batchFile, false))
|
||||
@ -888,11 +888,11 @@ int main(int argc, char *argv[])
|
||||
#if READLINE != 0
|
||||
else if (!read_history(historyFile))
|
||||
{
|
||||
Pout<< "Successfully read history from " << historyFile << endl;
|
||||
Info<< "Successfully read history from " << historyFile << endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
Pout<< "Please type 'help', 'quit' or a set command after prompt." << endl;
|
||||
Info<< "Please type 'help', 'quit' or a set command after prompt." << endl;
|
||||
|
||||
bool ok = true;
|
||||
|
||||
@ -916,7 +916,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
if (!fileStreamPtr->good())
|
||||
{
|
||||
Pout<< "End of batch file" << endl;
|
||||
Info<< "End of batch file" << endl;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -924,7 +924,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (rawLine.size())
|
||||
{
|
||||
Pout<< "Doing:" << rawLine << endl;
|
||||
Info<< "Doing:" << rawLine << endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -945,7 +945,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
# else
|
||||
{
|
||||
Pout<< "Command>" << flush;
|
||||
Info<< "Command>" << flush;
|
||||
std::getline(std::cin, rawLine);
|
||||
}
|
||||
# endif
|
||||
@ -992,7 +992,7 @@ int main(int argc, char *argv[])
|
||||
delete fileStreamPtr;
|
||||
}
|
||||
|
||||
Pout<< "\nEnd\n" << endl;
|
||||
Info<< "\nEnd\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -96,6 +96,7 @@ void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::noParallel();
|
||||
# include "addRegionOption.H"
|
||||
|
||||
argList::validArgs.append("masterPatch");
|
||||
argList::validArgs.append("slavePatch");
|
||||
@ -109,7 +110,7 @@ int main(int argc, char *argv[])
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
# include "createMesh.H"
|
||||
# include "createNamedMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
|
||||
|
||||
@ -31,6 +31,14 @@ Description
|
||||
|
||||
Mainly used to convert binary mesh/field files to ASCII.
|
||||
|
||||
Problem: any zero-size List written binary gets written as '0'. When
|
||||
reading the file as a dictionary this is interpreted as a label. This
|
||||
is (usually) not a problem when doing patch fields since these get the
|
||||
'uniform', 'nonuniform' prefix. However zone contents are labelLists
|
||||
not labelFields and these go wrong. For now hacked a solution where
|
||||
we detect the keywords in zones and redo the dictionary entries
|
||||
to be labelLists.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "argList.H"
|
||||
@ -56,6 +64,82 @@ namespace Foam
|
||||
}
|
||||
|
||||
|
||||
// Hack to do zones which have Lists in them. See above.
|
||||
bool writeZones(const word& name, Time& runTime)
|
||||
{
|
||||
IOobject io
|
||||
(
|
||||
name,
|
||||
runTime.timeName(),
|
||||
polyMesh::meshSubDir,
|
||||
runTime,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
|
||||
bool writeOk = false;
|
||||
|
||||
if (io.headerOk())
|
||||
{
|
||||
Info<< " Reading " << io.headerClassName()
|
||||
<< " : " << name << endl;
|
||||
|
||||
// Switch off type checking (for reading e.g. faceZones as
|
||||
// generic list of dictionaries).
|
||||
const word oldTypeName = IOPtrList<entry>::typeName;
|
||||
const_cast<word&>(IOPtrList<entry>::typeName) = word::null;
|
||||
|
||||
IOPtrList<entry> meshObject(io);
|
||||
|
||||
forAll(meshObject, i)
|
||||
{
|
||||
if (meshObject[i].isDict())
|
||||
{
|
||||
dictionary& d = meshObject[i].dict();
|
||||
|
||||
if (d.found("faceLabels"))
|
||||
{
|
||||
d.set("faceLabels", labelList(d.lookup("faceLabels")));
|
||||
}
|
||||
|
||||
if (d.found("flipMap"))
|
||||
{
|
||||
d.set("flipMap", boolList(d.lookup("flipMap")));
|
||||
}
|
||||
|
||||
if (d.found("cellLabels"))
|
||||
{
|
||||
d.set("cellLabels", labelList(d.lookup("cellLabels")));
|
||||
}
|
||||
|
||||
if (d.found("pointLabels"))
|
||||
{
|
||||
d.set("pointLabels", labelList(d.lookup("pointLabels")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const_cast<word&>(IOPtrList<entry>::typeName) = oldTypeName;
|
||||
// Fake type back to what was in field
|
||||
const_cast<word&>(meshObject.type()) = io.headerClassName();
|
||||
|
||||
Info<< " Writing " << name << endl;
|
||||
|
||||
// Force writing as ascii
|
||||
writeOk = meshObject.regIOobject::writeObject
|
||||
(
|
||||
IOstream::ASCII,
|
||||
IOstream::currentVersion,
|
||||
runTime.writeCompression()
|
||||
);
|
||||
}
|
||||
|
||||
return writeOk;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Main program:
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
@ -76,9 +160,19 @@ int main(int argc, char *argv[])
|
||||
writeMeshObject<labelIOList>("neighbour", runTime);
|
||||
writeMeshObject<faceIOList>("faces", runTime);
|
||||
writeMeshObject<pointIOField>("points", runTime);
|
||||
writeMeshObject<IOPtrList<entry> >("cellZones", runTime);
|
||||
writeMeshObject<IOPtrList<entry> >("faceZones", runTime);
|
||||
writeMeshObject<IOPtrList<entry> >("pointZones", runTime);
|
||||
writeMeshObject<labelIOList>("pointProcAddressing", runTime);
|
||||
writeMeshObject<labelIOList>("faceProcAddressing", runTime);
|
||||
writeMeshObject<labelIOList>("cellProcAddressing", runTime);
|
||||
writeMeshObject<labelIOList>("boundaryProcAddressing", runTime);
|
||||
|
||||
if (runTime.writeFormat() == IOstream::ASCII)
|
||||
{
|
||||
// Only do zones when converting from binary to ascii
|
||||
// The other way gives problems since working on dictionary level.
|
||||
writeZones("cellZones", runTime);
|
||||
writeZones("faceZones", runTime);
|
||||
writeZones("pointZones", runTime);
|
||||
}
|
||||
|
||||
// Get list of objects from the database
|
||||
IOobjectList objects(runTime, runTime.timeName());
|
||||
|
||||
@ -1077,83 +1077,92 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
const faceZone& pp = zones[zoneI];
|
||||
|
||||
const indirectPrimitivePatch ipp
|
||||
(
|
||||
IndirectList<face>(mesh.faces(), pp),
|
||||
mesh.points()
|
||||
);
|
||||
if (pp.size() > 0)
|
||||
{
|
||||
const indirectPrimitivePatch ipp
|
||||
(
|
||||
IndirectList<face>(mesh.faces(), pp),
|
||||
mesh.points()
|
||||
);
|
||||
|
||||
writer.writePolygonalZone
|
||||
(
|
||||
pp.name(),
|
||||
strandID++, //1+patchIDs.size()+zoneI, //strandID,
|
||||
ipp,
|
||||
allVarLocation
|
||||
);
|
||||
writer.writePolygonalZone
|
||||
(
|
||||
pp.name(),
|
||||
strandID++, //1+patchIDs.size()+zoneI, //strandID,
|
||||
ipp,
|
||||
allVarLocation
|
||||
);
|
||||
|
||||
// Write coordinates
|
||||
writer.writeField(ipp.localPoints().component(0)());
|
||||
writer.writeField(ipp.localPoints().component(1)());
|
||||
writer.writeField(ipp.localPoints().component(2)());
|
||||
// Write coordinates
|
||||
writer.writeField(ipp.localPoints().component(0)());
|
||||
writer.writeField(ipp.localPoints().component(1)());
|
||||
writer.writeField(ipp.localPoints().component(2)());
|
||||
|
||||
// Write all volfields
|
||||
forAll(vsf, i)
|
||||
{
|
||||
writer.writeField
|
||||
(
|
||||
writer.getFaceField
|
||||
// Write all volfields
|
||||
forAll(vsf, i)
|
||||
{
|
||||
writer.writeField
|
||||
(
|
||||
linearInterpolate(vsf[i])(),
|
||||
pp
|
||||
)()
|
||||
);
|
||||
}
|
||||
forAll(vvf, i)
|
||||
{
|
||||
writer.writeField
|
||||
(
|
||||
writer.getFaceField
|
||||
writer.getFaceField
|
||||
(
|
||||
linearInterpolate(vsf[i])(),
|
||||
pp
|
||||
)()
|
||||
);
|
||||
}
|
||||
forAll(vvf, i)
|
||||
{
|
||||
writer.writeField
|
||||
(
|
||||
linearInterpolate(vvf[i])(),
|
||||
pp
|
||||
)()
|
||||
);
|
||||
}
|
||||
forAll(vSpheretf, i)
|
||||
{
|
||||
writer.writeField
|
||||
(
|
||||
writer.getFaceField
|
||||
writer.getFaceField
|
||||
(
|
||||
linearInterpolate(vvf[i])(),
|
||||
pp
|
||||
)()
|
||||
);
|
||||
}
|
||||
forAll(vSpheretf, i)
|
||||
{
|
||||
writer.writeField
|
||||
(
|
||||
linearInterpolate(vSpheretf[i])(),
|
||||
pp
|
||||
)()
|
||||
);
|
||||
}
|
||||
forAll(vSymmtf, i)
|
||||
{
|
||||
writer.writeField
|
||||
(
|
||||
writer.getFaceField
|
||||
writer.getFaceField
|
||||
(
|
||||
linearInterpolate(vSpheretf[i])(),
|
||||
pp
|
||||
)()
|
||||
);
|
||||
}
|
||||
forAll(vSymmtf, i)
|
||||
{
|
||||
writer.writeField
|
||||
(
|
||||
linearInterpolate(vSymmtf[i])(),
|
||||
pp
|
||||
)()
|
||||
);
|
||||
}
|
||||
forAll(vtf, i)
|
||||
{
|
||||
writer.writeField
|
||||
(
|
||||
writer.getFaceField
|
||||
writer.getFaceField
|
||||
(
|
||||
linearInterpolate(vSymmtf[i])(),
|
||||
pp
|
||||
)()
|
||||
);
|
||||
}
|
||||
forAll(vtf, i)
|
||||
{
|
||||
writer.writeField
|
||||
(
|
||||
linearInterpolate(vtf[i])(),
|
||||
pp
|
||||
)()
|
||||
);
|
||||
}
|
||||
writer.getFaceField
|
||||
(
|
||||
linearInterpolate(vtf[i])(),
|
||||
pp
|
||||
)()
|
||||
);
|
||||
}
|
||||
|
||||
writer.writeConnectivity(ipp);
|
||||
writer.writeConnectivity(ipp);
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " Skipping zero sized faceZone " << zoneI
|
||||
<< "\t" << pp.name()
|
||||
<< nl << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user