mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://chris@noisy/~OpenFOAM/OpenFOAM-dev
This commit is contained in:
9
.gitignore
vendored
9
.gitignore
vendored
@ -16,6 +16,8 @@
|
||||
*.la
|
||||
*.so
|
||||
*.jar
|
||||
|
||||
# ignore derived files
|
||||
lex.yy.c
|
||||
|
||||
# Corefiles
|
||||
@ -32,9 +34,10 @@ linux*Gcc*
|
||||
|
||||
# reinstate wmake/rules that look like build folders
|
||||
!wmake/rules/linux*
|
||||
# but do ignore the derived files in there
|
||||
wmake/rules/linux*/dirToString
|
||||
wmake/rules/linux*/wmkdep
|
||||
|
||||
# but do continue to ignore the derived wmake files
|
||||
wmake/rules/*/dirToString
|
||||
wmake/rules/*/wmkdep
|
||||
|
||||
# doxygen generated documentation
|
||||
doc/[Dd]oxygen/html
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
polyDualMesh.C
|
||||
polyDualMeshApp.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/polyDualMesh
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/conversion/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lmeshTools
|
||||
-lmeshTools -lconversion
|
||||
|
||||
@ -344,7 +344,7 @@ bool doCommand
|
||||
/ (10*Pstream::nProcs());
|
||||
|
||||
|
||||
bool error = false;
|
||||
bool ok = true;
|
||||
|
||||
// Set to work on
|
||||
autoPtr<topoSet> currentSetPtr(NULL);
|
||||
@ -388,7 +388,7 @@ bool doCommand
|
||||
Pout<< " Cannot construct/load set "
|
||||
<< topoSet::localPath(mesh, setName) << endl;
|
||||
|
||||
error = true;
|
||||
ok = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -518,7 +518,7 @@ bool doCommand
|
||||
}
|
||||
catch (Foam::IOerror& fIOErr)
|
||||
{
|
||||
error = true;
|
||||
ok = false;
|
||||
|
||||
Pout<< fIOErr.message().c_str() << endl;
|
||||
|
||||
@ -529,7 +529,7 @@ bool doCommand
|
||||
}
|
||||
catch (Foam::error& fErr)
|
||||
{
|
||||
error = true;
|
||||
ok = false;
|
||||
|
||||
Pout<< fErr.message().c_str() << endl;
|
||||
|
||||
@ -539,15 +539,16 @@ bool doCommand
|
||||
}
|
||||
}
|
||||
|
||||
return !error;
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
// Status returned from parsing the first token of the line
|
||||
enum commandStatus
|
||||
{
|
||||
QUIT,
|
||||
INVALID,
|
||||
VALID
|
||||
QUIT, // quit program
|
||||
INVALID, // token is not a valid set manipulation command
|
||||
VALID // ,, is a valid ,,
|
||||
};
|
||||
|
||||
|
||||
@ -841,7 +842,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
ok = false;
|
||||
ok = true;
|
||||
|
||||
if (stat == QUIT)
|
||||
{
|
||||
|
||||
@ -50,6 +50,14 @@ Usage
|
||||
Remove any existing @a processor subdirectories before decomposing the
|
||||
geometry.
|
||||
|
||||
@param -ifRequired \n
|
||||
Only decompose the geometry if the number of domains has changed from a
|
||||
previous decomposition. No @a processor subdirectories will be removed
|
||||
unless the @a -force option is also specified. This option can be used
|
||||
to avoid redundant geometry decomposition (eg, in scripts), but should
|
||||
be used with caution when the underlying (serial) geometry or the
|
||||
decomposition method etc. have been changed between decompositions.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "OSspecific.H"
|
||||
@ -80,6 +88,7 @@ int main(int argc, char *argv[])
|
||||
argList::validOptions.insert("fields", "");
|
||||
argList::validOptions.insert("filterPatches", "");
|
||||
argList::validOptions.insert("force", "");
|
||||
argList::validOptions.insert("ifRequired", "");
|
||||
|
||||
# include "setRootCase.H"
|
||||
|
||||
@ -88,6 +97,7 @@ int main(int argc, char *argv[])
|
||||
bool decomposeFieldsOnly(args.options().found("fields"));
|
||||
bool filterPatches(args.options().found("filterPatches"));
|
||||
bool forceOverwrite(args.options().found("force"));
|
||||
bool ifRequiredDecomposition(args.options().found("ifRequired"));
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
@ -100,47 +110,84 @@ int main(int argc, char *argv[])
|
||||
++nProcs;
|
||||
}
|
||||
|
||||
// Check for previously decomposed case first
|
||||
// get requested numberOfSubdomains
|
||||
label nDomains = 0;
|
||||
{
|
||||
IOdictionary decompDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"decomposeParDict",
|
||||
runTime.time().system(),
|
||||
runTime,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
decompDict.lookup("numberOfSubdomains") >> nDomains;
|
||||
}
|
||||
|
||||
if (decomposeFieldsOnly)
|
||||
{
|
||||
if (!nProcs)
|
||||
// Sanity check on previously decomposed case
|
||||
if (nProcs != nDomains)
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Specifying -fields requires a decomposed geometry!"
|
||||
<< "Specified -fields, but the case was decomposed with "
|
||||
<< nProcs << " domains"
|
||||
<< nl
|
||||
<< "instead of " << nDomains
|
||||
<< " domains as specified in decomposeParDict"
|
||||
<< nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (nProcs)
|
||||
{
|
||||
if (nProcs)
|
||||
bool procDirsProblem = true;
|
||||
|
||||
if (ifRequiredDecomposition && nProcs == nDomains)
|
||||
{
|
||||
if (forceOverwrite)
|
||||
{
|
||||
Info<< "Removing " << nProcs
|
||||
<< " existing processor directories" << endl;
|
||||
// we can reuse the decomposition
|
||||
decomposeFieldsOnly = true;
|
||||
procDirsProblem = false;
|
||||
forceOverwrite = false;
|
||||
|
||||
// remove existing processor dirs
|
||||
for (label procI = nProcs-1; procI >= 0; --procI)
|
||||
{
|
||||
fileName procDir
|
||||
(
|
||||
runTime.path()/(word("processor") + name(procI))
|
||||
);
|
||||
Info<< "Using existing processor directories" << nl;
|
||||
}
|
||||
|
||||
rmDir(procDir);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (forceOverwrite)
|
||||
{
|
||||
Info<< "Removing " << nProcs
|
||||
<< " existing processor directories" << endl;
|
||||
|
||||
// remove existing processor dirs
|
||||
// reverse order to avoid gaps if someone interrupts the process
|
||||
for (label procI = nProcs-1; procI >= 0; --procI)
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Case is already decomposed, "
|
||||
"use the -force option or manually remove" << nl
|
||||
<< "processor directories before decomposing. e.g.," << nl
|
||||
<< " rm -rf " << runTime.path().c_str() << "/processor*"
|
||||
<< nl
|
||||
<< exit(FatalError);
|
||||
fileName procDir
|
||||
(
|
||||
runTime.path()/(word("processor") + name(procI))
|
||||
);
|
||||
|
||||
rmDir(procDir);
|
||||
}
|
||||
|
||||
procDirsProblem = false;
|
||||
}
|
||||
|
||||
if (procDirsProblem)
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Case is already decomposed with " << nProcs
|
||||
<< " domains, use the -force option or manually" << nl
|
||||
<< "remove processor directories before decomposing. e.g.,"
|
||||
<< nl
|
||||
<< " rm -rf " << runTime.path().c_str() << "/processor*"
|
||||
<< nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,61 +1,61 @@
|
||||
// Mesh decomposition control dictionary
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
/*-------------------------------*- C++ -*---------------------------------*\
|
||||
| ========= |
|
||||
| \\ / OpenFOAM |
|
||||
| \\ / |
|
||||
| \\ / The Open Source CFD Toolbox |
|
||||
| \\/ http://www.OpenFOAM.org |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 0.5;
|
||||
format ascii;
|
||||
|
||||
root "ROOT";
|
||||
case "CASE";
|
||||
instance "system";
|
||||
local "";
|
||||
|
||||
class dictionary;
|
||||
|
||||
object decompositionDict;
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
note "mesh decomposition control dictionary";
|
||||
location "system";
|
||||
object decomposeParDict;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
numberOfSubdomains 4;
|
||||
numberOfSubdomains 4;
|
||||
|
||||
//preservePatches (inlet);
|
||||
//preserveFaceZones (heater solid1 solid3);
|
||||
// preservePatches (inlet);
|
||||
// preserveFaceZones (heater solid1 solid3);
|
||||
|
||||
method simple;
|
||||
//method hierarchical;
|
||||
//method metis;
|
||||
//method manual;
|
||||
method simple;
|
||||
// method hierarchical;
|
||||
// method metis;
|
||||
// method manual;
|
||||
|
||||
simpleCoeffs
|
||||
{
|
||||
n (2 2 1);
|
||||
delta 0.001;
|
||||
n (2 2 1);
|
||||
delta 0.001;
|
||||
}
|
||||
|
||||
hierarchicalCoeffs
|
||||
{
|
||||
n (2 2 1);
|
||||
delta 0.001;
|
||||
order xyz;
|
||||
n (2 2 1);
|
||||
delta 0.001;
|
||||
order xyz;
|
||||
}
|
||||
|
||||
metisCoeffs
|
||||
{
|
||||
//processorWeights
|
||||
//(
|
||||
// 1
|
||||
// 1
|
||||
// 1
|
||||
// 1
|
||||
//);
|
||||
/*
|
||||
processorWeights
|
||||
(
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
);
|
||||
*/
|
||||
}
|
||||
|
||||
manualCoeffs
|
||||
{
|
||||
dataFile "decompositionData";
|
||||
dataFile "decompositionData";
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -70,6 +70,7 @@ Foam::polyMesh::readUpdateState Foam::vtkMesh::readUpdate()
|
||||
// the subset even if only movement.
|
||||
|
||||
topoPtr_.clear();
|
||||
pointMeshPtr_.clear();
|
||||
|
||||
if (setName_.size() > 0)
|
||||
{
|
||||
|
||||
7
applications/utilities/postProcessing/graphics/PV3FoamReader/Allwclean
Executable file
7
applications/utilities/postProcessing/graphics/PV3FoamReader/Allwclean
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
set -x
|
||||
|
||||
rm -r PV3FoamReader/Make
|
||||
|
||||
wclean libso vtkPV3Foam
|
||||
|
||||
@ -54,7 +54,7 @@ vtkPV3FoamReader::vtkPV3FoamReader()
|
||||
{
|
||||
Debug = 0;
|
||||
vtkDebugMacro(<<"Constructor");
|
||||
|
||||
|
||||
SetNumberOfInputPorts(0);
|
||||
|
||||
FileName = NULL;
|
||||
@ -115,7 +115,6 @@ vtkPV3FoamReader::vtkPV3FoamReader()
|
||||
vtkPV3FoamReader::~vtkPV3FoamReader()
|
||||
{
|
||||
vtkDebugMacro(<<"Deconstructor");
|
||||
cout << "Destroy ~vtkPV3FoamReader\n";
|
||||
|
||||
if (foamData_)
|
||||
{
|
||||
@ -152,23 +151,30 @@ int vtkPV3FoamReader::RequestInformation
|
||||
)
|
||||
{
|
||||
vtkDebugMacro(<<"RequestInformation");
|
||||
cout<<"REQUEST_INFORMATION\n";
|
||||
|
||||
|
||||
if (Foam::vtkPV3Foam::debug)
|
||||
{
|
||||
cout<<"REQUEST_INFORMATION\n";
|
||||
}
|
||||
|
||||
if (!FileName)
|
||||
{
|
||||
vtkErrorMacro("FileName has to be specified!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (Foam::vtkPV3Foam::debug)
|
||||
{
|
||||
vtkInformation* outputInfo = this->GetOutputPortInformation(0);
|
||||
outputInfo->Print(cout);
|
||||
|
||||
|
||||
vtkMultiBlockDataSet* output = vtkMultiBlockDataSet::SafeDownCast
|
||||
(
|
||||
outputInfo->Get(vtkMultiBlockDataSet::DATA_OBJECT())
|
||||
);
|
||||
if (output)
|
||||
|
||||
outputInfo->Print(cout);
|
||||
if (output)
|
||||
{
|
||||
output->Print(cout);
|
||||
}
|
||||
@ -177,21 +183,19 @@ int vtkPV3FoamReader::RequestInformation
|
||||
cout << "no output\n";
|
||||
}
|
||||
|
||||
cout << "GetExecutive:\n";
|
||||
|
||||
this->GetExecutive()->GetOutputInformation(0)->Print(cout);
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
int nInfo = outputVector->GetNumberOfInformationObjects();
|
||||
cout<<"requestInfo with " << nInfo << " items\n";
|
||||
|
||||
cout<< "requestInfo with " << nInfo << " items:\n";
|
||||
|
||||
for (int i=0; i<nInfo; i++)
|
||||
{
|
||||
vtkInformation *info = outputVector->GetInformationObject(i);
|
||||
info->Print(cout);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
vtkInformation *outInfo = outputVector->GetInformationObject(0);
|
||||
|
||||
if (!foamData_)
|
||||
@ -207,15 +211,12 @@ int vtkPV3FoamReader::RequestInformation
|
||||
else
|
||||
{
|
||||
vtkDebugMacro("RequestInformation: updating information");
|
||||
|
||||
foamData_->UpdateInformation();
|
||||
}
|
||||
|
||||
int nTimeSteps = 0;
|
||||
double* timeSteps = foamData_->timeSteps(nTimeSteps);
|
||||
|
||||
cout<<"Have nTimeSteps: " << nTimeSteps << "\n";
|
||||
|
||||
outInfo->Set
|
||||
(
|
||||
vtkStreamingDemandDrivenPipeline::TIME_STEPS(),
|
||||
@ -229,13 +230,16 @@ int vtkPV3FoamReader::RequestInformation
|
||||
timeRange[0] = timeSteps[0];
|
||||
timeRange[1] = timeSteps[nTimeSteps-1];
|
||||
|
||||
cout<<"nTimeSteps " << nTimeSteps << "\n";
|
||||
cout<<"timeRange " << timeRange[0] << " -> " << timeRange[1] << "\n";
|
||||
if (Foam::vtkPV3Foam::debug)
|
||||
{
|
||||
cout<<"nTimeSteps " << nTimeSteps << "\n";
|
||||
cout<<"timeRange " << timeRange[0] << " to " << timeRange[1] << "\n";
|
||||
|
||||
// for (int i = 0; i < nTimeSteps; ++i)
|
||||
// {
|
||||
// cout<<"step[" << i << "] = " << timeSteps[i] << "\n";
|
||||
// }
|
||||
for (int i = 0; i < nTimeSteps; ++i)
|
||||
{
|
||||
cout<< "step[" << i << "] = " << timeSteps[i] << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
outInfo->Set
|
||||
(
|
||||
@ -247,7 +251,6 @@ int vtkPV3FoamReader::RequestInformation
|
||||
|
||||
delete timeSteps;
|
||||
|
||||
cout<<"done RequestInformation\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -261,21 +264,27 @@ int vtkPV3FoamReader::RequestData
|
||||
)
|
||||
{
|
||||
vtkDebugMacro(<<"RequestData");
|
||||
cout<<"REQUEST_DATA\n";
|
||||
|
||||
if (!FileName)
|
||||
{
|
||||
vtkErrorMacro("FileName has to be specified!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
int nInfo = outputVector->GetNumberOfInformationObjects();
|
||||
cout<<"requestData with " << nInfo << " items\n";
|
||||
if (Foam::vtkPV3Foam::debug)
|
||||
{
|
||||
cout<<"requestData with " << nInfo << " items\n";
|
||||
}
|
||||
for (int i=0; i<nInfo; i++)
|
||||
{
|
||||
vtkInformation *info = outputVector->GetInformationObject(i);
|
||||
info->Print(cout);
|
||||
|
||||
if (Foam::vtkPV3Foam::debug)
|
||||
{
|
||||
info->Print(cout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -284,38 +293,38 @@ int vtkPV3FoamReader::RequestData
|
||||
(
|
||||
outInfo->Get(vtkMultiBlockDataSet::DATA_OBJECT())
|
||||
);
|
||||
|
||||
#if 1
|
||||
|
||||
if (Foam::vtkPV3Foam::debug)
|
||||
{
|
||||
vtkInformation* outputInfo = this->GetOutputPortInformation(0);
|
||||
outputInfo->Print(cout);
|
||||
|
||||
|
||||
vtkMultiBlockDataSet* output = vtkMultiBlockDataSet::SafeDownCast
|
||||
(
|
||||
outputInfo->Get(vtkMultiBlockDataSet::DATA_OBJECT())
|
||||
);
|
||||
if (output)
|
||||
if (output)
|
||||
{
|
||||
output->Print(cout);
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "no output\n";
|
||||
cout<< "no output\n";
|
||||
}
|
||||
|
||||
|
||||
vtkInformation* execInfo = this->GetExecutive()->GetOutputInformation(0);
|
||||
execInfo->Print(cout);
|
||||
|
||||
|
||||
outInfo->Print(cout);
|
||||
|
||||
|
||||
vtkMultiBlockDataSet* dobj = vtkMultiBlockDataSet::SafeDownCast
|
||||
(
|
||||
outInfo->Get(vtkMultiBlockDataSet::DATA_OBJECT())
|
||||
);
|
||||
if (dobj)
|
||||
if (dobj)
|
||||
{
|
||||
dobj->Print(cout);
|
||||
|
||||
|
||||
vtkInformation* dobjInfo = dobj->GetInformation();
|
||||
dobjInfo->Print(cout);
|
||||
}
|
||||
@ -323,16 +332,16 @@ int vtkPV3FoamReader::RequestData
|
||||
{
|
||||
cout << "no data_object\n";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
if (outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS()))
|
||||
{
|
||||
cout<<"Has UPDATE_TIME_STEPS\n";
|
||||
cout<<"output->GetNumberOfBlocks() " << output->GetNumberOfBlocks() <<
|
||||
"\n";
|
||||
if (Foam::vtkPV3Foam::debug)
|
||||
{
|
||||
cout<<"Has UPDATE_TIME_STEPS\n";
|
||||
cout<<"output->GetNumberOfBlocks() = "
|
||||
<< output->GetNumberOfBlocks() << "\n";
|
||||
}
|
||||
|
||||
// Get the requested time step.
|
||||
// We only supprt requests of a single time step
|
||||
@ -370,10 +379,6 @@ int vtkPV3FoamReader::RequestData
|
||||
}
|
||||
UpdateGUIOld = GetUpdateGUI();
|
||||
|
||||
cout<<"done RequestData\n";
|
||||
cout<<"done output->GetNumberOfBlocks() "
|
||||
<< output->GetNumberOfBlocks() << "\n";
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@ -87,10 +87,13 @@ void Foam::vtkPV3Foam::AddToBlock
|
||||
|
||||
if (block)
|
||||
{
|
||||
Info<< "block[" << blockNo << "] has "
|
||||
<< block->GetNumberOfBlocks()
|
||||
<< " datasets prior to adding set " << datasetNo
|
||||
<< " with name: " << blockName << endl;
|
||||
if (debug)
|
||||
{
|
||||
Info<< "block[" << blockNo << "] has "
|
||||
<< block->GetNumberOfBlocks()
|
||||
<< " datasets prior to adding set " << datasetNo
|
||||
<< " with name: " << blockName << endl;
|
||||
}
|
||||
|
||||
// when assigning dataset 0, also name the parent block
|
||||
if (!datasetNo && selector.name())
|
||||
@ -481,8 +484,11 @@ Foam::vtkPV3Foam::vtkPV3Foam
|
||||
|
||||
dbPtr_().functionObjects().off();
|
||||
|
||||
cout<<"constructed with output: ";
|
||||
output_->Print(cout),
|
||||
if (debug)
|
||||
{
|
||||
cout<< "constructed with output: ";
|
||||
output_->Print(cout);
|
||||
}
|
||||
|
||||
resetCounters();
|
||||
|
||||
@ -579,8 +585,8 @@ void Foam::vtkPV3Foam::Update
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "entered Foam::vtkPV3Foam::Update" << endl;
|
||||
cout<<"Update\n";
|
||||
cout<< "entered Foam::vtkPV3Foam::Update" << nl
|
||||
<<"Update\n";
|
||||
output->Print(cout);
|
||||
|
||||
cout<<"Internally:\n";
|
||||
@ -765,7 +771,10 @@ void Foam::vtkPV3Foam::addPatchNames(vtkRenderer* renderer)
|
||||
true
|
||||
);
|
||||
|
||||
Info<<"patches: " << selectedPatches <<endl;
|
||||
if (debug)
|
||||
{
|
||||
Info<<"patches: " << selectedPatches <<endl;
|
||||
}
|
||||
|
||||
// Find the total number of zones
|
||||
// Each zone will take the patch name
|
||||
|
||||
@ -172,6 +172,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private data
|
||||
@ -645,85 +646,6 @@ public:
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Template Specialisations * * * * * * * * * * * //
|
||||
|
||||
template<>
|
||||
void vtkPV3Foam::convertVolField
|
||||
(
|
||||
const GeometricField<scalar, fvPatchField, volMesh>& sf,
|
||||
vtkMultiBlockDataSet* output,
|
||||
const selectionInfo&,
|
||||
const label datasetNo,
|
||||
labelList& superCells
|
||||
);
|
||||
|
||||
|
||||
template<>
|
||||
void vtkPV3Foam::convertPatchFaceField
|
||||
(
|
||||
const word& name,
|
||||
const Field<scalar>&,
|
||||
vtkMultiBlockDataSet* output,
|
||||
const selectionInfo&,
|
||||
const label datasetNo
|
||||
);
|
||||
|
||||
template<>
|
||||
void vtkPV3Foam::convertFaceField
|
||||
(
|
||||
const GeometricField<scalar, fvPatchField, volMesh>&,
|
||||
vtkMultiBlockDataSet* output,
|
||||
const selectionInfo&,
|
||||
const label datasetNo,
|
||||
const fvMesh&,
|
||||
const labelList& faceLabels
|
||||
);
|
||||
|
||||
|
||||
template<>
|
||||
void vtkPV3Foam::convertFaceField
|
||||
(
|
||||
const GeometricField<scalar, fvPatchField, volMesh>&,
|
||||
vtkMultiBlockDataSet* output,
|
||||
const selectionInfo&,
|
||||
const label datasetNo,
|
||||
const fvMesh&,
|
||||
const faceSet&
|
||||
);
|
||||
|
||||
|
||||
template<>
|
||||
void vtkPV3Foam::convertPointField
|
||||
(
|
||||
const GeometricField<scalar, pointPatchField, pointMesh>&,
|
||||
const GeometricField<scalar, fvPatchField, volMesh>&,
|
||||
vtkMultiBlockDataSet* output,
|
||||
const selectionInfo&,
|
||||
const label datasetNo
|
||||
);
|
||||
|
||||
|
||||
template<>
|
||||
void vtkPV3Foam::convertPatchPointField
|
||||
(
|
||||
const word& name,
|
||||
const Field<scalar>&,
|
||||
vtkMultiBlockDataSet* output,
|
||||
const selectionInfo&,
|
||||
const label datasetNo
|
||||
);
|
||||
|
||||
|
||||
template<>
|
||||
void vtkPV3Foam::convertLagrangianField
|
||||
(
|
||||
const IOField<scalar>&,
|
||||
vtkMultiBlockDataSet* output,
|
||||
const selectionInfo&,
|
||||
const label datasetNo
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -48,6 +48,8 @@ void Foam::vtkPV3Foam::convertFaceField
|
||||
const labelList& faceLabels
|
||||
)
|
||||
{
|
||||
const label nComp = pTraits<Type>::nComponents;
|
||||
|
||||
vtkPolyData* vtkmesh = vtkPolyData::SafeDownCast
|
||||
(
|
||||
GetDataSetFromBlock(output, selector, datasetNo)
|
||||
@ -59,33 +61,30 @@ void Foam::vtkPV3Foam::convertFaceField
|
||||
|
||||
vtkFloatArray *cellData = vtkFloatArray::New();
|
||||
cellData->SetNumberOfTuples(faceLabels.size());
|
||||
cellData->SetNumberOfComponents(Type::nComponents);
|
||||
cellData->Allocate(Type::nComponents*faceLabels.size());
|
||||
cellData->SetNumberOfComponents(nComp);
|
||||
cellData->Allocate(nComp*faceLabels.size());
|
||||
cellData->SetName(tf.name().c_str());
|
||||
|
||||
float vec[Type::nComponents];
|
||||
float vec[nComp];
|
||||
|
||||
forAll(faceLabels, faceI)
|
||||
{
|
||||
const label faceNo = faceLabels[faceI];
|
||||
if (faceNo < nInternalFaces)
|
||||
{
|
||||
Type t = 0.5 *
|
||||
(
|
||||
tf[faceOwner[faceNo]] + tf[faceNeigh[faceNo]]
|
||||
);
|
||||
Type t = 0.5*(tf[faceOwner[faceNo]] + tf[faceNeigh[faceNo]]);
|
||||
|
||||
for (direction d=0; d<Type::nComponents; d++)
|
||||
for (direction d=0; d<nComp; d++)
|
||||
{
|
||||
vec[d] = t[d];
|
||||
vec[d] = component(t, d);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const Type& t = tf[faceOwner[faceNo]];
|
||||
for (direction d=0; d<Type::nComponents; d++)
|
||||
for (direction d=0; d<nComp; d++)
|
||||
{
|
||||
vec[d] = t[d];
|
||||
vec[d] = component(t, d);
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,6 +107,8 @@ void Foam::vtkPV3Foam::convertFaceField
|
||||
const faceSet& fSet
|
||||
)
|
||||
{
|
||||
const label nComp = pTraits<Type>::nComponents;
|
||||
|
||||
vtkPolyData* vtkmesh = vtkPolyData::SafeDownCast
|
||||
(
|
||||
GetDataSetFromBlock(output, selector, datasetNo)
|
||||
@ -119,11 +120,11 @@ void Foam::vtkPV3Foam::convertFaceField
|
||||
|
||||
vtkFloatArray *cellData = vtkFloatArray::New();
|
||||
cellData->SetNumberOfTuples(fSet.size());
|
||||
cellData->SetNumberOfComponents(Type::nComponents);
|
||||
cellData->Allocate(Type::nComponents*fSet.size());
|
||||
cellData->SetNumberOfComponents(nComp);
|
||||
cellData->Allocate(nComp*fSet.size());
|
||||
cellData->SetName(tf.name().c_str());
|
||||
|
||||
float vec[Type::nComponents];
|
||||
float vec[nComp];
|
||||
|
||||
label faceI = 0;
|
||||
forAllConstIter(faceSet, fSet, iter)
|
||||
@ -132,22 +133,19 @@ void Foam::vtkPV3Foam::convertFaceField
|
||||
|
||||
if (faceNo < nInternalFaces)
|
||||
{
|
||||
Type t = 0.5 *
|
||||
(
|
||||
tf[faceOwner[faceNo]] + tf[faceNeigh[faceNo]]
|
||||
);
|
||||
Type t = 0.5*(tf[faceOwner[faceNo]] + tf[faceNeigh[faceNo]]);
|
||||
|
||||
for (direction d=0; d<Type::nComponents; d++)
|
||||
for (direction d=0; d<nComp; d++)
|
||||
{
|
||||
vec[d] = t[d];
|
||||
vec[d] = component(t, d);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const Type& t = tf[faceOwner[faceNo]];
|
||||
for (direction d=0; d<Type::nComponents; d++)
|
||||
for (direction d=0; d<nComp; d++)
|
||||
{
|
||||
vec[d] = t[d];
|
||||
vec[d] = component(t, d);
|
||||
}
|
||||
}
|
||||
|
||||
@ -160,125 +158,6 @@ void Foam::vtkPV3Foam::convertFaceField
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
void Foam::vtkPV3Foam::convertFaceField
|
||||
(
|
||||
const GeometricField<scalar, fvPatchField, volMesh>& tf,
|
||||
vtkMultiBlockDataSet* output,
|
||||
const selectionInfo& selector,
|
||||
const label datasetNo,
|
||||
const fvMesh& mesh,
|
||||
const labelList& faceLabels
|
||||
)
|
||||
{
|
||||
vtkPolyData* vtkmesh = vtkPolyData::SafeDownCast
|
||||
(
|
||||
GetDataSetFromBlock(output, selector, datasetNo)
|
||||
);
|
||||
|
||||
const label nInternalFaces = mesh.nInternalFaces();
|
||||
const labelList& faceOwner = mesh.faceOwner();
|
||||
const labelList& faceNeigh = mesh.faceNeighbour();
|
||||
|
||||
vtkFloatArray *cellData = vtkFloatArray::New();
|
||||
cellData->SetNumberOfTuples(faceLabels.size());
|
||||
cellData->SetNumberOfComponents(1);
|
||||
cellData->Allocate(faceLabels.size());
|
||||
cellData->SetName(tf.name().c_str());
|
||||
|
||||
forAll(faceLabels, faceI)
|
||||
{
|
||||
const label faceNo = faceLabels[faceI];
|
||||
if (faceNo < nInternalFaces)
|
||||
{
|
||||
cellData->InsertComponent
|
||||
(
|
||||
faceI,
|
||||
0,
|
||||
0.5 * (tf[faceOwner[faceNo]] + tf[faceNeigh[faceNo]])
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
cellData->InsertComponent
|
||||
(
|
||||
faceI, 0, tf[faceOwner[faceNo]]
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
vtkmesh->GetCellData()->AddArray(cellData);
|
||||
|
||||
if (!vtkmesh->GetCellData()->GetScalars())
|
||||
{
|
||||
vtkmesh->GetCellData()->SetScalars(cellData);
|
||||
}
|
||||
|
||||
cellData->Delete();
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
void Foam::vtkPV3Foam::convertFaceField
|
||||
(
|
||||
const GeometricField<scalar, fvPatchField, volMesh>& tf,
|
||||
vtkMultiBlockDataSet* output,
|
||||
const selectionInfo& selector,
|
||||
const label datasetNo,
|
||||
const fvMesh& mesh,
|
||||
const faceSet& fSet
|
||||
)
|
||||
{
|
||||
vtkPolyData* vtkmesh = vtkPolyData::SafeDownCast
|
||||
(
|
||||
GetDataSetFromBlock(output, selector, datasetNo)
|
||||
);
|
||||
|
||||
const label nInternalFaces = mesh.nInternalFaces();
|
||||
const labelList& faceOwner = mesh.faceOwner();
|
||||
const labelList& faceNeigh = mesh.faceNeighbour();
|
||||
|
||||
vtkFloatArray *cellData = vtkFloatArray::New();
|
||||
cellData->SetNumberOfTuples(fSet.size());
|
||||
cellData->SetNumberOfComponents(1);
|
||||
cellData->Allocate(fSet.size());
|
||||
cellData->SetName(tf.name().c_str());
|
||||
|
||||
label faceI = 0;
|
||||
forAllConstIter(faceSet, fSet, iter)
|
||||
{
|
||||
const label faceNo = iter.key();
|
||||
if (faceNo < nInternalFaces)
|
||||
{
|
||||
cellData->InsertComponent
|
||||
(
|
||||
faceI,
|
||||
0,
|
||||
0.5 * (tf[faceOwner[faceNo]] + tf[faceNeigh[faceNo]])
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
cellData->InsertComponent
|
||||
(
|
||||
faceI, 0, tf[faceOwner[faceNo]]
|
||||
);
|
||||
}
|
||||
++faceI;
|
||||
}
|
||||
|
||||
vtkmesh->GetCellData()->AddArray(cellData);
|
||||
|
||||
if (!vtkmesh->GetCellData()->GetScalars())
|
||||
{
|
||||
vtkmesh->GetCellData()->SetScalars(cellData);
|
||||
}
|
||||
|
||||
cellData->Delete();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
@ -95,6 +95,8 @@ void Foam::vtkPV3Foam::convertLagrangianField
|
||||
const label datasetNo
|
||||
)
|
||||
{
|
||||
const label nComp = pTraits<Type>::nComponents;
|
||||
|
||||
vtkPolyData* vtkmesh = vtkPolyData::SafeDownCast
|
||||
(
|
||||
GetDataSetFromBlock(output, selector, datasetNo)
|
||||
@ -102,24 +104,24 @@ void Foam::vtkPV3Foam::convertLagrangianField
|
||||
|
||||
vtkFloatArray *pointData = vtkFloatArray::New();
|
||||
pointData->SetNumberOfTuples(tf.size());
|
||||
pointData->SetNumberOfComponents(Type::nComponents);
|
||||
pointData->Allocate(Type::nComponents*tf.size());
|
||||
pointData->SetNumberOfComponents(nComp);
|
||||
pointData->Allocate(nComp*tf.size());
|
||||
pointData->SetName(tf.name().c_str());
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "converting Lagrangian <Type>Field: " << tf.name() << nl
|
||||
<< "tf.size() = " << tf.size() << nl
|
||||
<< "nComps = " << Type::nComponents << endl;
|
||||
<< "nComp = " << nComp << endl;
|
||||
}
|
||||
|
||||
float vec[Type::nComponents];
|
||||
float vec[nComp];
|
||||
|
||||
forAll(tf, i)
|
||||
{
|
||||
for (direction d=0; d<Type::nComponents; d++)
|
||||
for (direction d=0; d<nComp; d++)
|
||||
{
|
||||
vec[d] = tf[i][d];
|
||||
vec[d] = component(tf[i], d);
|
||||
}
|
||||
|
||||
pointData->InsertTuple(i, vec);
|
||||
@ -130,48 +132,6 @@ void Foam::vtkPV3Foam::convertLagrangianField
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
void Foam::vtkPV3Foam::convertLagrangianField
|
||||
(
|
||||
const IOField<scalar>& sf,
|
||||
vtkMultiBlockDataSet* output,
|
||||
const selectionInfo& selector,
|
||||
const label datasetNo
|
||||
)
|
||||
{
|
||||
vtkPolyData* vtkmesh = vtkPolyData::SafeDownCast
|
||||
(
|
||||
GetDataSetFromBlock(output, selector, datasetNo)
|
||||
);
|
||||
|
||||
vtkFloatArray *pointData = vtkFloatArray::New();
|
||||
pointData->SetNumberOfTuples(sf.size());
|
||||
pointData->SetNumberOfComponents(1);
|
||||
pointData->Allocate(sf.size());
|
||||
pointData->SetName(sf.name().c_str());
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "converting Lagrangian scalarField: " << sf.name() << nl
|
||||
<< "sf.size() = " << sf.size() << nl
|
||||
<< "nComps = 1" << endl;
|
||||
}
|
||||
|
||||
for (int i=0; i<sf.size(); i++)
|
||||
{
|
||||
pointData->InsertComponent(i, 0, sf[i]);
|
||||
}
|
||||
|
||||
vtkmesh->GetPointData()->AddArray(pointData);
|
||||
if (!vtkmesh->GetPointData()->GetScalars())
|
||||
{
|
||||
vtkmesh->GetPointData()->SetScalars(pointData);
|
||||
}
|
||||
|
||||
pointData->Delete();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
@ -48,6 +48,8 @@ void Foam::vtkPV3Foam::convertPatchFaceField
|
||||
const label datasetNo
|
||||
)
|
||||
{
|
||||
const label nComp = pTraits<Type>::nComponents;
|
||||
|
||||
vtkPolyData* vtkmesh = vtkPolyData::SafeDownCast
|
||||
(
|
||||
GetDataSetFromBlock(output, selector, datasetNo)
|
||||
@ -55,18 +57,18 @@ void Foam::vtkPV3Foam::convertPatchFaceField
|
||||
|
||||
vtkFloatArray *cellData = vtkFloatArray::New();
|
||||
cellData->SetNumberOfTuples(ptf.size());
|
||||
cellData->SetNumberOfComponents(Type::nComponents);
|
||||
cellData->Allocate(Type::nComponents*ptf.size());
|
||||
cellData->SetNumberOfComponents(nComp);
|
||||
cellData->Allocate(nComp*ptf.size());
|
||||
cellData->SetName(name.c_str());
|
||||
|
||||
float vec[Type::nComponents];
|
||||
float vec[nComp];
|
||||
|
||||
forAll(ptf, i)
|
||||
{
|
||||
const Type& t = ptf[i];
|
||||
for (direction d=0; d<Type::nComponents; d++)
|
||||
for (direction d=0; d<nComp; d++)
|
||||
{
|
||||
vec[d] = t[d];
|
||||
vec[d] = component(t, d);
|
||||
}
|
||||
|
||||
cellData->InsertTuple(i, vec);
|
||||
@ -77,43 +79,6 @@ void Foam::vtkPV3Foam::convertPatchFaceField
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
void Foam::vtkPV3Foam::convertPatchFaceField
|
||||
(
|
||||
const word& name,
|
||||
const Field<scalar>& psf,
|
||||
vtkMultiBlockDataSet* output,
|
||||
const selectionInfo& selector,
|
||||
const label datasetNo
|
||||
)
|
||||
{
|
||||
vtkPolyData* vtkmesh = vtkPolyData::SafeDownCast
|
||||
(
|
||||
GetDataSetFromBlock(output, selector, datasetNo)
|
||||
);
|
||||
|
||||
vtkFloatArray *cellData = vtkFloatArray::New();
|
||||
cellData->SetNumberOfTuples(psf.size());
|
||||
cellData->SetNumberOfComponents(1);
|
||||
cellData->Allocate(psf.size());
|
||||
cellData->SetName(name.c_str());
|
||||
|
||||
forAll(psf, i)
|
||||
{
|
||||
cellData->InsertComponent(i, 0, psf[i]);
|
||||
}
|
||||
|
||||
vtkmesh->GetCellData()->AddArray(cellData);
|
||||
|
||||
if (!vtkmesh->GetCellData()->GetScalars())
|
||||
{
|
||||
vtkmesh->GetCellData()->SetScalars(cellData);
|
||||
}
|
||||
|
||||
cellData->Delete();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
@ -45,6 +45,8 @@ void Foam::vtkPV3Foam::convertPatchPointField
|
||||
const label datasetNo
|
||||
)
|
||||
{
|
||||
const label nComp = pTraits<Type>::nComponents;
|
||||
|
||||
vtkPolyData* vtkmesh = vtkPolyData::SafeDownCast
|
||||
(
|
||||
GetDataSetFromBlock(output, selector, datasetNo)
|
||||
@ -52,17 +54,17 @@ void Foam::vtkPV3Foam::convertPatchPointField
|
||||
|
||||
vtkFloatArray *pointData = vtkFloatArray::New();
|
||||
pointData->SetNumberOfTuples(pptf.size());
|
||||
pointData->SetNumberOfComponents(Type::nComponents);
|
||||
pointData->Allocate(Type::nComponents*pptf.size());
|
||||
pointData->SetNumberOfComponents(nComp);
|
||||
pointData->Allocate(nComp*pptf.size());
|
||||
pointData->SetName(name.c_str());
|
||||
|
||||
float vec[Type::nComponents];
|
||||
float vec[nComp];
|
||||
|
||||
forAll(pptf, i)
|
||||
{
|
||||
for (direction d=0; d<Type::nComponents; d++)
|
||||
for (direction d=0; d<nComp; d++)
|
||||
{
|
||||
vec[d] = pptf[i][d];
|
||||
vec[d] = component(pptf[i], d);
|
||||
}
|
||||
|
||||
pointData->InsertTuple(i, vec);
|
||||
@ -73,42 +75,6 @@ void Foam::vtkPV3Foam::convertPatchPointField
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
void Foam::vtkPV3Foam::convertPatchPointField
|
||||
(
|
||||
const word& name,
|
||||
const Field<scalar>& ppsf,
|
||||
vtkMultiBlockDataSet* output,
|
||||
const selectionInfo& selector,
|
||||
const label datasetNo
|
||||
)
|
||||
{
|
||||
vtkPolyData* vtkmesh = vtkPolyData::SafeDownCast
|
||||
(
|
||||
GetDataSetFromBlock(output, selector, datasetNo)
|
||||
);
|
||||
|
||||
vtkFloatArray *pointData = vtkFloatArray::New();
|
||||
pointData->SetNumberOfTuples(ppsf.size());
|
||||
pointData->SetNumberOfComponents(1);
|
||||
pointData->Allocate(ppsf.size());
|
||||
pointData->SetName(name.c_str());
|
||||
|
||||
for (int i=0; i<ppsf.size(); i++)
|
||||
{
|
||||
pointData->InsertComponent(i, 0, ppsf[i]);
|
||||
}
|
||||
|
||||
vtkmesh->GetPointData()->AddArray(pointData);
|
||||
if (!vtkmesh->GetPointData()->GetScalars())
|
||||
{
|
||||
vtkmesh->GetPointData()->SetScalars(pointData);
|
||||
}
|
||||
|
||||
pointData->Delete();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
@ -33,8 +33,6 @@ InClass
|
||||
// Foam includes
|
||||
#include "interpolatePointToCell.H"
|
||||
|
||||
// VTK includes
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
@ -145,6 +143,8 @@ void Foam::vtkPV3Foam::convertPointField
|
||||
const label datasetNo
|
||||
)
|
||||
{
|
||||
const label nComp = pTraits<Type>::nComponents;
|
||||
|
||||
vtkUnstructuredGrid* internalMesh = vtkUnstructuredGrid::SafeDownCast
|
||||
(
|
||||
GetDataSetFromBlock(output, selector, datasetNo)
|
||||
@ -152,17 +152,17 @@ void Foam::vtkPV3Foam::convertPointField
|
||||
|
||||
vtkFloatArray *pointData = vtkFloatArray::New();
|
||||
pointData->SetNumberOfTuples(ptf.size() + addPointCellLabels_.size());
|
||||
pointData->SetNumberOfComponents(Type::nComponents);
|
||||
pointData->Allocate(Type::nComponents*ptf.size());
|
||||
pointData->SetNumberOfComponents(nComp);
|
||||
pointData->Allocate(nComp*ptf.size());
|
||||
pointData->SetName(tf.name().c_str());
|
||||
|
||||
float vec[Type::nComponents];
|
||||
float vec[nComp];
|
||||
|
||||
forAll(ptf, i)
|
||||
{
|
||||
for (direction d=0; d<Type::nComponents; d++)
|
||||
for (direction d=0; d<nComp; d++)
|
||||
{
|
||||
vec[d] = ptf[i][d];
|
||||
vec[d] = component(ptf[i], d);
|
||||
}
|
||||
|
||||
pointData->InsertTuple(i, vec);
|
||||
@ -176,9 +176,9 @@ void Foam::vtkPV3Foam::convertPointField
|
||||
{
|
||||
Type t = tf[addPointCellLabels_[api]];
|
||||
|
||||
for (direction d=0; d<Type::nComponents; d++)
|
||||
for (direction d=0; d<nComp; d++)
|
||||
{
|
||||
vec[d] = t[d];
|
||||
vec[d] = component(t, d);
|
||||
}
|
||||
|
||||
pointData->InsertTuple(i++, vec);
|
||||
@ -190,9 +190,9 @@ void Foam::vtkPV3Foam::convertPointField
|
||||
{
|
||||
Type t = interpolatePointToCell(ptf, addPointCellLabels_[api]);
|
||||
|
||||
for (direction d=0; d<Type::nComponents; d++)
|
||||
for (direction d=0; d<nComp; d++)
|
||||
{
|
||||
vec[d] = t[d];
|
||||
vec[d] = component(t, d);
|
||||
}
|
||||
|
||||
pointData->InsertTuple(i++, vec);
|
||||
@ -204,69 +204,6 @@ void Foam::vtkPV3Foam::convertPointField
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
void Foam::vtkPV3Foam::convertPointField
|
||||
(
|
||||
const GeometricField<scalar, pointPatchField, pointMesh>& psf,
|
||||
const GeometricField<scalar, fvPatchField, volMesh>& sf,
|
||||
vtkMultiBlockDataSet* output,
|
||||
const selectionInfo& selector,
|
||||
const label datasetNo
|
||||
)
|
||||
{
|
||||
vtkUnstructuredGrid* internalMesh = vtkUnstructuredGrid::SafeDownCast
|
||||
(
|
||||
GetDataSetFromBlock(output, selector, datasetNo)
|
||||
);
|
||||
|
||||
vtkFloatArray *pointData = vtkFloatArray::New();
|
||||
pointData->SetNumberOfTuples(psf.size() + addPointCellLabels_.size());
|
||||
pointData->SetNumberOfComponents(1);
|
||||
pointData->Allocate(psf.size());
|
||||
pointData->SetName(sf.name().c_str());
|
||||
|
||||
for (int i=0; i<psf.size(); i++)
|
||||
{
|
||||
pointData->InsertComponent(i, 0, psf[i]);
|
||||
}
|
||||
|
||||
label i = psf.size();
|
||||
|
||||
if (&sf != &GeometricField<scalar, fvPatchField, volMesh>::null())
|
||||
{
|
||||
forAll(addPointCellLabels_, api)
|
||||
{
|
||||
pointData->InsertComponent
|
||||
(
|
||||
i++,
|
||||
0,
|
||||
sf[addPointCellLabels_[api]]
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(addPointCellLabels_, api)
|
||||
{
|
||||
pointData->InsertComponent
|
||||
(
|
||||
i++,
|
||||
0,
|
||||
interpolatePointToCell(psf, addPointCellLabels_[api])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
internalMesh->GetPointData()->AddArray(pointData);
|
||||
if (!internalMesh->GetPointData()->GetScalars())
|
||||
{
|
||||
internalMesh->GetPointData()->SetScalars(pointData);
|
||||
}
|
||||
|
||||
pointData->Delete();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
@ -372,6 +372,8 @@ void Foam::vtkPV3Foam::convertVolField
|
||||
labelList& superCells
|
||||
)
|
||||
{
|
||||
const label nComp = pTraits<Type>::nComponents;
|
||||
|
||||
vtkUnstructuredGrid* vtkmesh = vtkUnstructuredGrid::SafeDownCast
|
||||
(
|
||||
GetDataSetFromBlock(output, selector, datasetNo)
|
||||
@ -379,8 +381,8 @@ void Foam::vtkPV3Foam::convertVolField
|
||||
|
||||
vtkFloatArray* celldata = vtkFloatArray::New();
|
||||
celldata->SetNumberOfTuples(superCells.size());
|
||||
celldata->SetNumberOfComponents(Type::nComponents);
|
||||
celldata->Allocate(Type::nComponents*superCells.size());
|
||||
celldata->SetNumberOfComponents(nComp);
|
||||
celldata->Allocate(nComp*superCells.size());
|
||||
celldata->SetName(tf.name().c_str());
|
||||
|
||||
if (debug)
|
||||
@ -388,17 +390,17 @@ void Foam::vtkPV3Foam::convertVolField
|
||||
Info<< "converting vol<Type>Field: " << tf.name() << nl
|
||||
<< "field size = " << tf.size() << nl
|
||||
<< "nTuples = " << superCells.size() << nl
|
||||
<< "nComps = " << Type::nComponents << endl;
|
||||
<< "nComp = " << nComp << endl;
|
||||
}
|
||||
|
||||
float vec[Type::nComponents];
|
||||
float vec[nComp];
|
||||
|
||||
forAll(superCells, scI)
|
||||
{
|
||||
const Type& t = tf[superCells[scI]];
|
||||
for (direction d=0; d<Type::nComponents; d++)
|
||||
for (direction d=0; d<nComp; d++)
|
||||
{
|
||||
vec[d] = t[d];
|
||||
vec[d] = component(t, d);
|
||||
}
|
||||
|
||||
celldata->InsertTuple(scI, vec);
|
||||
@ -409,50 +411,6 @@ void Foam::vtkPV3Foam::convertVolField
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
void Foam::vtkPV3Foam::convertVolField
|
||||
(
|
||||
const GeometricField<scalar, fvPatchField, volMesh>& sf,
|
||||
vtkMultiBlockDataSet* output,
|
||||
const selectionInfo& selector,
|
||||
const label datasetNo,
|
||||
labelList& superCells
|
||||
)
|
||||
{
|
||||
vtkUnstructuredGrid* vtkmesh = vtkUnstructuredGrid::SafeDownCast
|
||||
(
|
||||
GetDataSetFromBlock(output, selector, datasetNo)
|
||||
);
|
||||
|
||||
vtkFloatArray *cellData = vtkFloatArray::New();
|
||||
cellData->SetNumberOfTuples(superCells.size());
|
||||
cellData->SetNumberOfComponents(1);
|
||||
cellData->Allocate(superCells.size());
|
||||
cellData->SetName(sf.name().c_str());
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "converting volScalarField: " << sf.name() << nl
|
||||
<< "field size = " << sf.size() << nl
|
||||
<< "nTuples = " << superCells.size() << nl
|
||||
<< "nComps = 1" << endl;
|
||||
}
|
||||
|
||||
forAll(superCells, scI)
|
||||
{
|
||||
cellData->InsertComponent(scI, 0, sf[superCells[scI]]);
|
||||
}
|
||||
|
||||
vtkmesh->GetCellData()->AddArray(cellData);
|
||||
if (!vtkmesh->GetCellData()->GetScalars())
|
||||
{
|
||||
vtkmesh->GetCellData()->SetScalars(cellData);
|
||||
}
|
||||
|
||||
cellData->Delete();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
@ -114,6 +114,12 @@ void Foam::vtkPV3Foam::updateVolFields
|
||||
}
|
||||
|
||||
volPointInterpolation pInterp(mesh, pMesh);
|
||||
/*
|
||||
convertVolFields<Foam::label>
|
||||
(
|
||||
mesh, pInterp, objects, arraySelection, output
|
||||
);
|
||||
*/
|
||||
convertVolFields<Foam::scalar>
|
||||
(
|
||||
mesh, pInterp, objects, arraySelection, output
|
||||
@ -159,7 +165,12 @@ void Foam::vtkPV3Foam::updatePointFields
|
||||
{
|
||||
Info<< "converting Foam point fields" << endl;
|
||||
}
|
||||
|
||||
/*
|
||||
convertPointFields<Foam::label>
|
||||
(
|
||||
mesh, objects, arraySelection, output
|
||||
);
|
||||
*/
|
||||
convertPointFields<Foam::scalar>
|
||||
(
|
||||
mesh, objects, arraySelection, output
|
||||
@ -213,6 +224,11 @@ void Foam::vtkPV3Foam::updateLagrangianFields
|
||||
Info<< "converting Foam Lagrangian fields" << endl;
|
||||
}
|
||||
|
||||
convertLagrangianFields<Foam::label>
|
||||
(
|
||||
mesh, objects, arraySelection, output
|
||||
);
|
||||
|
||||
convertLagrangianFields<Foam::scalar>
|
||||
(
|
||||
mesh, objects, arraySelection, output
|
||||
|
||||
@ -108,15 +108,13 @@ void Foam::vtkPV3Foam::updateInformationLagrangian()
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "entered Foam::vtkPV3Foam::updateInformationLagrangian at timePath "
|
||||
<< dbPtr_->timePath()/"lagrangian" << endl;
|
||||
Info<< "entered Foam::vtkPV3Foam::updateInformationLagrangian "
|
||||
<< "at timePath " << dbPtr_->timePath()/"lagrangian" << endl;
|
||||
}
|
||||
|
||||
vtkDataArraySelection* arraySelection = reader_->GetRegionSelection();
|
||||
|
||||
// Search for list of lagrangian objects for this time
|
||||
// IOobjectList lagrangianObjects(dbPtr(), dbPtr_().timeName(), "lagrangian");
|
||||
|
||||
fileNameList cloudDirs
|
||||
(
|
||||
readDir(dbPtr_->timePath()/"lagrangian", fileName::DIRECTORY)
|
||||
@ -144,7 +142,11 @@ void Foam::vtkPV3Foam::updateInformationLagrangian()
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<<"no cloudDirs @ " << dbPtr_->timePath()/"lagrangian" << endl;
|
||||
if (debug)
|
||||
{
|
||||
Info<<"no clouds identified in "
|
||||
<< dbPtr_->timePath()/"lagrangian" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -159,7 +161,7 @@ void Foam::vtkPV3Foam::updateInformationPatches()
|
||||
|
||||
vtkDataArraySelection *arraySelection = reader_->GetRegionSelection();
|
||||
|
||||
//- Read patches
|
||||
// Read patches
|
||||
polyBoundaryMeshEntries patchEntries
|
||||
(
|
||||
IOobject
|
||||
@ -182,7 +184,7 @@ void Foam::vtkPV3Foam::updateInformationPatches()
|
||||
{
|
||||
label nFaces(readLabel(patchEntries[entryI].dict().lookup("nFaces")));
|
||||
|
||||
//- Valid patch if nFace > 0
|
||||
// Valid patch if nFace > 0
|
||||
if (nFaces)
|
||||
{
|
||||
// Add patch to GUI region list
|
||||
@ -208,7 +210,7 @@ void Foam::vtkPV3Foam::updateInformationZones()
|
||||
|
||||
vtkDataArraySelection *arraySelection = reader_->GetRegionSelection();
|
||||
|
||||
//- Read cell zone information
|
||||
// Read cell zone information
|
||||
{
|
||||
zonesEntries zones
|
||||
(
|
||||
@ -240,7 +242,7 @@ void Foam::vtkPV3Foam::updateInformationZones()
|
||||
superCellZonesCells_.setSize(selectInfoCellZones_.size());
|
||||
}
|
||||
|
||||
//- Read face zone information
|
||||
// Read face zone information
|
||||
{
|
||||
zonesEntries zones
|
||||
(
|
||||
@ -270,7 +272,7 @@ void Foam::vtkPV3Foam::updateInformationZones()
|
||||
}
|
||||
}
|
||||
|
||||
//- Read point zone information
|
||||
// Read point zone information
|
||||
{
|
||||
zonesEntries zones
|
||||
(
|
||||
@ -373,6 +375,11 @@ void Foam::vtkPV3Foam::updateInformationLagrangianFields()
|
||||
"lagrangian"/cloudName_
|
||||
);
|
||||
|
||||
addFields<IOField<label> >
|
||||
(
|
||||
arraySelection,
|
||||
objects
|
||||
);
|
||||
addFields<IOField<scalar> >
|
||||
(
|
||||
arraySelection,
|
||||
|
||||
@ -55,6 +55,13 @@ void Foam::vtkPV3Foam::updateInformationFields
|
||||
// Populate the GUI volume/point field arrays
|
||||
|
||||
//- Add volume fields to GUI
|
||||
/*
|
||||
addFields<GeometricField<label, patchType, meshType> >
|
||||
(
|
||||
arraySelection,
|
||||
objects
|
||||
);
|
||||
*/
|
||||
addFields<GeometricField<scalar, patchType, meshType> >
|
||||
(
|
||||
arraySelection,
|
||||
|
||||
@ -77,8 +77,8 @@ do
|
||||
[ -s "$parentDir/$check" ] || usage "file does not exist: '$parentDir/$check'"
|
||||
done
|
||||
|
||||
caseFile="$caseName.foam"
|
||||
# caseFile="$caseName.OpenFOAM"
|
||||
#caseFile="$caseName.foam"
|
||||
caseFile="$caseName.OpenFOAM"
|
||||
|
||||
case "$ParaView_VERSION" in
|
||||
2*)
|
||||
|
||||
@ -1244,7 +1244,7 @@ DOTFILE_DIRS =
|
||||
# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
|
||||
# nodes that will be shown in the graph. If the number of nodes in a graph
|
||||
# becomes larger than this value, doxygen will truncate the graph, which is
|
||||
# visualized by representing a node as a red box. Note that doxygen if the number
|
||||
# visualized by representing a node as a red box. Note that if the number
|
||||
# of direct children of the root node in a graph is already larger than
|
||||
# MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note
|
||||
# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
|
||||
|
||||
@ -31,6 +31,7 @@ wmake libso randomProcesses
|
||||
( cd turbulenceModels && ./Allwmake )
|
||||
( cd lagrangian && ./Allwmake )
|
||||
( cd postProcessing && ./Allwmake )
|
||||
( cd conversion && ./Allwmake )
|
||||
|
||||
wmake libso autoMesh
|
||||
wmake libso errorEstimation
|
||||
|
||||
@ -210,7 +210,7 @@ const Foam::entry& Foam::dictionary::lookupEntry
|
||||
(
|
||||
"dictionary::lookupEntry(const word& keyword) const",
|
||||
*this
|
||||
) << " keyword " << keyword << " is undefined in dictionary "
|
||||
) << "keyword " << keyword << " is undefined in dictionary "
|
||||
<< name()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
@ -268,7 +268,7 @@ const Foam::dictionary& Foam::dictionary::subDict(const word& keyword) const
|
||||
(
|
||||
"dictionary::subDict(const word& keyword) const",
|
||||
*this
|
||||
) << " keyword " << keyword << " is undefined in dictionary "
|
||||
) << "keyword " << keyword << " is undefined in dictionary "
|
||||
<< name()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
@ -285,7 +285,7 @@ Foam::dictionary& Foam::dictionary::subDict(const word& keyword)
|
||||
(
|
||||
"dictionary::subDict(const word& keyword)",
|
||||
*this
|
||||
) << " keyword " << keyword << " is undefined in dictionary "
|
||||
) << "keyword " << keyword << " is undefined in dictionary "
|
||||
<< name()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
@ -479,7 +479,7 @@ bool Foam::dictionary::changeKeyword
|
||||
}
|
||||
else
|
||||
{
|
||||
WarningIn("dictionary::changeKeyword(const word& old, const word& new)")
|
||||
WarningIn("dictionary::changeKeyword(const word&, const word&)")
|
||||
<< "cannot rename keyword "<< oldKeyword
|
||||
<< " to existing keyword " << newKeyword
|
||||
<< " in dictionary " << name() << endl;
|
||||
|
||||
@ -28,8 +28,6 @@ License
|
||||
#include "Time.H"
|
||||
#include "IFstream.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
@ -57,8 +55,7 @@ timeVaryingUniformFixedValuePointPatchField
|
||||
)
|
||||
:
|
||||
fixedValuePointPatchField<Type>(ptf, p, iF, mapper),
|
||||
timeDataFile_(ptf.timeDataFile_),
|
||||
timeSeries_(ptf.timeBounding())
|
||||
timeSeries_(ptf.timeSeries_)
|
||||
{}
|
||||
|
||||
|
||||
@ -73,8 +70,7 @@ timeVaryingUniformFixedValuePointPatchField
|
||||
)
|
||||
:
|
||||
fixedValuePointPatchField<Type>(p, iF),
|
||||
timeDataFile_(dict.lookup("timeDataFile")),
|
||||
timeSeries_(word(dict.lookup("timeBounding")))
|
||||
timeSeries_(this->db(), dict)
|
||||
{
|
||||
updateCoeffs();
|
||||
}
|
||||
@ -89,8 +85,7 @@ timeVaryingUniformFixedValuePointPatchField
|
||||
)
|
||||
:
|
||||
fixedValuePointPatchField<Type>(ptf),
|
||||
timeDataFile_(ptf.timeDataFile_),
|
||||
timeSeries_(ptf.timeBounding())
|
||||
timeSeries_(ptf.timeSeries_)
|
||||
{}
|
||||
|
||||
|
||||
@ -104,67 +99,12 @@ timeVaryingUniformFixedValuePointPatchField
|
||||
)
|
||||
:
|
||||
fixedValuePointPatchField<Type>(ptf, iF),
|
||||
timeDataFile_(ptf.timeDataFile_),
|
||||
timeSeries_(ptf.timeBounding())
|
||||
timeSeries_(ptf.timeSeries_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Type
|
||||
Foam::timeVaryingUniformFixedValuePointPatchField<Type>::
|
||||
currentValue()
|
||||
{
|
||||
if (timeSeries_.size() == 0)
|
||||
{
|
||||
fileName fName(timeDataFile_);
|
||||
fName.expand();
|
||||
|
||||
if (fName.size() == 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"timeVaryingUniformFixedValuePointPatchField"
|
||||
"::currentValue()"
|
||||
) << "timeDataFile not specified for Patch "
|
||||
<< this->patch().name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
else
|
||||
{
|
||||
// relative path
|
||||
if (fName[0] != '/')
|
||||
{
|
||||
fName = this->db().path()/fName;
|
||||
}
|
||||
|
||||
// just in case we change the interface to timeSeries
|
||||
word boundType = timeBounding();
|
||||
|
||||
IFstream(fName)() >> timeSeries_;
|
||||
timeSeries_.bounding(boundType);
|
||||
|
||||
// be a bit paranoid and check that the list is okay
|
||||
timeSeries_.check();
|
||||
}
|
||||
|
||||
if (timeSeries_.size() == 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"timeVaryingUniformFixedValuePointPatchField"
|
||||
"::currentValue()"
|
||||
) << "empty time series for Patch "
|
||||
<< this->patch().name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
return timeSeries_(this->db().time().timeOutputValue());
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::timeVaryingUniformFixedValuePointPatchField<Type>::updateCoeffs()
|
||||
{
|
||||
@ -173,7 +113,7 @@ void Foam::timeVaryingUniformFixedValuePointPatchField<Type>::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
this->operator==(currentValue());
|
||||
this->operator==(timeSeries_(this->db().time().timeOutputValue()));
|
||||
fixedValuePointPatchField<Type>::updateCoeffs();
|
||||
}
|
||||
|
||||
@ -182,13 +122,8 @@ template<class Type>
|
||||
void Foam::timeVaryingUniformFixedValuePointPatchField<Type>::write(Ostream& os) const
|
||||
{
|
||||
fixedValuePointPatchField<Type>::write(os);
|
||||
os.writeKeyword("timeDataFile")
|
||||
<< timeDataFile_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("timeBounding")
|
||||
<< timeBounding() << token::END_STATEMENT << nl;
|
||||
timeSeries_.write(os);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -40,7 +40,7 @@ SourceFiles
|
||||
#define timeVaryingUniformFixedValuePointPatchField_H
|
||||
|
||||
#include "fixedValuePointPatchField.H"
|
||||
#include "timeSeries.H"
|
||||
#include "interpolationTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -58,14 +58,9 @@ class timeVaryingUniformFixedValuePointPatchField
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- file containing time/uniformFixedValue
|
||||
fileName timeDataFile_;
|
||||
|
||||
//- the time series being used, including the bounding treatment
|
||||
timeSeries<Type> timeSeries_;
|
||||
interpolationTable<Type> timeSeries_;
|
||||
|
||||
//- interpolate the value at the current time
|
||||
Type currentValue();
|
||||
|
||||
public:
|
||||
|
||||
@ -138,14 +133,8 @@ public:
|
||||
|
||||
// Access
|
||||
|
||||
//- Return the out-of-bounds treatment as a word
|
||||
word timeBounding() const
|
||||
{
|
||||
return timeSeries_.bounding();
|
||||
}
|
||||
|
||||
//- Return the time series used
|
||||
const timeSeries<Type>& timeData() const
|
||||
const interpolationTable<Type>& timeSeries() const
|
||||
{
|
||||
return timeSeries_;
|
||||
}
|
||||
|
||||
@ -0,0 +1,482 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 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
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "interpolationTable.H"
|
||||
#include "IFstream.H"
|
||||
#include "objectRegistry.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::interpolationTable<Type>::interpolationTable()
|
||||
:
|
||||
List<Tuple2<scalar, Type> >(),
|
||||
dict_(dictionary::null),
|
||||
boundAction_(interpolationTable::WARN),
|
||||
fileName_("undefined_fileName")
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::interpolationTable<Type>::interpolationTable
|
||||
(
|
||||
const objectRegistry& obr,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
List<Tuple2<scalar, Type> >(),
|
||||
dict_(dict),
|
||||
boundAction_(wordToBoundAction(dict.lookup("boundAction"))),
|
||||
fileName_(dict.lookup("fileName"))
|
||||
{
|
||||
fileName_.expand();
|
||||
|
||||
// Correct for relative path
|
||||
if (fileName_[0] != '/')
|
||||
{
|
||||
fileName_ = obr.db().path()/fileName_;
|
||||
}
|
||||
|
||||
// Read data from file
|
||||
IFstream(fileName_)() >> *this;
|
||||
|
||||
// Check that the data is okay
|
||||
check();
|
||||
|
||||
if (this->size() == 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::interpolationTable<Type>::interpolationTable"
|
||||
"(const dictionary& dict)"
|
||||
) << "table is empty" << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::interpolationTable<Type>::interpolationTable
|
||||
(
|
||||
const interpolationTable& interpTable
|
||||
)
|
||||
:
|
||||
List<Tuple2<scalar, Type> >(interpTable),
|
||||
dict_(interpTable.dict_),
|
||||
boundAction_(interpTable.boundAction_),
|
||||
fileName_(interpTable.fileName_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::interpolationTable<Type>::~interpolationTable()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::word Foam::interpolationTable<Type>::boundActionToWord
|
||||
(
|
||||
const boundActions& bound
|
||||
) const
|
||||
{
|
||||
word enumName("warn");
|
||||
|
||||
switch (bound)
|
||||
{
|
||||
case interpolationTable::ERROR:
|
||||
{
|
||||
enumName = "error";
|
||||
break;
|
||||
}
|
||||
case interpolationTable::WARN:
|
||||
{
|
||||
enumName = "warn";
|
||||
break;
|
||||
}
|
||||
case interpolationTable::CLAMP:
|
||||
{
|
||||
enumName = "clamp";
|
||||
break;
|
||||
}
|
||||
case interpolationTable::REPEAT:
|
||||
{
|
||||
enumName = "repeat";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return enumName;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
typename Foam::interpolationTable<Type>::boundActions
|
||||
Foam::interpolationTable<Type>::wordToBoundAction
|
||||
(
|
||||
const word& bound
|
||||
) const
|
||||
{
|
||||
if (bound == "error")
|
||||
{
|
||||
return interpolationTable::ERROR;
|
||||
}
|
||||
else if (bound == "warn")
|
||||
{
|
||||
return interpolationTable::WARN;
|
||||
}
|
||||
else if (bound == "clamp")
|
||||
{
|
||||
return interpolationTable::CLAMP;
|
||||
}
|
||||
else if (bound == "repeat")
|
||||
{
|
||||
return interpolationTable::REPEAT;
|
||||
}
|
||||
else
|
||||
{
|
||||
WarningIn
|
||||
(
|
||||
"Foam::interpolationTable<Type>::wordToBoundAction(const word&)"
|
||||
) << "bad bounding specifier " << bound << " using 'warn'" << endl;
|
||||
|
||||
return interpolationTable::WARN;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::interpolationTable<Type>::check() const
|
||||
{
|
||||
label n = size();
|
||||
scalar prevValue = List<Tuple2<scalar, Type> >::operator[](0).first();
|
||||
|
||||
for (label i=1; i<n; ++i)
|
||||
{
|
||||
const scalar currValue =
|
||||
List<Tuple2<scalar, Type> >::operator[](i).first();
|
||||
|
||||
// avoid duplicate values (divide-by-zero error)
|
||||
if (currValue <= prevValue)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::interpolationTable<Type>::checkOrder() const"
|
||||
) << "out-of-order value: "
|
||||
<< currValue << " at index " << i << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
prevValue = currValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
typename Foam::interpolationTable<Type>::boundActions
|
||||
Foam::interpolationTable<Type>::boundAction
|
||||
(
|
||||
const boundActions& bound
|
||||
)
|
||||
{
|
||||
boundActions prev = boundAction_;
|
||||
boundAction_ = bound;
|
||||
return prev;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::interpolationTable<Type>::write(Ostream& os) const
|
||||
{
|
||||
os.writeKeyword("fileName")
|
||||
<< fileName_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("boundAction")
|
||||
<< boundActionToWord(boundAction_) << token::END_STATEMENT << nl;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
const Foam::Tuple2<Foam::scalar, Type>&
|
||||
Foam::interpolationTable<Type>::operator[](const label i) const
|
||||
{
|
||||
label ii = i;
|
||||
label n = size();
|
||||
|
||||
if (n <= 1)
|
||||
{
|
||||
ii = 0;
|
||||
}
|
||||
else if (ii < 0)
|
||||
{
|
||||
switch (boundAction_)
|
||||
{
|
||||
case interpolationTable::ERROR:
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::interpolationTable<Type>::operator[]"
|
||||
"(const label) const"
|
||||
) << "index (" << ii << ") underflow" << nl
|
||||
<< exit(FatalError);
|
||||
break;
|
||||
}
|
||||
case interpolationTable::WARN:
|
||||
{
|
||||
WarningIn
|
||||
(
|
||||
"Foam::interpolationTable<Type>::operator[]"
|
||||
"(const label) const"
|
||||
) << "index (" << ii << ") underflow" << nl
|
||||
<< " Continuing with the first entry"
|
||||
<< endl;
|
||||
// fall-through to 'CLAMP'
|
||||
}
|
||||
case interpolationTable::CLAMP:
|
||||
{
|
||||
ii = 0;
|
||||
break;
|
||||
}
|
||||
case interpolationTable::REPEAT:
|
||||
{
|
||||
while (ii < 0)
|
||||
{
|
||||
ii += n;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (ii >= n)
|
||||
{
|
||||
switch (boundAction_)
|
||||
{
|
||||
case interpolationTable::ERROR:
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::interpolationTable<Type>::operator[]"
|
||||
"(const label) const"
|
||||
) << "index (" << ii << ") overflow" << nl
|
||||
<< exit(FatalError);
|
||||
break;
|
||||
}
|
||||
case interpolationTable::WARN:
|
||||
{
|
||||
WarningIn
|
||||
(
|
||||
"Foam::interpolationTable<Type>::operator[]"
|
||||
"(const label) const"
|
||||
) << "index (" << ii << ") overflow" << nl
|
||||
<< " Continuing with the last entry"
|
||||
<< endl;
|
||||
// fall-through to 'CLAMP'
|
||||
}
|
||||
case interpolationTable::CLAMP:
|
||||
{
|
||||
ii = n - 1;
|
||||
break;
|
||||
}
|
||||
case interpolationTable::REPEAT:
|
||||
{
|
||||
while (ii >= n)
|
||||
{
|
||||
ii -= n;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return List<Tuple2<scalar, Type> >::operator[](ii);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Type Foam::interpolationTable<Type>::operator()(const scalar value) const
|
||||
{
|
||||
label n = size();
|
||||
|
||||
if (n <= 1)
|
||||
{
|
||||
return List<Tuple2<scalar, Type> >::operator[](0).second();
|
||||
}
|
||||
|
||||
scalar minLimit = List<Tuple2<scalar, Type> >::operator[](0).first();
|
||||
scalar maxLimit = List<Tuple2<scalar, Type> >::operator[](n-1).first();
|
||||
scalar lookupValue = value;
|
||||
|
||||
if (lookupValue < minLimit)
|
||||
{
|
||||
switch (boundAction_)
|
||||
{
|
||||
case interpolationTable::ERROR:
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::interpolationTable<Type>::operator[]"
|
||||
"(const scalar) const"
|
||||
) << "value (" << lookupValue << ") underflow" << nl
|
||||
<< exit(FatalError);
|
||||
break;
|
||||
}
|
||||
case interpolationTable::WARN:
|
||||
{
|
||||
WarningIn
|
||||
(
|
||||
"Foam::interpolationTable<Type>::operator[]"
|
||||
"(const scalar) const"
|
||||
) << "value (" << lookupValue << ") underflow" << nl
|
||||
<< " Continuing with the first entry"
|
||||
<< endl;
|
||||
// fall-through to 'CLAMP'
|
||||
}
|
||||
case interpolationTable::CLAMP:
|
||||
{
|
||||
return List<Tuple2<scalar, Type> >::operator[](0).second();
|
||||
break;
|
||||
}
|
||||
case interpolationTable::REPEAT:
|
||||
{
|
||||
// adjust lookupValue to >= 0
|
||||
while (lookupValue < 0)
|
||||
{
|
||||
lookupValue += maxLimit;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lookupValue >= maxLimit)
|
||||
{
|
||||
switch (boundAction_)
|
||||
{
|
||||
case interpolationTable::ERROR:
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::interpolationTable<Type>::operator[]"
|
||||
"(const label) const"
|
||||
) << "value (" << lookupValue << ") overflow" << nl
|
||||
<< exit(FatalError);
|
||||
break;
|
||||
}
|
||||
case interpolationTable::WARN:
|
||||
{
|
||||
WarningIn
|
||||
(
|
||||
"Foam::interpolationTable<Type>::operator[]"
|
||||
"(const label) const"
|
||||
) << "value (" << lookupValue << ") overflow" << nl
|
||||
<< " Continuing with the last entry"
|
||||
<< endl;
|
||||
// fall-through to 'CLAMP'
|
||||
}
|
||||
case interpolationTable::CLAMP:
|
||||
{
|
||||
return List<Tuple2<scalar, Type> >::operator[](n-1).second();
|
||||
break;
|
||||
}
|
||||
case interpolationTable::REPEAT:
|
||||
{
|
||||
// adjust lookupValue <= maxLimit
|
||||
while (lookupValue > maxLimit)
|
||||
{
|
||||
lookupValue -= maxLimit;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
label lo = 0;
|
||||
label hi = 0;
|
||||
|
||||
// look for the correct range
|
||||
for (label i = 0; i < n; ++i)
|
||||
{
|
||||
if (lookupValue >= List<Tuple2<scalar, Type> >::operator[](i).first())
|
||||
{
|
||||
lo = hi = i;
|
||||
}
|
||||
else
|
||||
{
|
||||
hi = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (lo == hi)
|
||||
{
|
||||
// we are at the end of the table - or there is only a single entry
|
||||
return List<Tuple2<scalar, Type> >::operator[](hi).second();
|
||||
}
|
||||
else if (hi == 0)
|
||||
{
|
||||
// this treatment should should only occur under these conditions:
|
||||
// -> the 'REPEAT' treatment
|
||||
// -> (0 <= value <= minLimit)
|
||||
// -> minLimit > 0
|
||||
// Use the value at maxLimit as the value for value=0
|
||||
lo = n - 1;
|
||||
|
||||
return
|
||||
(
|
||||
List<Tuple2<scalar, Type> >::operator[](lo).second()
|
||||
+ (
|
||||
List<Tuple2<scalar, Type> >::operator[](hi).second()
|
||||
- List<Tuple2<scalar, Type> >::operator[](lo).second()
|
||||
)
|
||||
*(lookupValue / minLimit)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// normal interpolation
|
||||
return
|
||||
(
|
||||
List<Tuple2<scalar, Type> >::operator[](lo).second()
|
||||
+ (
|
||||
List<Tuple2<scalar, Type> >::operator[](hi).second()
|
||||
- List<Tuple2<scalar, Type> >::operator[](lo).second()
|
||||
)
|
||||
*(
|
||||
lookupValue
|
||||
- List<Tuple2<scalar, Type> >::operator[](lo).first()
|
||||
)
|
||||
/(
|
||||
List<Tuple2<scalar, Type> >::operator[](hi).first()
|
||||
- List<Tuple2<scalar, Type> >::operator[](lo).first()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::timeSeries
|
||||
Foam::interpolationTable
|
||||
|
||||
Description
|
||||
A list of times and values.
|
||||
@ -40,12 +40,12 @@ Note
|
||||
- Accessing a list with a single element will always return the same value.
|
||||
|
||||
SourceFiles
|
||||
timeSeries.C
|
||||
interpolationTable.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef timeSeries_H
|
||||
#define timeSeries_H
|
||||
#ifndef interpolationTable_H
|
||||
#define interpolationTable_H
|
||||
|
||||
#include "List.H"
|
||||
#include "Tuple2.H"
|
||||
@ -55,21 +55,23 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class objectRegistry;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class timeSeries Declaration
|
||||
Class interpolationTable Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class T>
|
||||
class timeSeries
|
||||
template<class Type>
|
||||
class interpolationTable
|
||||
:
|
||||
public List<Tuple2<scalar, T> >
|
||||
public List<Tuple2<scalar, Type> >
|
||||
{
|
||||
public:
|
||||
|
||||
// Public data types
|
||||
|
||||
//- Enumeration for handling out-of-bound times
|
||||
enum bounds
|
||||
//- Enumeration for handling out-of-bound values
|
||||
enum boundActions
|
||||
{
|
||||
ERROR, /*!< Exit with a FatalError */
|
||||
WARN, /*!< Issue warning and clamp value (default) */
|
||||
@ -77,86 +79,96 @@ public:
|
||||
REPEAT /*!< Treat as a repeating list */
|
||||
};
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private data
|
||||
|
||||
//- Enumeration for handling out-of-bound times
|
||||
bounds bounding_;
|
||||
//- Parent dictionary
|
||||
const dictionary& dict_;
|
||||
|
||||
//- Enumeration for handling out-of-bound values
|
||||
boundActions boundAction_;
|
||||
|
||||
//- File name
|
||||
fileName fileName_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null, optionally with a given bounding
|
||||
timeSeries(const bounds = timeSeries::WARN);
|
||||
//- Construct null
|
||||
interpolationTable();
|
||||
|
||||
//- Construct null with a given bounding
|
||||
timeSeries(const word&);
|
||||
//- Construct from objectRegistry and dictionary
|
||||
interpolationTable(const objectRegistry& obr, const dictionary& dict);
|
||||
|
||||
//- Construct from Istream, optionally with a given bounding
|
||||
timeSeries(Istream&, const bounds = timeSeries::WARN);
|
||||
//- Construct copy
|
||||
interpolationTable(const interpolationTable& interpTable);
|
||||
|
||||
//- Construct from Istream with a given bounding
|
||||
timeSeries(Istream&, const word&);
|
||||
|
||||
// Destructor
|
||||
//- Destructor
|
||||
~interpolationTable();
|
||||
|
||||
~timeSeries();
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
// Access
|
||||
|
||||
//- Return the size
|
||||
label size() const
|
||||
{
|
||||
return List<Tuple2<scalar, T> >::size();
|
||||
}
|
||||
//- Return the size
|
||||
label size() const
|
||||
{
|
||||
return List<Tuple2<scalar, Type> >::size();
|
||||
}
|
||||
|
||||
//- Return the out-of-bounds treatment as a word
|
||||
word bounding() const;
|
||||
//- Return the out-of-bounds treatment as a word
|
||||
word boundActionToWord(const boundActions& bound) const;
|
||||
|
||||
// Check
|
||||
//- Return the out-of-bounds treatment as an enumeration
|
||||
boundActions wordToBoundAction(const word& bound) const;
|
||||
|
||||
//- Check that list is monotonically increasing
|
||||
// Exit with a FatalError if there is a problem
|
||||
void check() const;
|
||||
|
||||
// Edit
|
||||
// Check
|
||||
|
||||
//- Set the out-of-bounds treatment from enum, return previous setting
|
||||
bounds bounding(const bounds& bound)
|
||||
{
|
||||
bounds prev = bounding_;
|
||||
bounding_ = bound;
|
||||
return prev;
|
||||
}
|
||||
//- Check that list is monotonically increasing
|
||||
// Exit with a FatalError if there is a problem
|
||||
void check() const;
|
||||
|
||||
//- Set the out-of-bounds treatment from word
|
||||
void bounding(const word& bound);
|
||||
|
||||
// Member Operators
|
||||
// Edit
|
||||
|
||||
//- Return an element of constant Tuple2<scalar, T>
|
||||
const Tuple2<scalar, T>& operator[](const label) const;
|
||||
//- Set the out-of-bounds treatment from enum, return previous
|
||||
// setting
|
||||
boundActions boundAction(const boundActions& bound);
|
||||
|
||||
//- Return an interpolated value
|
||||
T operator()(const scalar) const;
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Return an element of constant Tuple2<scalar, Type>
|
||||
const Tuple2<scalar, Type>& operator[](const label) const;
|
||||
|
||||
//- Return an interpolated value
|
||||
Type operator()(const scalar) const;
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Write
|
||||
void write(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "timeSeries.C"
|
||||
# include "interpolationTable.C"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,402 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 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
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "timeSeries.H"
|
||||
#include "Istream.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<typename T>
|
||||
Foam::timeSeries<T>::timeSeries(const bounds bound)
|
||||
:
|
||||
List<Tuple2<scalar, T> >(),
|
||||
bounding_(bound)
|
||||
{}
|
||||
|
||||
|
||||
template<typename T>
|
||||
Foam::timeSeries<T>::timeSeries(const word& bound)
|
||||
:
|
||||
List<Tuple2<scalar, T> >(),
|
||||
bounding_(timeSeries::WARN)
|
||||
{
|
||||
bounding(bound);
|
||||
}
|
||||
|
||||
|
||||
template<typename T>
|
||||
Foam::timeSeries<T>::timeSeries(Istream& is, const bounds bound)
|
||||
:
|
||||
List<Tuple2<scalar, T> >(is),
|
||||
bounding_(bound)
|
||||
{}
|
||||
|
||||
|
||||
template<typename T>
|
||||
Foam::timeSeries<T>::timeSeries(Istream& is, const word& bound)
|
||||
:
|
||||
List<Tuple2<scalar, T> >(is),
|
||||
bounding_(timeSeries::WARN)
|
||||
{
|
||||
bounding(bound);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<typename T>
|
||||
Foam::timeSeries<T>::~timeSeries()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<typename T>
|
||||
Foam::word Foam::timeSeries<T>::bounding() const
|
||||
{
|
||||
word enumName("warn");
|
||||
|
||||
switch (bounding_)
|
||||
{
|
||||
case timeSeries::ERROR:
|
||||
enumName = "error";
|
||||
break;
|
||||
|
||||
case timeSeries::WARN:
|
||||
enumName = "warn";
|
||||
break;
|
||||
|
||||
case timeSeries::CLAMP:
|
||||
enumName = "clamp";
|
||||
break;
|
||||
|
||||
case timeSeries::REPEAT:
|
||||
enumName = "repeat";
|
||||
break;
|
||||
}
|
||||
|
||||
return enumName;
|
||||
}
|
||||
|
||||
|
||||
template<typename T>
|
||||
void Foam::timeSeries<T>::bounding(const word& bound)
|
||||
{
|
||||
if (bound == "error")
|
||||
{
|
||||
bounding_ = timeSeries::ERROR;
|
||||
}
|
||||
else if (bound == "warn")
|
||||
{
|
||||
bounding_ = timeSeries::WARN;
|
||||
}
|
||||
else if (bound == "clamp")
|
||||
{
|
||||
bounding_ = timeSeries::CLAMP;
|
||||
}
|
||||
else if (bound == "repeat")
|
||||
{
|
||||
bounding_ = timeSeries::REPEAT;
|
||||
}
|
||||
else
|
||||
{
|
||||
WarningIn("Foam::timeSeries<T>::boundingEnum(const word&)")
|
||||
<< "bad bounding specifier " << bound << " using 'warn'" << endl;
|
||||
|
||||
bounding_ = timeSeries::WARN;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<typename T>
|
||||
void Foam::timeSeries<T>::check() const
|
||||
{
|
||||
label n = size();
|
||||
scalar prevTime = List<Tuple2<scalar, T> >::operator[](0).first();
|
||||
|
||||
for (label i = 1; i < n; ++i)
|
||||
{
|
||||
const scalar currTime = List<Tuple2<scalar, T> >::operator[](i).first();
|
||||
|
||||
// avoid duplicate times (divide-by-zero error)
|
||||
if (currTime <= prevTime)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::timeSeries<T>::checkOrder() const"
|
||||
) << "out-of-order time: "
|
||||
<< currTime << " at index " << i << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
prevTime = currTime;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
template<typename T>
|
||||
const Foam::Tuple2<Foam::scalar, T>&
|
||||
Foam::timeSeries<T>::operator[](const label i) const
|
||||
{
|
||||
label ii = i;
|
||||
label n = size();
|
||||
|
||||
if (n <= 1)
|
||||
{
|
||||
ii = 0;
|
||||
}
|
||||
else if (ii < 0)
|
||||
{
|
||||
switch (bounding_)
|
||||
{
|
||||
case timeSeries::ERROR:
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::timeSeries<T>::operator[](const label) const"
|
||||
) << "index (" << ii << ") underflow" << nl
|
||||
<< exit(FatalError);
|
||||
break;
|
||||
|
||||
case timeSeries::WARN:
|
||||
WarningIn
|
||||
(
|
||||
"Foam::timeSeries<T>::operator[](const label) const"
|
||||
) << "index (" << ii << ") underflow" << nl
|
||||
<< " Continuing with the first entry"
|
||||
<< endl;
|
||||
// fall-through to 'CLAMP'
|
||||
|
||||
case timeSeries::CLAMP:
|
||||
ii = 0;
|
||||
break;
|
||||
|
||||
case timeSeries::REPEAT:
|
||||
while (ii < 0)
|
||||
{
|
||||
ii += n;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (ii >= n)
|
||||
{
|
||||
switch (bounding_)
|
||||
{
|
||||
case timeSeries::ERROR:
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::timeSeries<T>::operator[](const label) const"
|
||||
) << "index (" << ii << ") overflow" << nl
|
||||
<< exit(FatalError);
|
||||
break;
|
||||
|
||||
case timeSeries::WARN:
|
||||
WarningIn
|
||||
(
|
||||
"Foam::timeSeries<T>::operator[](const label) const"
|
||||
) << "index (" << ii << ") overflow" << nl
|
||||
<< " Continuing with the last entry"
|
||||
<< endl;
|
||||
// fall-through to 'CLAMP'
|
||||
|
||||
case timeSeries::CLAMP:
|
||||
ii = n - 1;
|
||||
break;
|
||||
|
||||
case timeSeries::REPEAT:
|
||||
while (ii >= n)
|
||||
{
|
||||
ii -= n;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return List<Tuple2<scalar, T> >::operator[](ii);
|
||||
}
|
||||
|
||||
|
||||
template<typename T>
|
||||
T Foam::timeSeries<T>::operator()(const scalar timeValue) const
|
||||
{
|
||||
label n = size();
|
||||
|
||||
if (n <= 1)
|
||||
{
|
||||
return List<Tuple2<scalar, T> >::operator[](0).second();
|
||||
}
|
||||
|
||||
scalar minTime = List<Tuple2<scalar, T> >::operator[](0).first();
|
||||
scalar maxTime = List<Tuple2<scalar, T> >::operator[](n-1).first();
|
||||
scalar lookupTime = timeValue;
|
||||
|
||||
if (lookupTime < minTime)
|
||||
{
|
||||
switch (bounding_)
|
||||
{
|
||||
case timeSeries::ERROR:
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::timeSeries<T>::operator[](const scalar) const"
|
||||
) << "time (" << lookupTime << ") underflow" << nl
|
||||
<< exit(FatalError);
|
||||
break;
|
||||
|
||||
case timeSeries::WARN:
|
||||
WarningIn
|
||||
(
|
||||
"Foam::timeSeries<T>::operator[](const scalar) const"
|
||||
) << "time (" << lookupTime << ") underflow" << nl
|
||||
<< " Continuing with the first entry"
|
||||
<< endl;
|
||||
// fall-through to 'CLAMP'
|
||||
|
||||
case timeSeries::CLAMP:
|
||||
return List<Tuple2<scalar, T> >::operator[](0).second();
|
||||
break;
|
||||
|
||||
case timeSeries::REPEAT:
|
||||
// adjust lookupTime to >= 0
|
||||
while (lookupTime < 0)
|
||||
{
|
||||
lookupTime += maxTime;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (lookupTime >= maxTime)
|
||||
{
|
||||
switch (bounding_)
|
||||
{
|
||||
case timeSeries::ERROR:
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::timeSeries<T>::operator[](const label) const"
|
||||
) << "time (" << lookupTime << ") overflow" << nl
|
||||
<< exit(FatalError);
|
||||
break;
|
||||
|
||||
case timeSeries::WARN:
|
||||
WarningIn
|
||||
(
|
||||
"Foam::timeSeries<T>::operator[](const label) const"
|
||||
) << "time (" << lookupTime << ") overflow" << nl
|
||||
<< " Continuing with the last entry"
|
||||
<< endl;
|
||||
// fall-through to 'CLAMP'
|
||||
|
||||
case timeSeries::CLAMP:
|
||||
return List<Tuple2<scalar, T> >::operator[](n-1).second();
|
||||
break;
|
||||
|
||||
case timeSeries::REPEAT:
|
||||
// adjust lookupTime <= maxTime
|
||||
while (lookupTime > maxTime)
|
||||
{
|
||||
lookupTime -= maxTime;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
label lo = 0;
|
||||
label hi = 0;
|
||||
|
||||
// look for the correct range
|
||||
for (label i = 0; i < n; ++i)
|
||||
{
|
||||
if (lookupTime >= List<Tuple2<scalar, T> >::operator[](i).first())
|
||||
{
|
||||
lo = hi = i;
|
||||
}
|
||||
else
|
||||
{
|
||||
hi = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (lo == hi)
|
||||
{
|
||||
// we are at the end of the table - or there is only a single entry
|
||||
return List<Tuple2<scalar, T> >::operator[](hi).second();
|
||||
}
|
||||
else if (hi == 0)
|
||||
{
|
||||
// this treatment should should only occur under these condition:
|
||||
// -> the 'REPEAT' treatment
|
||||
// -> (0 <= time <= minTime)
|
||||
// -> minTime > 0
|
||||
// Use the value at maxTime as the value for time=0
|
||||
lo = n - 1;
|
||||
|
||||
return
|
||||
(
|
||||
List<Tuple2<scalar, T> >::operator[](lo).second()
|
||||
+
|
||||
(
|
||||
List<Tuple2<scalar, T> >::operator[](hi).second()
|
||||
- List<Tuple2<scalar, T> >::operator[](lo).second()
|
||||
)
|
||||
* (lookupTime / minTime)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// normal interpolation
|
||||
return
|
||||
(
|
||||
List<Tuple2<scalar, T> >::operator[](lo).second()
|
||||
+
|
||||
(
|
||||
List<Tuple2<scalar, T> >::operator[](hi).second()
|
||||
- List<Tuple2<scalar, T> >::operator[](lo).second()
|
||||
)
|
||||
*
|
||||
(
|
||||
lookupTime
|
||||
- List<Tuple2<scalar, T> >::operator[](lo).first()
|
||||
)
|
||||
/
|
||||
(
|
||||
List<Tuple2<scalar, T> >::operator[](hi).first()
|
||||
- List<Tuple2<scalar, T> >::operator[](lo).first()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -119,6 +119,7 @@ namespace Foam
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "pTraits.H"
|
||||
#include "direction.H"
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
@ -202,6 +203,16 @@ MAXMIN(long, int, long)
|
||||
MAXMIN(long long, int, long long)
|
||||
MAXMIN(long long, long long, int)
|
||||
|
||||
inline label& setComponent(label& l, const direction)
|
||||
{
|
||||
return l;
|
||||
}
|
||||
|
||||
inline label component(const label l, const direction)
|
||||
{
|
||||
return l;
|
||||
}
|
||||
|
||||
inline label mag(const label l)
|
||||
{
|
||||
return ::abs(l);
|
||||
|
||||
4
src/conversion/Allwmake
Executable file
4
src/conversion/Allwmake
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
set -x
|
||||
|
||||
wmake libso
|
||||
3
src/conversion/Make/files
Normal file
3
src/conversion/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
polyDualMesh/polyDualMesh.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libconversion
|
||||
5
src/conversion/Make/options
Normal file
5
src/conversion/Make/options
Normal file
@ -0,0 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lmeshTools
|
||||
@ -50,15 +50,15 @@ namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(hexRef8, 0);
|
||||
|
||||
// Reduction class. If x and y are not equal assign value.
|
||||
//- Reduction class. If x and y are not equal assign value.
|
||||
template< int value >
|
||||
class ifEqEqOp
|
||||
{
|
||||
public:
|
||||
void operator()( label& x, const label& y ) const
|
||||
{
|
||||
x = (x==y) ? x:value;
|
||||
}
|
||||
x = (x==y) ? x:value;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -78,7 +78,7 @@ $(derivedFvPatchFields)/freestream/freestreamFvPatchFields.C
|
||||
$(derivedFvPatchFields)/freestreamPressure/freestreamPressureFvPatchScalarField.C
|
||||
$(derivedFvPatchFields)/inletOutlet/inletOutletFvPatchFields.C
|
||||
$(derivedFvPatchFields)/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C
|
||||
$(derivedFvPatchFields)/massFlowRateInletVelocity/massFlowRateInletVelocityFvPatchVectorField.C
|
||||
$(derivedFvPatchFields)/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C
|
||||
$(derivedFvPatchFields)/movingWallVelocity/movingWallVelocityFvPatchVectorField.C
|
||||
$(derivedFvPatchFields)/oscillatingFixedValue/oscillatingFixedValueFvPatchFields.C
|
||||
$(derivedFvPatchFields)/outletInlet/outletInletFvPatchFields.C
|
||||
@ -96,7 +96,7 @@ $(derivedFvPatchFields)/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVe
|
||||
$(derivedFvPatchFields)/syringePressure/syringePressureFvPatchScalarField.C
|
||||
$(derivedFvPatchFields)/timeVaryingMappedFixedValue/AverageIOFields.C
|
||||
$(derivedFvPatchFields)/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchFields.C
|
||||
$(derivedFvPatchFields)/timeVaryingMassFlowRateInletVelocity/timeVaryingMassFlowRateInletVelocityFvPatchVectorField.C
|
||||
$(derivedFvPatchFields)/timeVaryingFlowRateInletVelocity/timeVaryingFlowRateInletVelocityFvPatchVectorField.C
|
||||
$(derivedFvPatchFields)/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFvPatchFields.C
|
||||
$(derivedFvPatchFields)/totalPressure/totalPressureFvPatchScalarField.C
|
||||
$(derivedFvPatchFields)/timeVaryingUniformTotalPressure/timeVaryingUniformTotalPressureFvPatchScalarField.C
|
||||
|
||||
@ -24,7 +24,7 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "massFlowRateInletVelocityFvPatchVectorField.H"
|
||||
#include "flowRateInletVelocityFvPatchVectorField.H"
|
||||
#include "volFields.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fvPatchFieldMapper.H"
|
||||
@ -33,38 +33,40 @@ License
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::
|
||||
massFlowRateInletVelocityFvPatchVectorField::
|
||||
massFlowRateInletVelocityFvPatchVectorField
|
||||
flowRateInletVelocityFvPatchVectorField::
|
||||
flowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<vector, volMesh>& iF
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<vector>(p, iF),
|
||||
massFlowRate_(0),
|
||||
flowRate_(0),
|
||||
phiName_("phi"),
|
||||
rhoName_("rho")
|
||||
{}
|
||||
|
||||
|
||||
Foam::
|
||||
massFlowRateInletVelocityFvPatchVectorField::
|
||||
massFlowRateInletVelocityFvPatchVectorField
|
||||
flowRateInletVelocityFvPatchVectorField::
|
||||
flowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const massFlowRateInletVelocityFvPatchVectorField& ptf,
|
||||
const flowRateInletVelocityFvPatchVectorField& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<vector, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
|
||||
massFlowRate_(ptf.massFlowRate_),
|
||||
flowRate_(ptf.flowRate_),
|
||||
phiName_(ptf.phiName_),
|
||||
rhoName_(ptf.rhoName_)
|
||||
{}
|
||||
|
||||
|
||||
Foam::
|
||||
massFlowRateInletVelocityFvPatchVectorField::
|
||||
massFlowRateInletVelocityFvPatchVectorField
|
||||
flowRateInletVelocityFvPatchVectorField::
|
||||
flowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<vector, volMesh>& iF,
|
||||
@ -72,7 +74,7 @@ massFlowRateInletVelocityFvPatchVectorField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<vector>(p, iF, dict),
|
||||
massFlowRate_(readScalar(dict.lookup("massFlowRate"))),
|
||||
flowRate_(readScalar(dict.lookup("flowRate"))),
|
||||
phiName_("phi"),
|
||||
rhoName_("rho")
|
||||
{
|
||||
@ -87,29 +89,31 @@ massFlowRateInletVelocityFvPatchVectorField
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::
|
||||
massFlowRateInletVelocityFvPatchVectorField::
|
||||
massFlowRateInletVelocityFvPatchVectorField
|
||||
flowRateInletVelocityFvPatchVectorField::
|
||||
flowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const massFlowRateInletVelocityFvPatchVectorField& ptf
|
||||
const flowRateInletVelocityFvPatchVectorField& ptf
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<vector>(ptf),
|
||||
massFlowRate_(ptf.massFlowRate_),
|
||||
flowRate_(ptf.flowRate_),
|
||||
phiName_(ptf.phiName_),
|
||||
rhoName_(ptf.rhoName_)
|
||||
{}
|
||||
|
||||
|
||||
Foam::
|
||||
massFlowRateInletVelocityFvPatchVectorField::
|
||||
massFlowRateInletVelocityFvPatchVectorField
|
||||
flowRateInletVelocityFvPatchVectorField::
|
||||
flowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const massFlowRateInletVelocityFvPatchVectorField& ptf,
|
||||
const flowRateInletVelocityFvPatchVectorField& ptf,
|
||||
const DimensionedField<vector, volMesh>& iF
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<vector>(ptf, iF),
|
||||
massFlowRate_(ptf.massFlowRate_),
|
||||
flowRate_(ptf.flowRate_),
|
||||
phiName_(ptf.phiName_),
|
||||
rhoName_(ptf.rhoName_)
|
||||
{}
|
||||
@ -117,7 +121,7 @@ massFlowRateInletVelocityFvPatchVectorField
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::massFlowRateInletVelocityFvPatchVectorField::updateCoeffs()
|
||||
void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs()
|
||||
{
|
||||
if (updated())
|
||||
{
|
||||
@ -125,7 +129,7 @@ void Foam::massFlowRateInletVelocityFvPatchVectorField::updateCoeffs()
|
||||
}
|
||||
|
||||
// a simpler way of doing this would be nice
|
||||
scalar avgU = -massFlowRate_/gSum(patch().magSf());
|
||||
scalar avgU = -flowRate_/gSum(patch().magSf());
|
||||
|
||||
vectorField n = patch().nf();
|
||||
|
||||
@ -151,23 +155,23 @@ void Foam::massFlowRateInletVelocityFvPatchVectorField::updateCoeffs()
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"massFlowRateInletVelocityFvPatchVectorField::updateCoeffs()"
|
||||
"flowRateInletVelocityFvPatchVectorField::updateCoeffs()"
|
||||
) << "dimensions of phi are incorrect"
|
||||
<< "\n on patch " << this->patch().name()
|
||||
<< " of field " << this->dimensionedInternalField().name()
|
||||
<< " in file " << this->dimensionedInternalField().objectPath()
|
||||
<< exit(FatalError);
|
||||
<< nl << exit(FatalError);
|
||||
}
|
||||
|
||||
fixedValueFvPatchField<vector>::updateCoeffs();
|
||||
}
|
||||
|
||||
|
||||
void Foam::massFlowRateInletVelocityFvPatchVectorField::write(Ostream& os) const
|
||||
void Foam::flowRateInletVelocityFvPatchVectorField::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<vector>::write(os);
|
||||
|
||||
os.writeKeyword("massFlowRate") << massFlowRate_
|
||||
os.writeKeyword("flowRate") << flowRate_
|
||||
<< token::END_STATEMENT << nl;
|
||||
|
||||
if (phiName_ != "phi")
|
||||
@ -191,7 +195,7 @@ namespace Foam
|
||||
makePatchTypeField
|
||||
(
|
||||
fvPatchVectorField,
|
||||
massFlowRateInletVelocityFvPatchVectorField
|
||||
flowRateInletVelocityFvPatchVectorField
|
||||
);
|
||||
}
|
||||
|
||||
@ -23,19 +23,22 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::massFlowRateInletVelocityFvPatchVectorField
|
||||
Foam::flowRateInletVelocityFvPatchVectorField
|
||||
|
||||
Description
|
||||
Describes an massflow normal vector boundary condition by its magnitude
|
||||
as an integral over its area.
|
||||
The current density is used to correct the velocity.
|
||||
Describes an volumetric/mass flow normal vector boundary condition by its
|
||||
magnitude as an integral over its area.
|
||||
The basis of the patch (volumetric or mass) is determined by the
|
||||
dimensions of the flux, phi.
|
||||
The current density is used to correct the velocity when applying the mass
|
||||
basis.
|
||||
|
||||
Example of the boundary condition specification:
|
||||
@verbatim
|
||||
inlet
|
||||
{
|
||||
type massFlowRateInletVelocity;
|
||||
massFlowRate 0.2; // Mass flow rate [kg/s]
|
||||
type flowRateInletVelocity;
|
||||
flowRate 0.2; // Volumetric/mass flow rate [m3/s or kg/s]
|
||||
value uniform (0 0 0); // placeholder
|
||||
}
|
||||
@endverbatim
|
||||
@ -46,12 +49,12 @@ Note
|
||||
- Strange behaviour with potentialFoam since the U equation is not solved
|
||||
|
||||
SourceFiles
|
||||
massFlowRateInletVelocityFvPatchVectorField.C
|
||||
flowRateInletVelocityFvPatchVectorField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef massFlowRateInletVelocityFvPatchVectorField_H
|
||||
#define massFlowRateInletVelocityFvPatchVectorField_H
|
||||
#ifndef flowRateInletVelocityFvPatchVectorField_H
|
||||
#define flowRateInletVelocityFvPatchVectorField_H
|
||||
|
||||
#include "fixedValueFvPatchFields.H"
|
||||
|
||||
@ -60,17 +63,17 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class massFlowRateInletVelocityFvPatch Declaration
|
||||
Class flowRateInletVelocityFvPatch Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class massFlowRateInletVelocityFvPatchVectorField
|
||||
class flowRateInletVelocityFvPatchVectorField
|
||||
:
|
||||
public fixedValueFvPatchVectorField
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Inlet integral mass flow rate
|
||||
scalar massFlowRate_;
|
||||
//- Inlet integral flow rate
|
||||
scalar flowRate_;
|
||||
|
||||
//- Name of the flux transporting the field
|
||||
word phiName_;
|
||||
@ -82,20 +85,20 @@ class massFlowRateInletVelocityFvPatchVectorField
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("massFlowRateInletVelocity");
|
||||
TypeName("flowRateInletVelocity");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
massFlowRateInletVelocityFvPatchVectorField
|
||||
flowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<vector, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
massFlowRateInletVelocityFvPatchVectorField
|
||||
flowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<vector, volMesh>&,
|
||||
@ -103,20 +106,20 @@ public:
|
||||
);
|
||||
|
||||
//- Construct by mapping given
|
||||
// massFlowRateInletVelocityFvPatchVectorField
|
||||
// flowRateInletVelocityFvPatchVectorField
|
||||
// onto a new patch
|
||||
massFlowRateInletVelocityFvPatchVectorField
|
||||
flowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const massFlowRateInletVelocityFvPatchVectorField&,
|
||||
const flowRateInletVelocityFvPatchVectorField&,
|
||||
const fvPatch&,
|
||||
const DimensionedField<vector, volMesh>&,
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
massFlowRateInletVelocityFvPatchVectorField
|
||||
flowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const massFlowRateInletVelocityFvPatchVectorField&
|
||||
const flowRateInletVelocityFvPatchVectorField&
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
@ -124,14 +127,14 @@ public:
|
||||
{
|
||||
return tmp<fvPatchVectorField>
|
||||
(
|
||||
new massFlowRateInletVelocityFvPatchVectorField(*this)
|
||||
new flowRateInletVelocityFvPatchVectorField(*this)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
massFlowRateInletVelocityFvPatchVectorField
|
||||
flowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const massFlowRateInletVelocityFvPatchVectorField&,
|
||||
const flowRateInletVelocityFvPatchVectorField&,
|
||||
const DimensionedField<vector, volMesh>&
|
||||
);
|
||||
|
||||
@ -143,7 +146,7 @@ public:
|
||||
{
|
||||
return tmp<fvPatchVectorField>
|
||||
(
|
||||
new massFlowRateInletVelocityFvPatchVectorField(*this, iF)
|
||||
new flowRateInletVelocityFvPatchVectorField(*this, iF)
|
||||
);
|
||||
}
|
||||
|
||||
@ -152,16 +155,16 @@ public:
|
||||
|
||||
// Access
|
||||
|
||||
//- Return the mass flux
|
||||
scalar massFlowRate() const
|
||||
//- Return the flux
|
||||
scalar flowRate() const
|
||||
{
|
||||
return massFlowRate_;
|
||||
return flowRate_;
|
||||
}
|
||||
|
||||
//- Return reference to the mass flux to allow adjustment
|
||||
scalar& massFlowRate()
|
||||
//- Return reference to the flux to allow adjustment
|
||||
scalar& flowRate()
|
||||
{
|
||||
return massFlowRate_;
|
||||
return flowRate_;
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,141 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2006-2008 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
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "timeVaryingFlowRateInletVelocityFvPatchVectorField.H"
|
||||
#include "volFields.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fvPatchFieldMapper.H"
|
||||
#include "surfaceFields.H"
|
||||
#include "Time.H"
|
||||
#include "IFstream.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::
|
||||
timeVaryingFlowRateInletVelocityFvPatchVectorField::
|
||||
timeVaryingFlowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<vector, volMesh>& iF
|
||||
)
|
||||
:
|
||||
flowRateInletVelocityFvPatchVectorField(p, iF),
|
||||
timeSeries_()
|
||||
{}
|
||||
|
||||
|
||||
Foam::
|
||||
timeVaryingFlowRateInletVelocityFvPatchVectorField::
|
||||
timeVaryingFlowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const timeVaryingFlowRateInletVelocityFvPatchVectorField& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<vector, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
flowRateInletVelocityFvPatchVectorField(ptf, p, iF, mapper),
|
||||
timeSeries_(ptf.timeSeries_)
|
||||
{}
|
||||
|
||||
|
||||
Foam::
|
||||
timeVaryingFlowRateInletVelocityFvPatchVectorField::
|
||||
timeVaryingFlowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<vector, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
flowRateInletVelocityFvPatchVectorField(p, iF, dict),
|
||||
timeSeries_(this->db(), dict)
|
||||
{}
|
||||
|
||||
|
||||
Foam::
|
||||
timeVaryingFlowRateInletVelocityFvPatchVectorField::
|
||||
timeVaryingFlowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const timeVaryingFlowRateInletVelocityFvPatchVectorField& ptf
|
||||
)
|
||||
:
|
||||
flowRateInletVelocityFvPatchVectorField(ptf),
|
||||
timeSeries_(ptf.timeSeries_)
|
||||
{}
|
||||
|
||||
|
||||
Foam::
|
||||
timeVaryingFlowRateInletVelocityFvPatchVectorField::
|
||||
timeVaryingFlowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const timeVaryingFlowRateInletVelocityFvPatchVectorField& ptf,
|
||||
const DimensionedField<vector, volMesh>& iF
|
||||
)
|
||||
:
|
||||
flowRateInletVelocityFvPatchVectorField(ptf, iF),
|
||||
timeSeries_(ptf.timeSeries_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::
|
||||
timeVaryingFlowRateInletVelocityFvPatchVectorField::
|
||||
updateCoeffs()
|
||||
{
|
||||
if (updated())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
flowRate() = timeSeries_(this->db().time().timeOutputValue());
|
||||
flowRateInletVelocityFvPatchVectorField::updateCoeffs();
|
||||
}
|
||||
|
||||
|
||||
void Foam::
|
||||
timeVaryingFlowRateInletVelocityFvPatchVectorField::
|
||||
write(Ostream& os) const
|
||||
{
|
||||
flowRateInletVelocityFvPatchVectorField::write(os);
|
||||
timeSeries_.write(os);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makePatchTypeField
|
||||
(
|
||||
fvPatchVectorField,
|
||||
timeVaryingFlowRateInletVelocityFvPatchVectorField
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -23,20 +23,20 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::timeVaryingMassFlowRateInletVelocityFvPatchVectorField
|
||||
Foam::timeVaryingFlowRateInletVelocityFvPatchVectorField
|
||||
|
||||
Description
|
||||
A time-varying form of a massflow normal vector boundary condition.
|
||||
A time-varying form of a flow normal vector boundary condition.
|
||||
|
||||
Example of the boundary condition specification:
|
||||
@verbatim
|
||||
inlet
|
||||
{
|
||||
type timeVaryingMassFlowRateInletVelocity;
|
||||
massFlowRate 0.2; // Massflow rate [kg/s]
|
||||
type timeVaryingFlowRateInletVelocity;
|
||||
flowRate 0.2; // Volumetric/mass flow rate [m3/s or kg/s]
|
||||
value uniform (0 0 0); // placeholder
|
||||
timeDataFile "time-series";
|
||||
timeBounding repeat; // (error|warn|clamp|repeat)
|
||||
fileName "time-series";
|
||||
boundAction repeat; // (error|warn|clamp|repeat)
|
||||
}
|
||||
@endverbatim
|
||||
|
||||
@ -46,58 +46,54 @@ Note
|
||||
- strange behaviour with potentialFoam since the U equation is not solved
|
||||
|
||||
See Also
|
||||
Foam::timeSeries and Foam::massFlowRateInletVelocityFvPatchVectorField
|
||||
Foam::timeSeries and Foam::flowRateInletVelocityFvPatchVectorField
|
||||
|
||||
SourceFiles
|
||||
timeVaryingMassFlowRateInletVelocityFvPatchVectorField.C
|
||||
timeVaryingFlowRateInletVelocityFvPatchVectorField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef timeVaryingMassFlowRateInletVelocityFvPatchVectorField_H
|
||||
#define timeVaryingMassFlowRateInletVelocityFvPatchVectorField_H
|
||||
#ifndef timeVaryingFlowRateInletVelocityFvPatchVectorField_H
|
||||
#define timeVaryingFlowRateInletVelocityFvPatchVectorField_H
|
||||
|
||||
#include "flowRateInletVelocityFvPatchVectorField.H"
|
||||
#include "interpolationTable.H"
|
||||
|
||||
#include "massFlowRateInletVelocityFvPatchVectorField.H"
|
||||
#include "timeSeries.H"
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class timeVaryingMassFlowRateInletVelocityFvPatch Declaration
|
||||
Class timeVaryingFlowRateInletVelocityFvPatch Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class timeVaryingMassFlowRateInletVelocityFvPatchVectorField
|
||||
class timeVaryingFlowRateInletVelocityFvPatchVectorField
|
||||
:
|
||||
public massFlowRateInletVelocityFvPatchVectorField
|
||||
public flowRateInletVelocityFvPatchVectorField
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- file containing time/massFlowRate
|
||||
fileName timeDataFile_;
|
||||
|
||||
//- the time series being used, including the bounding treatment
|
||||
timeSeries<scalar> timeSeries_;
|
||||
interpolationTable<scalar> timeSeries_;
|
||||
|
||||
//- interpolate the value at the current time
|
||||
scalar currentValue();
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("timeVaryingMassFlowRateInletVelocity");
|
||||
TypeName("timeVaryingFlowRateInletVelocity");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
timeVaryingMassFlowRateInletVelocityFvPatchVectorField
|
||||
timeVaryingFlowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<vector, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
timeVaryingMassFlowRateInletVelocityFvPatchVectorField
|
||||
timeVaryingFlowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<vector, volMesh>&,
|
||||
@ -105,18 +101,18 @@ public:
|
||||
);
|
||||
|
||||
//- Construct by mapping given patch field onto a new patch
|
||||
timeVaryingMassFlowRateInletVelocityFvPatchVectorField
|
||||
timeVaryingFlowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const timeVaryingMassFlowRateInletVelocityFvPatchVectorField&,
|
||||
const timeVaryingFlowRateInletVelocityFvPatchVectorField&,
|
||||
const fvPatch&,
|
||||
const DimensionedField<vector, volMesh>&,
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
timeVaryingMassFlowRateInletVelocityFvPatchVectorField
|
||||
timeVaryingFlowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const timeVaryingMassFlowRateInletVelocityFvPatchVectorField&
|
||||
const timeVaryingFlowRateInletVelocityFvPatchVectorField&
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
@ -124,14 +120,14 @@ public:
|
||||
{
|
||||
return tmp<fvPatchVectorField>
|
||||
(
|
||||
new timeVaryingMassFlowRateInletVelocityFvPatchVectorField(*this)
|
||||
new timeVaryingFlowRateInletVelocityFvPatchVectorField(*this)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
timeVaryingMassFlowRateInletVelocityFvPatchVectorField
|
||||
timeVaryingFlowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const timeVaryingMassFlowRateInletVelocityFvPatchVectorField&,
|
||||
const timeVaryingFlowRateInletVelocityFvPatchVectorField&,
|
||||
const DimensionedField<vector, volMesh>&
|
||||
);
|
||||
|
||||
@ -143,34 +139,34 @@ public:
|
||||
{
|
||||
return tmp<fvPatchVectorField>
|
||||
(
|
||||
new timeVaryingMassFlowRateInletVelocityFvPatchVectorField(*this, iF)
|
||||
new timeVaryingFlowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
*this,
|
||||
iF
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return the out-of-bounds treatment as a word
|
||||
word timeBounding() const
|
||||
{
|
||||
return timeSeries_.bounding();
|
||||
}
|
||||
|
||||
//- Return the time series used
|
||||
const timeSeries<scalar>& timeData() const
|
||||
const interpolationTable<scalar>& timeSeries() const
|
||||
{
|
||||
return timeSeries_;
|
||||
}
|
||||
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
//- Update the coefficients associated with the patch field
|
||||
virtual void updateCoeffs();
|
||||
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -1,200 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2006-2008 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
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "timeVaryingMassFlowRateInletVelocityFvPatchVectorField.H"
|
||||
#include "volFields.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fvPatchFieldMapper.H"
|
||||
#include "surfaceFields.H"
|
||||
#include "Time.H"
|
||||
#include "IFstream.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::
|
||||
timeVaryingMassFlowRateInletVelocityFvPatchVectorField::
|
||||
timeVaryingMassFlowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<vector, volMesh>& iF
|
||||
)
|
||||
:
|
||||
massFlowRateInletVelocityFvPatchVectorField(p, iF)
|
||||
{}
|
||||
|
||||
|
||||
Foam::
|
||||
timeVaryingMassFlowRateInletVelocityFvPatchVectorField::
|
||||
timeVaryingMassFlowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const timeVaryingMassFlowRateInletVelocityFvPatchVectorField& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<vector, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
massFlowRateInletVelocityFvPatchVectorField(ptf, p, iF, mapper),
|
||||
timeDataFile_(ptf.timeDataFile_),
|
||||
timeSeries_(ptf.timeBounding())
|
||||
{}
|
||||
|
||||
|
||||
Foam::
|
||||
timeVaryingMassFlowRateInletVelocityFvPatchVectorField::
|
||||
timeVaryingMassFlowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<vector, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
massFlowRateInletVelocityFvPatchVectorField(p, iF, dict),
|
||||
timeDataFile_(dict.lookup("timeDataFile")),
|
||||
timeSeries_(word(dict.lookup("timeBounding")))
|
||||
{}
|
||||
|
||||
|
||||
Foam::
|
||||
timeVaryingMassFlowRateInletVelocityFvPatchVectorField::
|
||||
timeVaryingMassFlowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const timeVaryingMassFlowRateInletVelocityFvPatchVectorField& ptf
|
||||
)
|
||||
:
|
||||
massFlowRateInletVelocityFvPatchVectorField(ptf),
|
||||
timeDataFile_(ptf.timeDataFile_),
|
||||
timeSeries_(ptf.timeBounding())
|
||||
{}
|
||||
|
||||
|
||||
Foam::
|
||||
timeVaryingMassFlowRateInletVelocityFvPatchVectorField::
|
||||
timeVaryingMassFlowRateInletVelocityFvPatchVectorField
|
||||
(
|
||||
const timeVaryingMassFlowRateInletVelocityFvPatchVectorField& ptf,
|
||||
const DimensionedField<vector, volMesh>& iF
|
||||
)
|
||||
:
|
||||
massFlowRateInletVelocityFvPatchVectorField(ptf, iF),
|
||||
timeDataFile_(ptf.timeDataFile_),
|
||||
timeSeries_(ptf.timeBounding())
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::scalar
|
||||
Foam::timeVaryingMassFlowRateInletVelocityFvPatchVectorField::
|
||||
currentValue()
|
||||
{
|
||||
if (timeSeries_.size() == 0)
|
||||
{
|
||||
fileName fName(timeDataFile_);
|
||||
fName.expand();
|
||||
|
||||
if (fName.size() == 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"timeVaryingMassFlowRateInletVelocity"
|
||||
"::currentValue()"
|
||||
) << "timeDataFile not specified for Patch "
|
||||
<< this->patch().name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
else
|
||||
{
|
||||
// relative path
|
||||
if (fName[0] != '/')
|
||||
{
|
||||
fName = this->db().path()/fName;
|
||||
}
|
||||
|
||||
// just in case we change the interface to timeSeries
|
||||
word boundType = timeBounding();
|
||||
|
||||
IFstream(fName)() >> timeSeries_;
|
||||
timeSeries_.bounding(boundType);
|
||||
|
||||
// be a bit paranoid and check that the list is okay
|
||||
timeSeries_.check();
|
||||
}
|
||||
|
||||
if (timeSeries_.size() == 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"timeVaryingMassFlowRateInletVelocity"
|
||||
"::currentValue()"
|
||||
) << "empty time series for Patch "
|
||||
<< this->patch().name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
return timeSeries_(this->db().time().timeOutputValue());
|
||||
}
|
||||
|
||||
|
||||
void Foam::
|
||||
timeVaryingMassFlowRateInletVelocityFvPatchVectorField::
|
||||
updateCoeffs()
|
||||
{
|
||||
if (updated())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
massFlowRate() = currentValue();
|
||||
massFlowRateInletVelocityFvPatchVectorField::updateCoeffs();
|
||||
}
|
||||
|
||||
|
||||
void Foam::
|
||||
timeVaryingMassFlowRateInletVelocityFvPatchVectorField::
|
||||
write(Ostream& os) const
|
||||
{
|
||||
massFlowRateInletVelocityFvPatchVectorField::write(os);
|
||||
os.writeKeyword("timeDataFile")
|
||||
<< timeDataFile_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("timeBounding")
|
||||
<< timeBounding() << token::END_STATEMENT << nl;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makePatchTypeField
|
||||
(
|
||||
fvPatchVectorField,
|
||||
timeVaryingMassFlowRateInletVelocityFvPatchVectorField
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -38,7 +38,8 @@ timeVaryingUniformFixedValueFvPatchField
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<Type>(p, iF)
|
||||
fixedValueFvPatchField<Type>(p, iF),
|
||||
timeSeries_()
|
||||
{}
|
||||
|
||||
|
||||
@ -52,8 +53,7 @@ timeVaryingUniformFixedValueFvPatchField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<Type>(p, iF),
|
||||
timeDataFile_(dict.lookup("timeDataFile")),
|
||||
timeSeries_(word(dict.lookup("timeBounding")))
|
||||
timeSeries_(this->db(), dict)
|
||||
{
|
||||
if (dict.found("value"))
|
||||
{
|
||||
@ -77,8 +77,7 @@ timeVaryingUniformFixedValueFvPatchField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
|
||||
timeDataFile_(ptf.timeDataFile_),
|
||||
timeSeries_(ptf.timeBounding())
|
||||
timeSeries_(ptf.timeSeries_)
|
||||
{}
|
||||
|
||||
|
||||
@ -90,8 +89,7 @@ timeVaryingUniformFixedValueFvPatchField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<Type>(ptf),
|
||||
timeDataFile_(ptf.timeDataFile_),
|
||||
timeSeries_(ptf.timeBounding())
|
||||
timeSeries_(ptf.timeSeries_)
|
||||
{}
|
||||
|
||||
|
||||
@ -104,66 +102,12 @@ timeVaryingUniformFixedValueFvPatchField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<Type>(ptf, iF),
|
||||
timeDataFile_(ptf.timeDataFile_),
|
||||
timeSeries_(ptf.timeBounding())
|
||||
timeSeries_(ptf.timeSeries_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Type Foam::timeVaryingUniformFixedValueFvPatchField<Type>::
|
||||
currentValue()
|
||||
{
|
||||
if (timeSeries_.size() == 0)
|
||||
{
|
||||
fileName fName(timeDataFile_);
|
||||
fName.expand();
|
||||
|
||||
if (fName.size() == 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"timeVaryingUniformFixedValueFvPatchField"
|
||||
"::currentValue()"
|
||||
) << "timeDataFile not specified for Patch "
|
||||
<< this->patch().name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
else
|
||||
{
|
||||
// relative path
|
||||
if (fName[0] != '/')
|
||||
{
|
||||
fName = this->db().path()/fName;
|
||||
}
|
||||
|
||||
// just in case we change the interface to timeSeries
|
||||
word boundType = timeBounding();
|
||||
|
||||
IFstream(fName)() >> timeSeries_;
|
||||
timeSeries_.bounding(boundType);
|
||||
|
||||
// be a bit paranoid and check that the list is okay
|
||||
timeSeries_.check();
|
||||
}
|
||||
|
||||
if (timeSeries_.size() == 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"timeVaryingUniformFixedValueFvPatchField"
|
||||
"::currentValue()"
|
||||
) << "empty time series for Patch "
|
||||
<< this->patch().name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
return timeSeries_(this->db().time().timeOutputValue());
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::timeVaryingUniformFixedValueFvPatchField<Type>::updateCoeffs()
|
||||
{
|
||||
@ -172,7 +116,10 @@ void Foam::timeVaryingUniformFixedValueFvPatchField<Type>::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
fvPatchField<Type>::operator==(currentValue());
|
||||
fvPatchField<Type>::operator==
|
||||
(
|
||||
timeSeries_(this->db().time().timeOutputValue())
|
||||
);
|
||||
fixedValueFvPatchField<Type>::updateCoeffs();
|
||||
}
|
||||
|
||||
@ -184,10 +131,7 @@ void Foam::timeVaryingUniformFixedValueFvPatchField<Type>::write
|
||||
) const
|
||||
{
|
||||
fvPatchField<Type>::write(os);
|
||||
os.writeKeyword("timeDataFile")
|
||||
<< timeDataFile_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("timeBounding")
|
||||
<< timeBounding() << token::END_STATEMENT << nl;
|
||||
timeSeries_.write(os);
|
||||
this->writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
@ -33,8 +33,8 @@ Description
|
||||
inlet
|
||||
{
|
||||
type timeVaryingUniformFixedValue;
|
||||
timeDataFile "time-series";
|
||||
timeBounding clamp; // (error|warn|clamp|repeat)
|
||||
fileName "time-series";
|
||||
boundAction clamp; // (error|warn|clamp|repeat)
|
||||
}
|
||||
@endverbatim
|
||||
|
||||
@ -54,7 +54,7 @@ SourceFiles
|
||||
#define timeVaryingUniformFixedValueFvPatchField_H
|
||||
|
||||
#include "fixedValueFvPatchField.H"
|
||||
#include "timeSeries.H"
|
||||
#include "interpolationTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -72,14 +72,8 @@ class timeVaryingUniformFixedValueFvPatchField
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- File containing time/uniformFixedValue
|
||||
fileName timeDataFile_;
|
||||
|
||||
//- The time series being used, including the bounding treatment
|
||||
timeSeries<Type> timeSeries_;
|
||||
|
||||
//- Interpolate the value at the current time
|
||||
Type currentValue();
|
||||
interpolationTable<Type> timeSeries_;
|
||||
|
||||
|
||||
public:
|
||||
@ -153,14 +147,8 @@ public:
|
||||
|
||||
// Access
|
||||
|
||||
//- Return the out-of-bounds treatment as a word
|
||||
word timeBounding() const
|
||||
{
|
||||
return timeSeries_.bounding();
|
||||
}
|
||||
|
||||
//- Return the time series used
|
||||
const timeSeries<Type>& timeData() const
|
||||
const interpolationTable<Type>& timeSeries() const
|
||||
{
|
||||
return timeSeries_;
|
||||
}
|
||||
|
||||
@ -46,8 +46,8 @@ timeVaryingUniformTotalPressureFvPatchScalarField
|
||||
rhoName_("undefined"),
|
||||
psiName_("undefined"),
|
||||
gamma_(0.0),
|
||||
p0_(0.0)
|
||||
|
||||
p0_(0.0),
|
||||
totalPressureTimeSeries_()
|
||||
{}
|
||||
|
||||
|
||||
@ -66,8 +66,7 @@ timeVaryingUniformTotalPressureFvPatchScalarField
|
||||
psiName_(dict.lookup("psi")),
|
||||
gamma_(readScalar(dict.lookup("gamma"))),
|
||||
p0_(readScalar(dict.lookup("p0"))),
|
||||
totalPressureDataFileName_(dict.lookup("totalPressureDataFileName")),
|
||||
totalPressureTimeSeries_(word(dict.lookup("timeBounding")))
|
||||
totalPressureTimeSeries_(this->db(), dict)
|
||||
{
|
||||
if (dict.found("value"))
|
||||
{
|
||||
@ -99,8 +98,7 @@ timeVaryingUniformTotalPressureFvPatchScalarField
|
||||
psiName_(ptf.psiName_),
|
||||
gamma_(ptf.gamma_),
|
||||
p0_(ptf.p0_),
|
||||
totalPressureDataFileName_(ptf.totalPressureDataFileName_),
|
||||
totalPressureTimeSeries_(ptf.timeBounding())
|
||||
totalPressureTimeSeries_(ptf.totalPressureTimeSeries_)
|
||||
{}
|
||||
|
||||
|
||||
@ -117,8 +115,7 @@ timeVaryingUniformTotalPressureFvPatchScalarField
|
||||
psiName_(tppsf.psiName_),
|
||||
gamma_(tppsf.gamma_),
|
||||
p0_(tppsf.p0_),
|
||||
totalPressureDataFileName_(tppsf.totalPressureDataFileName_),
|
||||
totalPressureTimeSeries_(tppsf.timeBounding())
|
||||
totalPressureTimeSeries_(tppsf.totalPressureTimeSeries_)
|
||||
{}
|
||||
|
||||
|
||||
@ -136,64 +133,12 @@ timeVaryingUniformTotalPressureFvPatchScalarField
|
||||
psiName_(tppsf.psiName_),
|
||||
gamma_(tppsf.gamma_),
|
||||
p0_(tppsf.p0_),
|
||||
totalPressureDataFileName_(tppsf.totalPressureDataFileName_),
|
||||
totalPressureTimeSeries_(tppsf.timeBounding())
|
||||
totalPressureTimeSeries_(tppsf.totalPressureTimeSeries_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::scalar Foam::timeVaryingUniformTotalPressureFvPatchScalarField::
|
||||
currentValue()
|
||||
{
|
||||
if (totalPressureTimeSeries_.size() == 0)
|
||||
{
|
||||
fileName fName(totalPressureDataFileName_);
|
||||
fName.expand();
|
||||
|
||||
if (fName.size() == 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"timeVaryingUniformFixedValueFvPatchField::currentValue()"
|
||||
) << "timeDataFile not specified for Patch "
|
||||
<< patch().name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
else
|
||||
{
|
||||
// relative path
|
||||
if (fName[0] != '/')
|
||||
{
|
||||
fName = db().path()/fName;
|
||||
}
|
||||
|
||||
// just in case we change the interface to timeSeries
|
||||
word boundType = timeBounding();
|
||||
|
||||
IFstream(fName)() >> totalPressureTimeSeries_;
|
||||
totalPressureTimeSeries_.bounding(boundType);
|
||||
|
||||
// be a bit paranoid and check that the list is okay
|
||||
totalPressureTimeSeries_.check();
|
||||
}
|
||||
|
||||
if (totalPressureTimeSeries_.size() == 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"timeVaryingUniformFixedValueFvPatchField"
|
||||
"::currentValue()"
|
||||
) << "empty time series for Patch "
|
||||
<< this->patch().name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
return totalPressureTimeSeries_(this->db().time().timeOutputValue());
|
||||
}
|
||||
|
||||
|
||||
void Foam::timeVaryingUniformTotalPressureFvPatchScalarField::updateCoeffs
|
||||
(
|
||||
const vectorField& Up
|
||||
@ -204,7 +149,7 @@ void Foam::timeVaryingUniformTotalPressureFvPatchScalarField::updateCoeffs
|
||||
return;
|
||||
}
|
||||
|
||||
p0_ = currentValue();
|
||||
p0_ = totalPressureTimeSeries_(this->db().time().timeOutputValue());
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
|
||||
@ -279,10 +224,7 @@ void Foam::timeVaryingUniformTotalPressureFvPatchScalarField::write(Ostream& os)
|
||||
os.writeKeyword("psi") << psiName_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("p0") << p0_ << token::END_STATEMENT << endl;
|
||||
os.writeKeyword("totalPressureDataFileName")
|
||||
<< totalPressureDataFileName_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("timeBounding")
|
||||
<< timeBounding() << token::END_STATEMENT << nl;
|
||||
totalPressureTimeSeries_.write(os);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ SourceFiles
|
||||
#define timeVaryingUniformTotalPressureFvPatchScalarField_H
|
||||
|
||||
#include "fixedValueFvPatchFields.H"
|
||||
#include "timeSeries.H"
|
||||
#include "interpolationTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -74,11 +74,8 @@ class timeVaryingUniformTotalPressureFvPatchScalarField
|
||||
//- Total pressure
|
||||
scalar p0_;
|
||||
|
||||
fileName totalPressureDataFileName_;
|
||||
timeSeries<scalar> totalPressureTimeSeries_;
|
||||
|
||||
//- Interpolate the value at the current time
|
||||
scalar currentValue();
|
||||
//- Table of time vs total pressure
|
||||
interpolationTable<scalar> totalPressureTimeSeries_;
|
||||
|
||||
|
||||
public:
|
||||
@ -189,14 +186,8 @@ public:
|
||||
return p0_;
|
||||
}
|
||||
|
||||
//- Return the out-of-bounds treatment as a word
|
||||
word timeBounding() const
|
||||
{
|
||||
return totalPressureTimeSeries_.bounding();
|
||||
}
|
||||
|
||||
//- Return the time series used
|
||||
const timeSeries<scalar>& totalPressureTimeSeries() const
|
||||
const interpolationTable<scalar>& totalPressureTimeSeries() const
|
||||
{
|
||||
return totalPressureTimeSeries_;
|
||||
}
|
||||
|
||||
@ -134,7 +134,7 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const
|
||||
const unallocLabelList& faceCells = p.patch().faceCells();
|
||||
|
||||
// Build the d-vectors
|
||||
vectorField pd =
|
||||
vectorField pd =
|
||||
mesh.Sf().boundaryField()[patchi]
|
||||
/(
|
||||
mesh.magSf().boundaryField()[patchi]
|
||||
@ -198,7 +198,7 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const
|
||||
const unallocLabelList& faceCells = p.faceCells();
|
||||
|
||||
// Build the d-vectors
|
||||
vectorField pd =
|
||||
vectorField pd =
|
||||
mesh.Sf().boundaryField()[patchi]
|
||||
/(
|
||||
mesh.magSf().boundaryField()[patchi]
|
||||
@ -239,6 +239,7 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const
|
||||
|
||||
// For 3D meshes check the determinant of the dd tensor and switch to
|
||||
// Gauss if it is less than 3
|
||||
/* Currently the det(dd[celli]) criterion is incorrect: dd is weighted by Sf
|
||||
if (mesh.nGeometricD() == 3)
|
||||
{
|
||||
label nBadCells = 0;
|
||||
@ -279,7 +280,7 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const
|
||||
|
||||
if (mesh.boundary()[patchi].size())
|
||||
{
|
||||
label patchFacei =
|
||||
label patchFacei =
|
||||
facei - mesh.boundaryMesh()[patchi].start();
|
||||
|
||||
if (mesh.boundary()[patchi].coupled())
|
||||
@ -294,14 +295,14 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const
|
||||
0.2
|
||||
);
|
||||
|
||||
lsP.boundaryField()[patchi][patchFacei] =
|
||||
lsP.boundaryField()[patchi][patchFacei] =
|
||||
(1 - wf)
|
||||
*Sf.boundaryField()[patchi][patchFacei]
|
||||
/V[celli];
|
||||
}
|
||||
else
|
||||
{
|
||||
lsP.boundaryField()[patchi][patchFacei] =
|
||||
lsP.boundaryField()[patchi][patchFacei] =
|
||||
Sf.boundaryField()[patchi][patchFacei]
|
||||
/V[celli];
|
||||
}
|
||||
@ -318,7 +319,7 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
if (debug)
|
||||
{
|
||||
|
||||
@ -27,6 +27,7 @@ Class
|
||||
|
||||
Description
|
||||
Templated base class for kinematic cloud
|
||||
|
||||
- Kinematic only
|
||||
- Dispersion model
|
||||
- Drag model
|
||||
|
||||
@ -27,7 +27,9 @@ Class
|
||||
|
||||
Description
|
||||
Kinematic parcel class with one/two-way coupling with the continuous
|
||||
phase. Sub-models include:
|
||||
phase.
|
||||
|
||||
Sub-models include:
|
||||
- drag
|
||||
- break-up
|
||||
- wall interactions
|
||||
|
||||
@ -27,6 +27,7 @@ Class
|
||||
|
||||
Description
|
||||
Cone injection
|
||||
|
||||
- User specifies
|
||||
- time of start of injection
|
||||
- injector position
|
||||
|
||||
@ -54,7 +54,7 @@ bool molecule::move(molecule::trackData& td)
|
||||
U_ += 0.5*deltaT*A_;
|
||||
}
|
||||
|
||||
while (td.keepParticle && !td.switchProcessor && tEnd > (SMALL*SMALL))
|
||||
while (td.keepParticle && !td.switchProcessor && tEnd > ROOTVSMALL)
|
||||
{
|
||||
// set the lagrangian time-step
|
||||
scalar dt = min(dtMax, tEnd);
|
||||
|
||||
@ -26,15 +26,15 @@ Class
|
||||
Foam::edgeFaceCirculator
|
||||
|
||||
Description
|
||||
Walks from starting face around edge. Implicit
|
||||
description of edge:
|
||||
Walks from starting face around edge.
|
||||
|
||||
Implicit description of edge:
|
||||
- face
|
||||
- index in face. edge is always between f[index] and f[index+1]
|
||||
- direction (cell to walk into)
|
||||
|
||||
Use as:
|
||||
|
||||
1) in-place:
|
||||
-# Use in-place: \n
|
||||
@code
|
||||
edgeFaceCirculator circ(..);
|
||||
// Optionally rotate to beginning: circ.setCanonical();
|
||||
|
||||
@ -45,9 +45,10 @@ Description
|
||||
++circ;
|
||||
}
|
||||
while (circ != circ.end());
|
||||
@endcode
|
||||
|
||||
2) like STL iterator:
|
||||
|
||||
-# Use like STL iterator: \n
|
||||
@code
|
||||
edgeFaceCirculator circ(..);
|
||||
for
|
||||
(
|
||||
@ -58,6 +59,7 @@ Description
|
||||
{
|
||||
Info<< "face:" << iter.face() << endl;
|
||||
}
|
||||
@endcode
|
||||
|
||||
|
||||
SourceFiles
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Namespace
|
||||
Foam::compressible
|
||||
Foam::compressible::LESModels
|
||||
|
||||
Description
|
||||
Namespace for compressible LES models.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::LES::DeardorffDiffStress
|
||||
Foam::incompressible::LESModels::DeardorffDiffStress
|
||||
|
||||
Description
|
||||
Differential SGS Stress Equation Model for incompressible flows
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::LES::GenEddyVisc
|
||||
Foam::incompressible::LESModels::GenEddyVisc
|
||||
|
||||
Description
|
||||
General base class for all incompressible models that can be implemented
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::LES::GenSGSStress
|
||||
Foam::incompressible::LESModels::GenSGSStress
|
||||
|
||||
Description
|
||||
General base class for all incompressible models that directly
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Namespace
|
||||
Foam::incompressible
|
||||
Foam::incompressible::LESModels
|
||||
|
||||
Description
|
||||
Namespace for incompressible LES models.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::LES::LRRDiffStress
|
||||
Foam::incompressible::LESModels::LRRDiffStress
|
||||
|
||||
Description
|
||||
Differential SGS Stress Equation Model for incompressible flows.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::LES::Smagorinsky
|
||||
Foam::incompressible::LESModels::Smagorinsky
|
||||
|
||||
Description
|
||||
The Isochoric Smagorinsky Model for incompressible flows.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::LES::Smagorinsky2
|
||||
Foam::incompressible::LESModels::Smagorinsky2
|
||||
|
||||
Description
|
||||
The Isochoric Smagorinsky Model for incompressible flows
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::LES::SpalartAllmaras
|
||||
Foam::incompressible::LESModels::SpalartAllmaras
|
||||
|
||||
Description
|
||||
SpalartAllmaras for incompressible flows
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::LES::dynMixedSmagorinsky
|
||||
Foam::incompressible::LESModels::dynMixedSmagorinsky
|
||||
|
||||
Description
|
||||
The Mixed Isochoric Smagorinsky Model for incompressible flows.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::LES::dynOneEqEddy
|
||||
Foam::incompressible::LESModels::dynOneEqEddy
|
||||
|
||||
Description
|
||||
One Equation Eddy Viscosity Model for incompressible flows.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::LES::dynSmagorinsky
|
||||
Foam::incompressible::LESModels::dynSmagorinsky
|
||||
|
||||
Description
|
||||
The Isochoric dynamic Smagorinsky Model for incompressible flows.
|
||||
@ -56,7 +56,7 @@ Description
|
||||
m = delta^2*(4*||F(D)||^2 - F(||D||^2))
|
||||
L = dev(F(U*U) - F(U)*F(U))
|
||||
M = delta^2*(F(||D||*dev(D)) - 4*||F(D)||*F(dev(D)))
|
||||
@verbatim
|
||||
@endverbatim
|
||||
|
||||
SourceFiles
|
||||
dynSmagorinsky.C
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::LES::laminar
|
||||
Foam::incompressible::LESModels::laminar
|
||||
|
||||
Description
|
||||
LES model for laminar incompressible flow.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::LES::locDynOneEqEddy
|
||||
Foam::incompressible::LESModels::locDynOneEqEddy
|
||||
|
||||
Description
|
||||
Localised Dynamic One Equation Eddy Viscosity Model for incompressible
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::LES::mixedSmagorinsky
|
||||
Foam::incompressible::LESModels::mixedSmagorinsky
|
||||
|
||||
Description
|
||||
The mixed Isochoric Smagorinsky Model for incompressible flows.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::LES::oneEqEddy
|
||||
Foam::incompressible::LESModels::oneEqEddy
|
||||
|
||||
Description
|
||||
One Equation Eddy Viscosity Model for incompressible flows
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::LES::scaleSimilarity
|
||||
Foam::incompressible::LESModels::scaleSimilarity
|
||||
|
||||
Description
|
||||
General base class for all scale similarity models
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::LES::spectEddyVisc
|
||||
Foam::incompressible::LESModels::spectEddyVisc
|
||||
|
||||
Description
|
||||
The Isochoric spectral Eddy Viscosity Model for incompressible flows.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::LES::vanDriestDelta
|
||||
Foam::incompressible::LESModels::vanDriestDelta
|
||||
|
||||
Description
|
||||
Simple cube-root of cell volume delta used in incompressible LES models.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::LES::nuSgsWallFunctionFvPatchScalarField
|
||||
Foam::incompressible::LESModels::nuSgsWallFunctionFvPatchScalarField
|
||||
|
||||
Description
|
||||
wall function boundary condition for incompressible flows
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::compressible::RAS::LRR
|
||||
Foam::compressible::RASModels::LRR
|
||||
|
||||
Description
|
||||
Launder, Reece and Rodi Reynolds-stress turbulence model for
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::compressible::RAS::LaunderGibsonRSTM
|
||||
Foam::compressible::RASModels::LaunderGibsonRSTM
|
||||
|
||||
Description
|
||||
Launder-Gibson Reynolds stress turbulence model for compressible flows.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::compressible::RAS::LaunderSharmaKE
|
||||
Foam::compressible::RASModels::LaunderSharmaKE
|
||||
|
||||
Description
|
||||
Launder and Sharma low-Reynolds k-epsilon turbulence model for
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Namespace
|
||||
Foam::compressible::RAS
|
||||
Foam::compressible::RASModels
|
||||
|
||||
Description
|
||||
Namespace for compressible RAS turbulence models.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::compressible::RAS::RNGkEpsilon
|
||||
Foam::compressible::RASModels::RNGkEpsilon
|
||||
|
||||
Description
|
||||
Renormalisation group k-epsilon turbulence model for compressible flows.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::compressible::RAS::SpalartAllmaras
|
||||
Foam::compressible::RASModels::SpalartAllmaras
|
||||
|
||||
Description
|
||||
Spalart-Allmaras one-eqn mixing-length model for compressible
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::compressible::RAS::kEpsilon
|
||||
Foam::compressible::RASModels::kEpsilon
|
||||
|
||||
Description
|
||||
Standard k-epsilon turbulence model for compressible flows
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::compressible::RAS::kOmegaSST
|
||||
Foam::compressible::RASModels::kOmegaSST
|
||||
|
||||
Description
|
||||
Implementation of the k-omega-SST turbulence model for compressible flows.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::compressible::RAS::laminar
|
||||
Foam::compressible::RASModels::laminar
|
||||
|
||||
Description
|
||||
Dummy turbulence model for laminar compressible flow.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::compressible::RAS::realizableKE
|
||||
Foam::compressible::RASModels::realizableKE
|
||||
|
||||
Description
|
||||
Realizable k-epsilon turbulence model for compressible flows.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::compressible::RAS::mutStandardRoughWallFunctionFvPatchScalarField
|
||||
Foam::compressible::RASModels::mutStandardRoughWallFunctionFvPatchScalarField
|
||||
|
||||
Description
|
||||
Wall function boundary condition for rough walls
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::RAS::LRR
|
||||
Foam::incompressible::RASModels::LRR
|
||||
|
||||
Description
|
||||
Launder, Reece and Rodi Reynolds-stress turbulence model for
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::RAS::LamBremhorstKE
|
||||
Foam::incompressible::RASModels::LamBremhorstKE
|
||||
|
||||
Description
|
||||
Lam and Bremhorst low-Reynolds number k-epsilon turbulence model
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::RAS::LaunderGibsonRSTM
|
||||
Foam::incompressible::RASModels::LaunderGibsonRSTM
|
||||
|
||||
Description
|
||||
Launder-Gibson Reynolds stress turbulence model for incompressible flows.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::RAS::LaunderSharmaKE
|
||||
Foam::incompressible::RASModels::LaunderSharmaKE
|
||||
|
||||
Description
|
||||
Launder and Sharma low-Reynolds k-epsilon turbulence model for
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::RAS::LienCubicKE
|
||||
Foam::incompressible::RASModels::LienCubicKE
|
||||
|
||||
Description
|
||||
Lien cubic non-linear k-epsilon turbulence model for incompressible flows.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::RAS::LienCubicKELowRe
|
||||
Foam::incompressible::RASModels::LienCubicKELowRe
|
||||
|
||||
Description
|
||||
Lien cubic non-linear low-Reynolds k-epsilon turbulence models for
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::RAS::LienLeschzinerLowRe
|
||||
Foam::incompressible::RASModels::LienLeschzinerLowRe
|
||||
|
||||
Description
|
||||
Lien and Leschziner low-Reynolds k-epsilon turbulence model for
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::RAS::NonlinearKEShih
|
||||
Foam::incompressible::RASModels::NonlinearKEShih
|
||||
|
||||
Description
|
||||
Shih's quadratic non-linear k-epsilon turbulence model for
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::RAS::QZeta
|
||||
Foam::incompressible::RASModels::QZeta
|
||||
|
||||
Description
|
||||
Gibson and Dafa'Alla's q-zeta two-equation low-Re turbulence model
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Namespace
|
||||
Foam::incompressible
|
||||
Foam::incompressible::RASModels
|
||||
|
||||
Description
|
||||
Namespace for incompressible RAS turbulence models.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::RAS::RNGkEpsilon
|
||||
Foam::incompressible::RASModels::RNGkEpsilon
|
||||
|
||||
Description
|
||||
Renormalisation group k-epsilon turbulence model for incompressible flows.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::RAS::SpalartAllmaras
|
||||
Foam::incompressible::RASModels::SpalartAllmaras
|
||||
|
||||
Description
|
||||
Spalart-Allmaras 1-eqn mixing-length model for incompressible external
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::RAS::kEpsilon
|
||||
Foam::incompressible::RASModels::kEpsilon
|
||||
|
||||
Description
|
||||
Standard k-epsilon turbulence model for incompressible flows.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::RAS::kOmegaSST
|
||||
Foam::incompressible::RASModels::kOmegaSST
|
||||
|
||||
Description
|
||||
Implementation of the k-omega-SST turbulence model for incompressible
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::RAS::laminar
|
||||
Foam::incompressible::RASModels::laminar
|
||||
|
||||
Description
|
||||
Dummy turbulence model for laminar incompressible flow.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::RAS::realizableKE
|
||||
Foam::incompressible::RASModels::realizableKE
|
||||
|
||||
Description
|
||||
Realizable k-epsilon turbulence model for incompressible flows.
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::incompressible::RAS::nutStandardRoughWallFunctionFvPatchScalarField
|
||||
Foam::incompressible::RASModels::nutStandardRoughWallFunctionFvPatchScalarField
|
||||
|
||||
Description
|
||||
Wall function boundary condition for rough walls
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user