mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge remote-tracking branch 'upstream/develop' into wp3-directional-refinement
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +1,6 @@
|
||||
[submodule "cfmesh"]
|
||||
path = modules/cfmesh
|
||||
url = https://develop.openfoam.com/Community/integration-cfmesh.git
|
||||
[submodule "avalanche"]
|
||||
path = modules/avalanche
|
||||
url = https://develop.openfoam.com/Community/avalanche.git
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
OpenFOAM-1706
|
||||
OpenFOAM-1712
|
||||
==================
|
||||
Known Build Issues
|
||||
==================
|
||||
@ -75,6 +75,33 @@ If your system compiler is too old to build the minimum required gcc or
|
||||
clang/llvm, it is just simply too old.
|
||||
|
||||
|
||||
---------------------------------
|
||||
ThirdParty clang without gmp/mpfr
|
||||
---------------------------------
|
||||
|
||||
If using ThirdParty clang without gmp/mpfr, the ThirdParty makeCGAL
|
||||
script will need to be run manually and specify that there is no
|
||||
gmp/mpfr. Eg,
|
||||
|
||||
cd $WM_THIRD_PARTY_DIR
|
||||
./makeCGAL gmp-none mpfr-none
|
||||
|
||||
Subequent compilation with Allwmake will now run largely without any
|
||||
problems, except that the components linking against CGAL
|
||||
(foamyMesh and surfaceBooleanFeatures) will also try to link against
|
||||
a nonexistent mpfr library. As a workaround, the link-dependency can
|
||||
be removed in wmake/rules/General/CGAL :
|
||||
|
||||
CGAL_LIBS = \
|
||||
-L$(BOOST_ARCH_PATH)/lib \
|
||||
-L$(BOOST_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
|
||||
-L$(CGAL_ARCH_PATH)/lib \
|
||||
-L$(CGAL_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
|
||||
-lCGAL
|
||||
|
||||
This is a temporary inconvenience until a more robust solution is found.
|
||||
|
||||
|
||||
-------------------------
|
||||
Building with spack
|
||||
-------------------------
|
||||
|
||||
@ -61,18 +61,6 @@ dimensionedScalar rhoMin
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<compressible::turbulenceModel> turbulence
|
||||
(
|
||||
compressible::turbulenceModel::New
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
phi,
|
||||
thermo
|
||||
)
|
||||
);
|
||||
|
||||
mesh.setFluxRequired(p.name());
|
||||
|
||||
Info<< "Creating field dpdt\n" << endl;
|
||||
@ -115,3 +103,15 @@ volScalarField K("K", 0.5*magSqr(U));
|
||||
|
||||
// Mask field for zeroing out contributions on hole cells
|
||||
#include "createCellMask.H"
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<compressible::turbulenceModel> turbulence
|
||||
(
|
||||
compressible::turbulenceModel::New
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
phi,
|
||||
thermo
|
||||
)
|
||||
);
|
||||
|
||||
@ -8,7 +8,7 @@ surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask));
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
surfaceScalarField rhorAUf("rhorAUf", faceMask*fvc::interpolate(rho*rAU));
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = constrainHbyA(rAU*UEqn.H(), U, p);
|
||||
HbyA = constrainHbyA(cellMask*rAU*UEqn.H(), U, p);
|
||||
|
||||
if (pimple.nCorrPISO() <= 1)
|
||||
{
|
||||
|
||||
@ -20,7 +20,7 @@ surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask));
|
||||
surfaceScalarField rAUf("rAUf", faceMask*fvc::interpolate(rAU));
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = constrainHbyA(rAU*UEqn.H(), U, p);
|
||||
HbyA = constrainHbyA(cellMask*rAU*UEqn.H(), U, p);
|
||||
|
||||
//mesh.interpolate(HbyA);
|
||||
if (massFluxInterpolation)
|
||||
|
||||
@ -0,0 +1,43 @@
|
||||
volScalarField::Internal Sp
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Sp",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("Sp", dgdt.dimensions(), 0)
|
||||
);
|
||||
|
||||
volScalarField::Internal Su
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Su",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("Su", dgdt.dimensions(), 0)
|
||||
);
|
||||
|
||||
forAll(dgdt, celli)
|
||||
{
|
||||
if (dgdt[celli] > 0.0 && alpha1[celli] > 0.0)
|
||||
{
|
||||
Sp[celli] -= dgdt[celli]*alpha1[celli];
|
||||
Su[celli] += dgdt[celli]*alpha1[celli];
|
||||
}
|
||||
else if (dgdt[celli] < 0.0 && alpha1[celli] < 1.0)
|
||||
{
|
||||
Sp[celli] += dgdt[celli]*(1.0 - alpha1[celli]);
|
||||
}
|
||||
}
|
||||
|
||||
volScalarField::Internal divU
|
||||
(
|
||||
mesh.moving()
|
||||
? fvc::div(phiCN() + mesh.phi())
|
||||
: fvc::div(phiCN())
|
||||
);
|
||||
@ -56,29 +56,13 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
#include "rhofs.H"
|
||||
|
||||
p_rghEqnComp1 =
|
||||
pos(alpha1)
|
||||
*(
|
||||
(
|
||||
fvc::ddt(alpha1, rho1) + fvc::div(alphaPhi1*rho1f)
|
||||
- (fvOptions(alpha1, mixture.thermo1().rho())&rho1)
|
||||
)/rho1
|
||||
- fvc::ddt(alpha1) - fvc::div(alphaPhi1)
|
||||
+ (alpha1*psi1/rho1)*correction(fvm::ddt(p_rgh))
|
||||
);
|
||||
fvc::ddt(rho1) + psi1*correction(fvm::ddt(p_rgh))
|
||||
+ fvc::div(phi, rho1) - fvc::Sp(fvc::div(phi), rho1);
|
||||
|
||||
p_rghEqnComp2 =
|
||||
pos(alpha2)
|
||||
*(
|
||||
(
|
||||
fvc::ddt(alpha2, rho2) + fvc::div(alphaPhi2*rho2f)
|
||||
- (fvOptions(alpha2, mixture.thermo2().rho())&rho2)
|
||||
)/rho2
|
||||
- fvc::ddt(alpha2) - fvc::div(alphaPhi2)
|
||||
+ (alpha2*psi2/rho2)*correction(fvm::ddt(p_rgh))
|
||||
);
|
||||
fvc::ddt(rho2) + psi2*correction(fvm::ddt(p_rgh))
|
||||
+ fvc::div(phi, rho2) - fvc::Sp(fvc::div(phi), rho2);
|
||||
}
|
||||
|
||||
// Cache p_rgh prior to solve for density update
|
||||
@ -94,7 +78,11 @@
|
||||
|
||||
solve
|
||||
(
|
||||
p_rghEqnComp1() + p_rghEqnComp2() + p_rghEqnIncomp,
|
||||
(
|
||||
(max(alpha1, scalar(0))/rho1)*p_rghEqnComp1()
|
||||
+ (max(alpha2, scalar(0))/rho2)*p_rghEqnComp2()
|
||||
)
|
||||
+ p_rghEqnIncomp,
|
||||
mesh.solver(p_rgh.select(pimple.finalInnerIter()))
|
||||
);
|
||||
|
||||
@ -105,8 +93,8 @@
|
||||
|
||||
dgdt =
|
||||
(
|
||||
alpha1*(p_rghEqnComp2 & p_rgh)
|
||||
- alpha2*(p_rghEqnComp1 & p_rgh)
|
||||
pos(alpha2)*(p_rghEqnComp2 & p_rgh)/rho2
|
||||
- pos(alpha1)*(p_rghEqnComp1 & p_rgh)/rho1
|
||||
);
|
||||
|
||||
phi = phiHbyA + p_rghEqnIncomp.flux();
|
||||
@ -131,8 +119,11 @@
|
||||
rho = alpha1*rho1 + alpha2*rho2;
|
||||
|
||||
// Correct p_rgh for consistency with p and the updated densities
|
||||
p = max(p_rgh + rho*gh, pMin);
|
||||
p_rgh = p - rho*gh;
|
||||
p_rgh.correctBoundaryConditions();
|
||||
|
||||
|
||||
|
||||
K = 0.5*magSqr(U);
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EXE_INC = ${COMP_OPENMP}
|
||||
EXE_INC = ${COMP_OPENMP} /* -UUSE_OMP */
|
||||
|
||||
/* Mostly do not need to explicitly link openmp libraries */
|
||||
/* EXE_LIBS = ${LINK_OPENMP} */
|
||||
|
||||
@ -30,7 +30,7 @@ Description
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
#ifdef USE_OMP
|
||||
#if _OPENMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
@ -39,10 +39,18 @@ Description
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int nThreads, threadId;
|
||||
#if USE_OMP
|
||||
std::cout << "USE_OMP defined (" << USE_OMP << ")\n";
|
||||
#else
|
||||
std::cout << "USE_OMP undefined\n";
|
||||
#endif
|
||||
|
||||
#if _OPENMP
|
||||
std::cout << "_OPENMP = " << _OPENMP << "\n\n";
|
||||
|
||||
// Fork threads with their own copies of variables
|
||||
#ifdef USE_OMP
|
||||
int nThreads, threadId;
|
||||
|
||||
#pragma omp parallel private(nThreads, threadId)
|
||||
{
|
||||
threadId = omp_get_thread_num();
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -1094,7 +1094,9 @@ int main(int argc, char *argv[])
|
||||
// Update proc maps
|
||||
if (cellProcAddressing.headerOk())
|
||||
{
|
||||
if (cellProcAddressing.size() == mesh.nCells())
|
||||
bool localOk = (cellProcAddressing.size() == mesh.nCells());
|
||||
|
||||
if (returnReduce(localOk, andOp<bool>()))
|
||||
{
|
||||
Info<< "Renumbering processor cell decomposition map "
|
||||
<< cellProcAddressing.name() << endl;
|
||||
@ -1118,7 +1120,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (faceProcAddressing.headerOk())
|
||||
{
|
||||
if (faceProcAddressing.size() == mesh.nFaces())
|
||||
bool localOk = (faceProcAddressing.size() == mesh.nFaces());
|
||||
|
||||
if (returnReduce(localOk, andOp<bool>()))
|
||||
{
|
||||
Info<< "Renumbering processor face decomposition map "
|
||||
<< faceProcAddressing.name() << endl;
|
||||
@ -1158,7 +1162,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (pointProcAddressing.headerOk())
|
||||
{
|
||||
if (pointProcAddressing.size() == mesh.nPoints())
|
||||
bool localOk = (pointProcAddressing.size() == mesh.nPoints());
|
||||
|
||||
if (returnReduce(localOk, andOp<bool>()))
|
||||
{
|
||||
Info<< "Renumbering processor point decomposition map "
|
||||
<< pointProcAddressing.name() << endl;
|
||||
@ -1182,7 +1188,16 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (boundaryProcAddressing.headerOk())
|
||||
{
|
||||
if (boundaryProcAddressing.size() != mesh.boundaryMesh().size())
|
||||
bool localOk =
|
||||
(
|
||||
boundaryProcAddressing.size()
|
||||
== mesh.boundaryMesh().size()
|
||||
);
|
||||
if (returnReduce(localOk, andOp<bool>()))
|
||||
{
|
||||
// No renumbering needed
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Not writing inconsistent processor patch decomposition"
|
||||
<< " map " << boundaryProcAddressing.filePath() << endl;
|
||||
|
||||
@ -125,12 +125,6 @@ Foam::domainDecomposition::domainDecomposition
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::domainDecomposition::~domainDecomposition()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
|
||||
@ -160,7 +160,7 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from IOobjects (for mesh and optional non-standard
|
||||
// decomposeParDict location)
|
||||
//- decomposeParDict location)
|
||||
domainDecomposition
|
||||
(
|
||||
const IOobject& io,
|
||||
@ -169,7 +169,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
~domainDecomposition();
|
||||
~domainDecomposition() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -204,7 +204,6 @@ public:
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
|
||||
@ -34,11 +34,11 @@ License
|
||||
#include "OSspecific.H"
|
||||
#include "Map.H"
|
||||
#include "globalMeshData.H"
|
||||
|
||||
#include "decompositionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void faMeshDecomposition::distributeFaces()
|
||||
void Foam::faMeshDecomposition::distributeFaces()
|
||||
{
|
||||
Info<< "\nCalculating distribution of faces" << endl;
|
||||
|
||||
@ -71,7 +71,7 @@ void faMeshDecomposition::distributeFaces()
|
||||
// located at the end of the faceProcAddressing, cutting it at
|
||||
// i = owner.size() will correctly decompose faMesh faces.
|
||||
// Vanja Skuric, 2016-04-21
|
||||
if (decompositionDict_.found("globalFaceZones"))
|
||||
if (hasGlobalFaceZones_)
|
||||
{
|
||||
labelList faceProcAddressing
|
||||
(
|
||||
@ -153,25 +153,30 @@ void faMeshDecomposition::distributeFaces()
|
||||
<< " s" << endl;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
// from components
|
||||
faMeshDecomposition::faMeshDecomposition(const fvMesh& mesh)
|
||||
Foam::faMeshDecomposition::faMeshDecomposition
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const fileName& decompDictFile
|
||||
)
|
||||
:
|
||||
faMesh(mesh),
|
||||
decompositionDict_
|
||||
decompDictFile_(decompDictFile),
|
||||
nProcs_
|
||||
(
|
||||
IOobject
|
||||
decompositionMethod::nDomains
|
||||
(
|
||||
decompositionModel::New
|
||||
(
|
||||
"decomposeParDict",
|
||||
time().system(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
decompDictFile
|
||||
)
|
||||
)
|
||||
),
|
||||
nProcs_(readInt(decompositionDict_.lookup("numberOfSubdomains"))),
|
||||
distributed_(false),
|
||||
hasGlobalFaceZones_(false),
|
||||
faceToProc_(nFaces()),
|
||||
procFaceLabels_(nProcs_),
|
||||
procMeshEdgesMap_(nProcs_),
|
||||
@ -190,22 +195,20 @@ faMeshDecomposition::faMeshDecomposition(const fvMesh& mesh)
|
||||
globallySharedPoints_(0),
|
||||
cyclicParallel_(false)
|
||||
{
|
||||
if (decompositionDict_.found("distributed"))
|
||||
{
|
||||
distributed_ = Switch(decompositionDict_.lookup("distributed"));
|
||||
const decompositionModel& model = decompositionModel::New
|
||||
(
|
||||
mesh,
|
||||
decompDictFile
|
||||
);
|
||||
|
||||
model.readIfPresent("distributed", distributed_);
|
||||
hasGlobalFaceZones_ = model.found("globalFaceZones");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
faMeshDecomposition::~faMeshDecomposition()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void faMeshDecomposition::decomposeMesh()
|
||||
void Foam::faMeshDecomposition::decomposeMesh()
|
||||
{
|
||||
// Decide which cell goes to which processor
|
||||
distributeFaces();
|
||||
@ -273,7 +276,7 @@ void faMeshDecomposition::decomposeMesh()
|
||||
)
|
||||
);
|
||||
|
||||
HashTable<label, label, Hash<label> > fvFaceProcAddressingHash;
|
||||
Map<label> fvFaceProcAddressingHash;
|
||||
|
||||
{
|
||||
labelIOList fvFaceProcAddressing
|
||||
@ -323,11 +326,11 @@ void faMeshDecomposition::decomposeMesh()
|
||||
const indirectPrimitivePatch& patch = this->patch();
|
||||
const Map<label>& map = patch.meshPointMap();
|
||||
|
||||
HashTable<label, edge, Hash<edge> > edgesHash;
|
||||
EdgeMap<label> edgesHash;
|
||||
|
||||
label edgeI = -1;
|
||||
|
||||
label nIntEdges = patch.nInternalEdges();
|
||||
const label nIntEdges = patch.nInternalEdges();
|
||||
|
||||
for (label curEdge = 0; curEdge < nIntEdges; curEdge++)
|
||||
{
|
||||
@ -338,7 +341,7 @@ void faMeshDecomposition::decomposeMesh()
|
||||
{
|
||||
// Include emptyFaPatch
|
||||
|
||||
label size = boundary()[patchI].labelList::size();
|
||||
const label size = boundary()[patchI].labelList::size();
|
||||
|
||||
for(int eI=0; eI<size; eI++)
|
||||
{
|
||||
@ -428,8 +431,8 @@ void faMeshDecomposition::decomposeMesh()
|
||||
// inside boundaries for the owner processor and try to find
|
||||
// this inter-processor patch.
|
||||
|
||||
label ownerProc = faceToProc_[owner[edgeI]];
|
||||
label neighbourProc = faceToProc_[neighbour[edgeI]];
|
||||
const label ownerProc = faceToProc_[owner[edgeI]];
|
||||
const label neighbourProc = faceToProc_[neighbour[edgeI]];
|
||||
|
||||
SLList<label>::iterator curInterProcBdrsOwnIter =
|
||||
interProcBoundaries[ownerProc].begin();
|
||||
@ -559,7 +562,7 @@ void faMeshDecomposition::decomposeMesh()
|
||||
|
||||
const labelListList& eF = patch().edgeFaces();
|
||||
|
||||
label size = patches[patchI].labelList::size();
|
||||
const label size = patches[patchI].labelList::size();
|
||||
|
||||
labelList patchEdgeFaces(size, -1);
|
||||
|
||||
@ -1153,7 +1156,7 @@ void faMeshDecomposition::decomposeMesh()
|
||||
}
|
||||
|
||||
|
||||
bool faMeshDecomposition::writeDecomposition()
|
||||
bool Foam::faMeshDecomposition::writeDecomposition()
|
||||
{
|
||||
Info<< "\nConstructing processor FA meshes" << endl;
|
||||
|
||||
@ -1412,3 +1415,6 @@ bool faMeshDecomposition::writeDecomposition()
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -48,10 +48,8 @@ SourceFiles
|
||||
#include "PtrList.H"
|
||||
#include "point.H"
|
||||
|
||||
#ifndef namespaceFoam
|
||||
#define namespaceFoam
|
||||
using namespace Foam;
|
||||
#endif
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class faMeshDecomposition Declaration
|
||||
@ -63,8 +61,8 @@ class faMeshDecomposition
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Mesh decomposition control dictionary
|
||||
IOdictionary decompositionDict_;
|
||||
//- Optional non-standard file for decomposeParDict
|
||||
const fileName decompDictFile_;
|
||||
|
||||
//- Number of processors in decomposition
|
||||
label nProcs_;
|
||||
@ -72,6 +70,9 @@ class faMeshDecomposition
|
||||
//- Is the decomposition data to be distributed for each processor
|
||||
bool distributed_;
|
||||
|
||||
//- Are globalFaceZones being used
|
||||
bool hasGlobalFaceZones_;
|
||||
|
||||
//- Processor label for each cell
|
||||
labelList faceToProc_;
|
||||
|
||||
@ -134,13 +135,17 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from fvMesh
|
||||
faMeshDecomposition(const fvMesh& mesh);
|
||||
//- Construct from fvMesh (for mesh and optional non-standard
|
||||
//- decomposeParDict location)
|
||||
faMeshDecomposition
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const fileName& decompDictFile = ""
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
~faMeshDecomposition();
|
||||
//- Destructor
|
||||
~faMeshDecomposition() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -171,6 +176,10 @@ public:
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
@ -2545,7 +2545,8 @@ int main(int argc, char *argv[])
|
||||
haveMesh[Pstream::myProcNo()] = isFile(meshPath);
|
||||
Pstream::gatherList(haveMesh);
|
||||
Pstream::scatterList(haveMesh);
|
||||
Info<< "Per processor mesh availability : " << haveMesh << endl;
|
||||
Info<< "Per processor mesh availability:" << nl
|
||||
<< " " << flatOutput(haveMesh) << nl << endl;
|
||||
|
||||
|
||||
// Addressing back to reconstructed mesh as xxxProcAddressing.
|
||||
@ -2898,7 +2899,8 @@ int main(int argc, char *argv[])
|
||||
haveMesh[Pstream::myProcNo()] = isFile(meshPath);
|
||||
Pstream::gatherList(haveMesh);
|
||||
Pstream::scatterList(haveMesh);
|
||||
Info<< "Per processor mesh availability : " << haveMesh << endl;
|
||||
Info<< "Per processor mesh availability:" << nl
|
||||
<< " " << flatOutput(haveMesh) << nl << endl;
|
||||
|
||||
// Load mesh (or create dummy one)
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@ -2930,7 +2932,7 @@ int main(int argc, char *argv[])
|
||||
fvMesh& mesh = meshPtr();
|
||||
|
||||
|
||||
label nOldCells = mesh.nCells();
|
||||
const label nOldCells = mesh.nCells();
|
||||
//Pout<< "Loaded mesh : nCells:" << nOldCells
|
||||
// << " nPatches:" << mesh.boundaryMesh().size() << endl;
|
||||
|
||||
|
||||
@ -74,7 +74,7 @@ void Foam::ensightCloud::writePositions
|
||||
// Master
|
||||
forAllConstIter(Cloud<passiveParticle>, cloudPtr(), elmnt)
|
||||
{
|
||||
const point& p = elmnt().position();
|
||||
const point p(elmnt().position());
|
||||
|
||||
os.write(p.x());
|
||||
os.write(p.y());
|
||||
@ -104,7 +104,7 @@ void Foam::ensightCloud::writePositions
|
||||
label parcelId = 0;
|
||||
forAllConstIter(Cloud<passiveParticle>, cloudPtr(), elmnt)
|
||||
{
|
||||
const point& p = elmnt().position();
|
||||
const point p(elmnt().position());
|
||||
|
||||
os.write(++parcelId, 8); // unusual width
|
||||
os.write(p.x());
|
||||
@ -140,7 +140,7 @@ void Foam::ensightCloud::writePositions
|
||||
label pti = 0;
|
||||
forAllConstIter(Cloud<passiveParticle>, cloudPtr(), elmnt)
|
||||
{
|
||||
const point& p = elmnt().position();
|
||||
const point p(elmnt().position());
|
||||
points[pti++] = p;
|
||||
}
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ void Foam::vtk::lagrangianWriter::writePoints()
|
||||
|
||||
forAllConstIters(parcels, iter)
|
||||
{
|
||||
const point& pt = iter().position();
|
||||
const point pt(iter().position());
|
||||
|
||||
vtk::write(format(), pt);
|
||||
}
|
||||
|
||||
@ -283,7 +283,7 @@ int main(int argc, char *argv[])
|
||||
forAll(ids, j)
|
||||
{
|
||||
const label localId = particleIds[j];
|
||||
const vector& pos = particles[localId].position();
|
||||
const vector pos(particles[localId].position());
|
||||
os << pos.x() << ' ' << pos.y() << ' ' << pos.z()
|
||||
<< nl;
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -133,7 +133,6 @@ void createFieldFiles
|
||||
Info<< " Generating field files" << nl << endl;
|
||||
|
||||
// Create files
|
||||
mkDir(runTime.path()/runTime.timeName()/regionName);
|
||||
forAll(fieldNames, i)
|
||||
{
|
||||
const_cast<word&>(IOdictionary::typeName) =
|
||||
@ -181,8 +180,8 @@ void createFieldFiles
|
||||
field2.remove("initialConditions");
|
||||
field2.remove("boundaryConditions");
|
||||
|
||||
// Construct and write field dictionary
|
||||
IOdictionary fieldOut
|
||||
// Construct and write field dictionary. Note use of localIOdictionary
|
||||
localIOdictionary fieldOut
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
|
||||
@ -6,20 +6,8 @@
|
||||
# \\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# CleanFunctions
|
||||
@ -158,6 +146,7 @@ cleanFaMesh ()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
cleanApplication()
|
||||
{
|
||||
echo "Cleaning application $PWD"
|
||||
|
||||
120
bin/tools/LogFunctions
Normal file
120
bin/tools/LogFunctions
Normal file
@ -0,0 +1,120 @@
|
||||
#!/bin/sh
|
||||
#------------------------------------------------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# LogFunctions
|
||||
#
|
||||
# Description
|
||||
# Miscellaneous functions for running tutorials in a loop and for
|
||||
# analyzing the output.
|
||||
#
|
||||
# Output is normally summarized as 'testLoopReport'
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# logReport <logfile>
|
||||
# Extracts useful info from log file.
|
||||
logReport()
|
||||
{
|
||||
local logfile=$1
|
||||
|
||||
# logfile is path/to/case/log.application
|
||||
caseName=$(dirname $logfile | sed -e 's/\(.*\)\.\///g')
|
||||
app=$(echo $logfile | sed -e 's/\(.*\)log\.//g')
|
||||
appAndCase="Application $app - case $caseName"
|
||||
|
||||
if grep -q "FOAM FATAL" $logfile
|
||||
then
|
||||
echo "$appAndCase: ** FOAM FATAL ERROR **"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Check for solution singularity on U equation
|
||||
for eqn in Ux Uy Uz
|
||||
do
|
||||
if grep -q -E "${eqn}[:| ]*solution singularity" $logfile
|
||||
then
|
||||
if [ "$eqn" = Uz ]
|
||||
then
|
||||
# Can only get here if Ux,Uy,Uz all failed
|
||||
echo "$appAndCase: ** Solution singularity **"
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if grep -q -E "^[\t ]*[Ee]nd" $logfile
|
||||
then
|
||||
# Extract time from this type of content
|
||||
## ExecutionTime = 60.2 s ClockTime = 63 s --> "60.2 s"
|
||||
completionTime=$(tail -10 $logfile | \
|
||||
sed -n -e '/Execution/{s/^[^=]*=[ \t]*//; s/\( s\) .*$/\1/; p}')
|
||||
|
||||
echo "$appAndCase: completed${completionTime:+ in }$completionTime"
|
||||
else
|
||||
echo "$appAndCase: unconfirmed completion"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Collect and analyse all log files
|
||||
collectLogs()
|
||||
{
|
||||
echo "Collecting log files..." 1>&2
|
||||
rm -f logs testLoopReport > /dev/null 2>&1
|
||||
touch logs testLoopReport
|
||||
|
||||
local appDir log logFiles
|
||||
|
||||
for appDir in *
|
||||
do
|
||||
[ -d $appDir ] || continue
|
||||
echo -n " $appDir..." 1>&2
|
||||
|
||||
logFiles=$(find -L $appDir -name 'log.*' -type f)
|
||||
if [ -n "$logFiles" ]
|
||||
then
|
||||
echo 1>&2
|
||||
else
|
||||
echo " (no logs)" 1>&2
|
||||
continue
|
||||
fi
|
||||
|
||||
# Sort logs by time-stamp
|
||||
for log in $(echo $logFiles | xargs ls -rt)
|
||||
do
|
||||
# Concatenate and summarize logs
|
||||
cat "$log" >> logs 2>/dev/null
|
||||
logReport $log
|
||||
done
|
||||
echo
|
||||
done > testLoopReport
|
||||
}
|
||||
|
||||
|
||||
removeLogs()
|
||||
{
|
||||
echo "Removing backup files"
|
||||
|
||||
find . \( \
|
||||
-name '*~' -o -name '*.bak' \
|
||||
-name core -o -name 'core.[1-9]*' \
|
||||
-name '*.pvs' -o -name '*.foam' -o -name '*.OpenFOAM' \
|
||||
\) -type f -delete
|
||||
|
||||
rm -f logs testLoopReport > /dev/null 2>&1
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -6,26 +6,15 @@
|
||||
# \\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# RunFunctions
|
||||
#
|
||||
# Description
|
||||
# Miscellaneous functions for running tutorial cases
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# The normal locations
|
||||
|
||||
57
etc/bashrc
57
etc/bashrc
@ -36,7 +36,7 @@ export WM_PROJECT=OpenFOAM
|
||||
export WM_PROJECT_VERSION=plus
|
||||
|
||||
# [FOAM_INST_DIR] - parent directory containing the OpenFOAM installation.
|
||||
# * When this file is located as $WM_PROJECT_DIR/etc/bashrc, the next lines
|
||||
# \- When this file is located as $WM_PROJECT_DIR/etc/bashrc, the next lines
|
||||
# should work when sourced by BASH or ZSH shells. If this however fails,
|
||||
# set one of the fallback values to an appropriate path.
|
||||
# --
|
||||
@ -104,23 +104,18 @@ export WM_MPLIB=SYSTEMOPENMPI
|
||||
|
||||
################################################################################
|
||||
|
||||
# The old dirs to be cleaned from the environment variables
|
||||
# Old directories to be cleaned from PATH, LD_LIBRARY_PATH
|
||||
foamOldDirs="$WM_PROJECT_DIR $WM_THIRD_PARTY_DIR \
|
||||
$HOME/$WM_PROJECT/$USER $FOAM_USER_APPBIN $FOAM_USER_LIBBIN \
|
||||
$WM_PROJECT_SITE $FOAM_SITE_APPBIN $FOAM_SITE_LIBBIN"
|
||||
|
||||
# Location of installation
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# Location of installation and third-party software
|
||||
export WM_PROJECT_INST_DIR=$FOAM_INST_DIR
|
||||
export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION
|
||||
|
||||
# Location of third-party software
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
export WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION
|
||||
|
||||
# Location of site-specific templates etc
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# unset is equivalent to $WM_PROJECT_INST_DIR/site
|
||||
# [WM_PROJECT_SITE] - Location of site-specific (group) files
|
||||
# default (unset) implies WM_PROJECT_INST_DIR/site
|
||||
if [ -d "$WM_PROJECT_SITE" ]
|
||||
then
|
||||
export WM_PROJECT_SITE
|
||||
@ -128,12 +123,10 @@ else
|
||||
unset WM_PROJECT_SITE
|
||||
fi
|
||||
|
||||
# Location of user files
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~
|
||||
# [WM_PROJECT_USER_DIR] - Location of user files
|
||||
export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION
|
||||
|
||||
# Load shell functions
|
||||
# ~~~~~~~~~~~~~~~~~~~~
|
||||
. $WM_PROJECT_DIR/etc/config.sh/functions
|
||||
|
||||
# Override definitions via prefs, with 'other' first so the sys-admin
|
||||
@ -163,35 +156,29 @@ cleaned=$($foamClean "$MANPATH" "$foamOldDirs") && MANPATH="$cleaned"
|
||||
export PATH LD_LIBRARY_PATH MANPATH
|
||||
|
||||
|
||||
# Source project setup files
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# Setup for OpenFOAM compilation etc
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
_foamEtc config.sh/settings
|
||||
|
||||
if /usr/bin/tty -s 2>/dev/null # Interactive shell
|
||||
then
|
||||
_foamEtc config.sh/aliases
|
||||
|
||||
# Bash completions
|
||||
if [ "${BASH_VERSINFO:-0}" -ge 4 ]
|
||||
then
|
||||
_foamEtc config.sh/bash_completion
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Source user setup files for optional packages
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# Setup for third-party packages
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
_foamEtc config.sh/mpi
|
||||
_foamEtc config.sh/paraview
|
||||
_foamEtc config.sh/vtk
|
||||
_foamEtc config.sh/ensight
|
||||
_foamEtc config.sh/gperftools
|
||||
|
||||
#_foamEtc config.sh/ADIOS
|
||||
## _foamEtc config.csh/ADIOS
|
||||
_foamEtc config.sh/CGAL
|
||||
_foamEtc config.sh/scotch
|
||||
_foamEtc config.sh/FFTW
|
||||
|
||||
# Interactive shell
|
||||
if /usr/bin/tty -s 2>/dev/null
|
||||
then
|
||||
_foamEtc config.sh/aliases
|
||||
[ "${BASH_VERSINFO:-0}" -ge 4 ] && _foamEtc config.sh/bash_completion
|
||||
fi
|
||||
|
||||
|
||||
# Clean environment paths again. Only remove duplicates
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@ -214,13 +201,13 @@ then
|
||||
fi
|
||||
|
||||
|
||||
# Cleanup environment
|
||||
# ~~~~~~~~~~~~~~~~~~~
|
||||
# Cleanup temporary information
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Functions
|
||||
# Unload shell functions
|
||||
. $WM_PROJECT_DIR/etc/config.sh/functions
|
||||
|
||||
# Variables (do as last for a clean exit code)
|
||||
# Variables (done as the last statement for a clean exit code)
|
||||
unset cleaned foamClean foamOldDirs
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -149,15 +149,14 @@ setenv FOAM_LIBBIN $WM_PROJECT_DIR/platforms/$WM_OPTIONS/lib
|
||||
# External (ThirdParty) libraries
|
||||
setenv FOAM_EXT_LIBBIN $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/lib
|
||||
|
||||
# Site-specific directory
|
||||
# Site-specific (group) files
|
||||
if ( $?WM_PROJECT_SITE ) then
|
||||
set siteDir=$WM_PROJECT_SITE
|
||||
else
|
||||
set siteDir=$WM_PROJECT_INST_DIR/site
|
||||
endif
|
||||
|
||||
# Shared site executables/libraries
|
||||
# Similar naming convention as ~OpenFOAM expansion
|
||||
# Shared site (group) executables/libraries
|
||||
setenv FOAM_SITE_APPBIN $siteDir/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin
|
||||
setenv FOAM_SITE_LIBBIN $siteDir/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib
|
||||
|
||||
@ -165,8 +164,8 @@ setenv FOAM_SITE_LIBBIN $siteDir/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib
|
||||
setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/bin
|
||||
setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/lib
|
||||
|
||||
# DynamicCode templates
|
||||
# - default location is the "~OpenFOAM/codeTemplates/dynamicCode" expansion
|
||||
# [FOAM_CODE_TEMPLATES] - dynamicCode templates
|
||||
# * fallback == "foamEtcFile -list codeTemplates/dynamicCode"
|
||||
# setenv FOAM_CODE_TEMPLATES $WM_PROJECT_DIR/etc/codeTemplates/dynamicCode
|
||||
|
||||
# Convenience
|
||||
@ -302,6 +301,7 @@ CLANG_NOT_FOUND
|
||||
|
||||
_foamAddMan $clangDir/man
|
||||
_foamAddPath $clangDir/bin
|
||||
_foamAddLib $clangDir/lib # For things like libomp (openmp) etc
|
||||
|
||||
if ($?FOAM_VERBOSE && $?prompt) then
|
||||
echo "Using ThirdParty compiler"
|
||||
|
||||
@ -133,7 +133,7 @@ export FOAM_LIBBIN=$WM_PROJECT_DIR/platforms/$WM_OPTIONS/lib
|
||||
# External (ThirdParty) libraries
|
||||
export FOAM_EXT_LIBBIN=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/lib
|
||||
|
||||
# Site-specific directory
|
||||
# Site-specific (group) files
|
||||
if [ -n "$WM_PROJECT_SITE" ]
|
||||
then
|
||||
siteDir=$WM_PROJECT_SITE
|
||||
@ -141,8 +141,7 @@ else
|
||||
siteDir=$WM_PROJECT_INST_DIR/site
|
||||
fi
|
||||
|
||||
# Shared site executables/libraries
|
||||
# Similar naming convention as ~OpenFOAM expansion
|
||||
# Shared site (group) executables/libraries
|
||||
export FOAM_SITE_APPBIN=$siteDir/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin
|
||||
export FOAM_SITE_LIBBIN=$siteDir/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib
|
||||
|
||||
@ -150,8 +149,8 @@ export FOAM_SITE_LIBBIN=$siteDir/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib
|
||||
export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/bin
|
||||
export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/lib
|
||||
|
||||
# DynamicCode templates
|
||||
# - default location is the "~OpenFOAM/codeTemplates/dynamicCode" expansion
|
||||
# [FOAM_CODE_TEMPLATES] - dynamicCode templates
|
||||
# * fallback == "foamEtcFile -list codeTemplates/dynamicCode"
|
||||
# export FOAM_CODE_TEMPLATES=$WM_PROJECT_DIR/etc/codeTemplates/dynamicCode
|
||||
|
||||
# Convenience
|
||||
@ -287,6 +286,7 @@ CLANG_NOT_FOUND
|
||||
|
||||
_foamAddMan $clangDir/share/man
|
||||
_foamAddPath $clangDir/bin
|
||||
_foamAddLib $clangDir/lib # For things like libomp (openmp) etc
|
||||
|
||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||
then
|
||||
|
||||
50
etc/cshrc
50
etc/cshrc
@ -36,7 +36,7 @@ setenv WM_PROJECT OpenFOAM
|
||||
setenv WM_PROJECT_VERSION plus
|
||||
|
||||
# [FOAM_INST_DIR] - parent directory containing the OpenFOAM installation.
|
||||
# * When this file is located as $WM_PROJECT_DIR/etc/cshrc, the next lines
|
||||
# \- When this file is located as $WM_PROJECT_DIR/etc/cshrc, the next lines
|
||||
# should work when sourced by CSH or TCSH shells. If this however fails,
|
||||
# set one of the fallback values to an appropriate path.
|
||||
# --
|
||||
@ -101,7 +101,7 @@ setenv WM_MPLIB SYSTEMOPENMPI
|
||||
|
||||
################################################################################
|
||||
|
||||
# The old dirs to be cleaned from the environment variables
|
||||
# Old directories to be cleaned from PATH, LD_LIBRARY_PATH
|
||||
set foamOldDirs=
|
||||
if ( $?WM_PROJECT_DIR ) then
|
||||
set foamOldDirs="$foamOldDirs $WM_PROJECT_DIR"
|
||||
@ -119,18 +119,13 @@ if ( $?FOAM_SITE_LIBBIN ) then
|
||||
set foamOldDirs="$foamOldDirs $FOAM_SITE_LIBBIN"
|
||||
endif
|
||||
|
||||
# Location of installation
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# Location of installation and third-party software
|
||||
setenv WM_PROJECT_INST_DIR $FOAM_INST_DIR
|
||||
setenv WM_PROJECT_DIR $WM_PROJECT_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION
|
||||
|
||||
# Location of third-party software
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
setenv WM_THIRD_PARTY_DIR $WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION
|
||||
|
||||
# Location of site-specific templates etc
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# unset is equivalent to $WM_PROJECT_INST_DIR/site
|
||||
# [WM_PROJECT_SITE] - Location of site-specific (group) files
|
||||
# default (unset) implies WM_PROJECT_INST_DIR/site
|
||||
if ( $?WM_PROJECT_SITE ) then
|
||||
set foamOldDirs="$WM_PROJECT_SITE $foamOldDirs"
|
||||
if ( ! -d "$WM_PROJECT_SITE" ) unsetenv WM_PROJECT_SITE
|
||||
@ -138,8 +133,7 @@ else
|
||||
unsetenv WM_PROJECT_SITE
|
||||
endif
|
||||
|
||||
# Location of user files
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~
|
||||
# [WM_PROJECT_USER_DIR] - Location of user files
|
||||
setenv WM_PROJECT_USER_DIR $HOME/$WM_PROJECT/$LOGNAME-$WM_PROJECT_VERSION
|
||||
|
||||
# Source an etc file, possibly with some verbosity
|
||||
@ -210,27 +204,26 @@ set cleaned=`$foamClean "$MANPATH" "$foamOldDirs"`
|
||||
if ( $status == 0 ) setenv MANPATH $cleaned
|
||||
|
||||
|
||||
# Source project setup files
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# Setup for OpenFOAM compilation etc
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
_foamEtc config.csh/settings
|
||||
|
||||
if ($?prompt) then # Interactive shell
|
||||
_foamEtc config.csh/aliases
|
||||
_foamEtc config.csh/tcsh_completion
|
||||
endif
|
||||
|
||||
|
||||
# Source user setup files for optional packages
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# Setup for third-party packages
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
_foamEtc config.csh/mpi
|
||||
_foamEtc config.csh/paraview
|
||||
_foamEtc config.csh/vtk
|
||||
_foamEtc config.csh/ensight
|
||||
|
||||
#_foamEtc config.csh/ADIOS
|
||||
## _foamEtc config.csh/ADIOS
|
||||
_foamEtc config.csh/CGAL
|
||||
_foamEtc config.csh/FFTW
|
||||
|
||||
# Interactive shell
|
||||
if ($?prompt) then
|
||||
_foamEtc config.csh/aliases
|
||||
_foamEtc config.csh/tcsh_completion
|
||||
endif
|
||||
|
||||
|
||||
# Clean environment paths again. Only remove duplicates
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@ -253,12 +246,15 @@ if ( $?LD_PRELOAD ) then
|
||||
endif
|
||||
|
||||
|
||||
# Cleanup environment
|
||||
# ~~~~~~~~~~~~~~~~~~~
|
||||
unset cleaned foamClean foamOldDirs
|
||||
# Cleanup temporary information
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Unload shell "functions"
|
||||
unalias _foamEtc
|
||||
unalias _foamAddPath
|
||||
unalias _foamAddLib
|
||||
unalias _foamAddMan
|
||||
|
||||
unset cleaned foamClean foamOldDirs
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -1,15 +1,64 @@
|
||||
OpenFOAM Modules
|
||||
================
|
||||
|
||||
This directory is a location to place additional OpenFOAM components
|
||||
or tools and have them built as part of the normal OpenFOAM build
|
||||
This directory is a location for additional OpenFOAM components or tools
|
||||
to placed and have them built as part of the normal OpenFOAM build
|
||||
process. It is assumed that each subdirectory contain an appropriate
|
||||
Allwmake file, and that they should in all likelihood also build into
|
||||
Allwmake file, and that they in all likelihood also build into
|
||||
`$FOAM_APPBIN` and `$FOAM_LIBBIN` instead of
|
||||
`$FOAM_USER_APPBIN` and `$FOAM_USER_LIBBIN`.
|
||||
|
||||
These additional components may be added as git submodules, by script
|
||||
or by hand.
|
||||
These additional components may be added as [git submodules][man git-submodule],
|
||||
by script or by hand.
|
||||
|
||||
|
||||
### git
|
||||
|
||||
On the first use, it will be necessary to register the submodules:
|
||||
|
||||
git submodule init
|
||||
|
||||
|
||||
This will clone the relevant submodules from their respective
|
||||
repositories.
|
||||
|
||||
|
||||
The following will indicate the current state:
|
||||
|
||||
git submodule status
|
||||
|
||||
|
||||
On the first use, or after merging upstream changes in the OpenFOAM
|
||||
repository, it will be necessary to update the submodules:
|
||||
|
||||
git submodule update
|
||||
|
||||
|
||||
A quick overview of `git submodule` can be in this
|
||||
[*blog*][blog git-submodule] with full details in the
|
||||
[*manpage*][man git-submodule].
|
||||
|
||||
|
||||
An easy way to see which submodules are actually in use:
|
||||
|
||||
`cat .gitmodules`
|
||||
|
||||
Which will reveal content resembling the following:
|
||||
|
||||
[submodule "cfmesh"]
|
||||
path = modules/cfmesh
|
||||
url = https://develop.openfoam.com/Community/integration-cfmesh.git
|
||||
|
||||
|
||||
### doxygen
|
||||
|
||||
To build the doxygen information for the components, it is also
|
||||
necessary to link the directories to the doc/ subdirectory.
|
||||
This is a purely manual operation.
|
||||
|
||||
<!-- General Information -->
|
||||
|
||||
[man git-submodule]: https://git-scm.com/docs/git-submodule
|
||||
[blog git-submodule]: http://blog.joncairns.com/2011/10/how-to-use-git-submodules/
|
||||
|
||||
---
|
||||
|
||||
1
modules/avalanche
Submodule
1
modules/avalanche
Submodule
Submodule modules/avalanche added at 9b506551a7
Submodule modules/cfmesh updated: 7fb146a232...57b9896a21
@ -229,9 +229,6 @@ void Foam::epsilonWallFunctionFvPatchScalarField::calculate
|
||||
|
||||
const scalarField magGradUw(mag(Uw.snGrad()));
|
||||
|
||||
typedef DimensionedField<scalar, volMesh> FieldType;
|
||||
const FieldType& G = db().lookupObject<FieldType>(turbModel.GName());
|
||||
|
||||
// Set epsilon and G
|
||||
forAll(nutw, facei)
|
||||
{
|
||||
@ -255,8 +252,6 @@ void Foam::epsilonWallFunctionFvPatchScalarField::calculate
|
||||
else
|
||||
{
|
||||
epsilon0[celli] += w*2.0*k[celli]*nuw[facei]/sqr(y[facei]);
|
||||
|
||||
G0[celli] += w*G[celli];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -242,7 +242,12 @@ void Foam::cellCuts::syncProc()
|
||||
else
|
||||
{
|
||||
label oppFp = relCut[i]-1;
|
||||
label fp = f.size()-1-oppFp;
|
||||
label fp =
|
||||
(
|
||||
oppFp == 0
|
||||
? 0
|
||||
: f.size()-oppFp
|
||||
);
|
||||
absoluteCut[i] = vertToEVert(f[fp]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,16 +108,29 @@ void Foam::turbulentDFSEMInletFvPatchVectorField::writeLumleyCoeffs() const
|
||||
{
|
||||
fileName valsFile
|
||||
(
|
||||
this->db().time().caseConstant()
|
||||
fileHandler().filePath
|
||||
(
|
||||
fileName
|
||||
(
|
||||
db().time().path()
|
||||
/db().time().caseConstant()
|
||||
/"boundaryData"
|
||||
/this->patch().name()
|
||||
/"0"
|
||||
/"R"
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
IFstream is(valsFile);
|
||||
autoPtr<ISstream> isPtr
|
||||
(
|
||||
fileHandler().NewIFstream
|
||||
(
|
||||
valsFile
|
||||
)
|
||||
);
|
||||
|
||||
Field<symmTensor> Rexp(is);
|
||||
Field<symmTensor> Rexp(isPtr());
|
||||
|
||||
OFstream os(db().time().path()/"lumley_input.out");
|
||||
|
||||
|
||||
@ -71,6 +71,10 @@ Foam::turbulentDFSEMInletFvPatchVectorField::interpolateBoundaryData
|
||||
const word& patchName = this->patch().name();
|
||||
|
||||
fileName valsFile
|
||||
(
|
||||
fileHandler().filePath
|
||||
(
|
||||
fileName
|
||||
(
|
||||
this->db().time().path()
|
||||
/this->db().time().caseConstant()
|
||||
@ -78,10 +82,19 @@ Foam::turbulentDFSEMInletFvPatchVectorField::interpolateBoundaryData
|
||||
/patchName
|
||||
/"0"
|
||||
/fieldName
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
IFstream is(valsFile);
|
||||
Field<Type> vals(is);
|
||||
autoPtr<ISstream> isPtr
|
||||
(
|
||||
fileHandler().NewIFstream
|
||||
(
|
||||
valsFile
|
||||
)
|
||||
);
|
||||
|
||||
Field<Type> vals(isPtr());
|
||||
|
||||
Info<< "Turbulent DFSEM patch " << patchName
|
||||
<< ": interpolating field " << fieldName
|
||||
|
||||
@ -11,6 +11,13 @@ fieldValues/fieldValueDelta/fieldValueDelta.C
|
||||
fieldValues/volFieldValue/volFieldValue.C
|
||||
fieldValues/surfaceFieldValue/surfaceFieldValue.C
|
||||
|
||||
heatTransferCoeff/heatTransferCoeff.C
|
||||
heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModel.C
|
||||
heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModelNew.C
|
||||
heatTransferCoeff/heatTransferCoeffModels/fixedReferenceTemperature/fixedReferenceTemperature.C
|
||||
heatTransferCoeff/heatTransferCoeffModels/localReferenceTemperature/localReferenceTemperature.C
|
||||
heatTransferCoeff/heatTransferCoeffModels/ReynoldsAnalogy/ReynoldsAnalogy.C
|
||||
|
||||
nearWallFields/nearWallFields.C
|
||||
nearWallFields/findCellParticle.C
|
||||
nearWallFields/findCellParticleCloud.C
|
||||
|
||||
@ -314,7 +314,8 @@ void Foam::functionObjects::extractEulerianParticles::collectParticles
|
||||
tag,
|
||||
time,
|
||||
d,
|
||||
U
|
||||
U,
|
||||
false // not looking to set cell owner etc.
|
||||
);
|
||||
|
||||
cloud_.addParticle(ip);
|
||||
|
||||
114
src/functionObjects/field/heatTransferCoeff/heatTransferCoeff.C
Normal file
114
src/functionObjects/field/heatTransferCoeff/heatTransferCoeff.C
Normal file
@ -0,0 +1,114 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 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 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "heatTransferCoeff.H"
|
||||
#include "dictionary.H"
|
||||
#include "heatTransferCoeffModel.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace functionObjects
|
||||
{
|
||||
defineTypeNameAndDebug(heatTransferCoeff, 0);
|
||||
addToRunTimeSelectionTable(functionObject, heatTransferCoeff, dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::heatTransferCoeff::calc()
|
||||
{
|
||||
volScalarField& htc = mesh_.lookupObjectRef<volScalarField>(resultName_);
|
||||
|
||||
htcModelPtr_->calc(htc);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::heatTransferCoeff::heatTransferCoeff
|
||||
(
|
||||
const word& name,
|
||||
const Time& runTime,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fieldExpression(name, runTime, dict),
|
||||
htcModelPtr_()
|
||||
{
|
||||
read(dict);
|
||||
|
||||
setResultName(typeName, name + ":htc:" + htcModelPtr_->type());
|
||||
|
||||
volScalarField* heatTransferCoeffPtr
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
resultName_,
|
||||
mesh_.time().timeName(),
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("0", dimPower/dimArea/dimTemperature, 0.0)
|
||||
)
|
||||
);
|
||||
|
||||
mesh_.objectRegistry::store(heatTransferCoeffPtr);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::heatTransferCoeff::~heatTransferCoeff()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::heatTransferCoeff::read(const dictionary& dict)
|
||||
{
|
||||
if (fieldExpression::read(dict))
|
||||
{
|
||||
htcModelPtr_ = heatTransferCoeffModel::New(dict, mesh_, fieldName_);
|
||||
|
||||
htcModelPtr_->read(dict);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
199
src/functionObjects/field/heatTransferCoeff/heatTransferCoeff.H
Normal file
199
src/functionObjects/field/heatTransferCoeff/heatTransferCoeff.H
Normal file
@ -0,0 +1,199 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 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 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::functionObjects::heatTransferCoeff
|
||||
|
||||
Group
|
||||
grpFieldFunctionObjects
|
||||
|
||||
Description
|
||||
This function object calculates and writes the heat transfer coefficient
|
||||
as a volScalarField for a set of patches.
|
||||
|
||||
The field is stored on the mesh database so that it can be retrieved and
|
||||
used for other applications. Heat transfer coefficient, htc [W/m2/K]
|
||||
can be evaluated using one of the following modes:
|
||||
- ReynoldsAnalogy: Reynold's analogy
|
||||
- localReferenceTemperature: local reference temperature
|
||||
- fixedReferenceTemperature: specified reference temperature
|
||||
|
||||
Usage
|
||||
Example usage for mode 'ReynoldsAnalogy' for incompressible case
|
||||
\verbatim
|
||||
htc
|
||||
{
|
||||
type heatTransferCoeff;
|
||||
libs ("libfieldFunctionObjects.so");
|
||||
|
||||
field T;
|
||||
patches ("walls.*");
|
||||
|
||||
htcModel ReynoldsAnalogy;
|
||||
UInf (20 0 0);
|
||||
Cp CpInf;
|
||||
CpInf 1000;
|
||||
rho rhoInf;
|
||||
rhoInf 1.2;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
Example usage for mode 'ReynoldsAnalogy' for compressible case
|
||||
\verbatim
|
||||
htc
|
||||
{
|
||||
type heatTransferCoeff;
|
||||
libs ("libfieldFunctionObjects.so");
|
||||
|
||||
field T;
|
||||
patches ("walls.*");
|
||||
|
||||
htcModel ReynoldsAnalogy;
|
||||
UInf (20 0 0);
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
Example usage for mode 'localReferenceTemperature' for compressible case
|
||||
\verbatim
|
||||
htc
|
||||
{
|
||||
type heatTransferCoeff;
|
||||
libs ("libfieldFunctionObjects.so");
|
||||
|
||||
field T;
|
||||
patches ("walls.*");
|
||||
htcModel local;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
Example usage for mode 'fixedReferenceTemperature' for compressible case
|
||||
\verbatim
|
||||
htc
|
||||
{
|
||||
type heatTransferCoeff;
|
||||
libs ("libfieldFunctionObjects.so");
|
||||
|
||||
field T;
|
||||
patches ("walls.*");
|
||||
htcModel local;
|
||||
TRef 300;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
See also
|
||||
Foam::functionObjects::fieldExpression
|
||||
Foam::heatTransferCoeffModels::fixedReferenceTemperature
|
||||
Foam::heatTransferCoeffModels::localReferenceTemperature
|
||||
|
||||
SourceFiles
|
||||
heatTransferCoeff.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef functionObjects_heatTransferCoeff_H
|
||||
#define functionObjects_heatTransferCoeff_H
|
||||
|
||||
#include "fieldExpression.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class heatTransferCoeffModel;
|
||||
|
||||
namespace functionObjects
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class heatTransferCoeff Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class heatTransferCoeff
|
||||
:
|
||||
public fieldExpression
|
||||
{
|
||||
|
||||
private:
|
||||
|
||||
// Private data
|
||||
|
||||
//- Heat transfer coefficient model
|
||||
autoPtr<heatTransferCoeffModel> htcModelPtr_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
heatTransferCoeff(const heatTransferCoeff&) = delete;
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const heatTransferCoeff&) = delete;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
//- Calculate the heat transfer coefficient field and return true
|
||||
// if successful
|
||||
virtual bool calc();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("heatTransferCoeff");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct for given objectRegistry and dictionary.
|
||||
// Allow the possibility to load fields from files
|
||||
heatTransferCoeff
|
||||
(
|
||||
const word& name,
|
||||
const Time& runTime,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~heatTransferCoeff();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Read the heatTransferCoeff data
|
||||
virtual bool read(const dictionary&);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace functionObjects
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,271 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 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 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "ReynoldsAnalogy.H"
|
||||
#include "fluidThermo.H"
|
||||
#include "turbulentTransportModel.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace heatTransferCoeffModels
|
||||
{
|
||||
defineTypeNameAndDebug(ReynoldsAnalogy, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
heatTransferCoeffModel,
|
||||
ReynoldsAnalogy,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::Field<Foam::scalar>>
|
||||
Foam::heatTransferCoeffModels::ReynoldsAnalogy::rho(const label patchi) const
|
||||
{
|
||||
if (rhoName_ == "rhoInf")
|
||||
{
|
||||
const label n = mesh_.boundary()[patchi].size();
|
||||
return tmp<Field<scalar>>(new Field<scalar>(n, rhoRef_));
|
||||
}
|
||||
else if (mesh_.foundObject<volScalarField>(rhoName_, false))
|
||||
{
|
||||
const volScalarField& rho =
|
||||
mesh_.lookupObject<volScalarField>(rhoName_);
|
||||
return rho.boundaryField()[patchi];
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unable to set rho for patch " << patchi
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return tmp<Field<scalar>>(nullptr);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::Field<Foam::scalar>>
|
||||
Foam::heatTransferCoeffModels::ReynoldsAnalogy::Cp(const label patchi) const
|
||||
{
|
||||
if (CpName_ == "CpInf")
|
||||
{
|
||||
const label n = mesh_.boundary()[patchi].size();
|
||||
return tmp<Field<scalar>>(new Field<scalar>(n, CpRef_));
|
||||
}
|
||||
else if (mesh_.foundObject<fluidThermo>(fluidThermo::typeName))
|
||||
{
|
||||
const fluidThermo& thermo =
|
||||
mesh_.lookupObject<fluidThermo>(fluidThermo::typeName);
|
||||
|
||||
const scalarField& pp = thermo.p().boundaryField()[patchi];
|
||||
const scalarField& Tp = thermo.T().boundaryField()[patchi];
|
||||
|
||||
return thermo.Cp(pp, Tp, patchi);
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unable to set Cp for patch " << patchi
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return tmp<Field<scalar>>(nullptr);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volSymmTensorField>
|
||||
Foam::heatTransferCoeffModels::ReynoldsAnalogy::devReff() const
|
||||
{
|
||||
typedef compressible::turbulenceModel cmpTurbModel;
|
||||
typedef incompressible::turbulenceModel icoTurbModel;
|
||||
|
||||
if (mesh_.foundObject<cmpTurbModel>(cmpTurbModel::propertiesName))
|
||||
{
|
||||
const cmpTurbModel& turb =
|
||||
mesh_.lookupObject<cmpTurbModel>(cmpTurbModel::propertiesName);
|
||||
|
||||
return turb.devRhoReff()/turb.rho();
|
||||
}
|
||||
else if (mesh_.foundObject<icoTurbModel>(icoTurbModel::propertiesName))
|
||||
{
|
||||
const incompressible::turbulenceModel& turb =
|
||||
mesh_.lookupObject<icoTurbModel>(icoTurbModel::propertiesName);
|
||||
|
||||
return turb.devReff();
|
||||
}
|
||||
else if (mesh_.foundObject<fluidThermo>(fluidThermo::dictName))
|
||||
{
|
||||
const fluidThermo& thermo =
|
||||
mesh_.lookupObject<fluidThermo>(fluidThermo::dictName);
|
||||
|
||||
const volVectorField& U = mesh_.lookupObject<volVectorField>(UName_);
|
||||
|
||||
return -thermo.nu()*dev(twoSymm(fvc::grad(U)));
|
||||
}
|
||||
else if (mesh_.foundObject<transportModel>("transportProperties"))
|
||||
{
|
||||
const transportModel& laminarT =
|
||||
mesh_.lookupObject<transportModel>("transportProperties");
|
||||
|
||||
const volVectorField& U = mesh_.lookupObject<volVectorField>(UName_);
|
||||
|
||||
return -laminarT.nu()*dev(twoSymm(fvc::grad(U)));
|
||||
}
|
||||
else if (mesh_.foundObject<dictionary>("transportProperties"))
|
||||
{
|
||||
const dictionary& transportProperties =
|
||||
mesh_.lookupObject<dictionary>("transportProperties");
|
||||
|
||||
dimensionedScalar nu(transportProperties.lookup("nu"));
|
||||
|
||||
const volVectorField& U = mesh_.lookupObject<volVectorField>(UName_);
|
||||
|
||||
return -nu*dev(twoSymm(fvc::grad(U)));
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "No valid model for viscous stress calculation"
|
||||
<< exit(FatalError);
|
||||
|
||||
return volSymmTensorField::null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::FieldField<Foam::Field, Foam::scalar>>
|
||||
Foam::heatTransferCoeffModels::ReynoldsAnalogy::Cf() const
|
||||
{
|
||||
const volVectorField& U = mesh_.lookupObject<volVectorField>(UName_);
|
||||
const volVectorField::Boundary& Ubf = U.boundaryField();
|
||||
|
||||
tmp<FieldField<Field, scalar>> tCf
|
||||
(
|
||||
new FieldField<Field, scalar>(Ubf.size())
|
||||
);
|
||||
|
||||
FieldField<Field, scalar>& Cf = tCf.ref();
|
||||
|
||||
forAll(Cf, patchi)
|
||||
{
|
||||
Cf.set(patchi, new Field<scalar>(Ubf[patchi].size(), 0));
|
||||
}
|
||||
|
||||
const volSymmTensorField R(devReff());
|
||||
const volSymmTensorField::Boundary& Rbf = R.boundaryField();
|
||||
|
||||
for (label patchi : patchSet_)
|
||||
{
|
||||
const fvPatchVectorField& Up = Ubf[patchi];
|
||||
|
||||
const symmTensorField& Rp = Rbf[patchi];
|
||||
|
||||
const vectorField nHat(Up.patch().nf());
|
||||
|
||||
const scalarField tauByRhop(mag(nHat & Rp));
|
||||
|
||||
Cf[patchi] = 2*tauByRhop/magSqr(URef_);
|
||||
}
|
||||
|
||||
return tCf;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::heatTransferCoeffModels::ReynoldsAnalogy::ReynoldsAnalogy
|
||||
(
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh,
|
||||
const word& TName
|
||||
)
|
||||
:
|
||||
heatTransferCoeffModel(dict, mesh, TName),
|
||||
UName_("U"),
|
||||
URef_(vector::zero),
|
||||
rhoName_("rho"),
|
||||
rhoRef_(0.0),
|
||||
CpName_("Cp"),
|
||||
CpRef_(0.0)
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::heatTransferCoeffModels::ReynoldsAnalogy::read
|
||||
(
|
||||
const dictionary& dict
|
||||
)
|
||||
{
|
||||
if (heatTransferCoeffModel::read(dict))
|
||||
{
|
||||
dict.lookup("UInf") >> URef_;
|
||||
|
||||
dict.readIfPresent("Cp", CpName_);
|
||||
if (CpName_ == "CpInf")
|
||||
{
|
||||
dict.lookup("CpInf") >> CpRef_;
|
||||
}
|
||||
|
||||
dict.readIfPresent("rho", rhoName_);
|
||||
if (rhoName_ == "rhoInf")
|
||||
{
|
||||
dict.lookup("rhoInf") >> rhoRef_;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void Foam::heatTransferCoeffModels::ReynoldsAnalogy::htc(volScalarField& htc)
|
||||
{
|
||||
const FieldField<Field, scalar> CfBf(Cf());
|
||||
const scalar magU = mag(URef_);
|
||||
|
||||
volScalarField::Boundary& htcBf = htc.boundaryFieldRef();
|
||||
forAllConstIters(patchSet_, iter)
|
||||
{
|
||||
label patchi = iter.key();
|
||||
const scalarField rhop(rho(patchi));
|
||||
const scalarField Cpp(Cp(patchi));
|
||||
|
||||
htcBf[patchi] = 0.5*rhop*Cpp*magU*CfBf[patchi];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,182 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 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 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::heatTransferCoeffModels::ReynoldsAnalogy
|
||||
|
||||
Description
|
||||
Heat transfer coefficient calculation based on Reynolds Analogy
|
||||
|
||||
The heat transfer coefficient is derived from the skin friction
|
||||
coefficient:
|
||||
|
||||
\f[
|
||||
C_f = \frac{\tau_w}{0.5 \rho_\infty |U|^2}
|
||||
\f]
|
||||
|
||||
as:
|
||||
|
||||
\f[
|
||||
h = 0.5 \rho_\infty \C_{p,\infty} |U_{\infty}| C_f
|
||||
\f]
|
||||
|
||||
Usage
|
||||
Example of function object specification:
|
||||
\verbatim
|
||||
type heatTransferCoeff;
|
||||
libs ("libfieldFunctionObjects.so");
|
||||
...
|
||||
htcModel ReynoldsAnalogy;
|
||||
UInf (20 0 0);
|
||||
Cp CpInf;
|
||||
CpInf 1005;
|
||||
...
|
||||
\endverbatim
|
||||
|
||||
Where the entries comprise:
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
type | type name: heatTransferCoeff | yes |
|
||||
htcModel | selected htc model | yes |
|
||||
UInf | reference velocity | yes |
|
||||
Cp | specific heat capacity field name | no |
|
||||
rho | density field name | no |
|
||||
\endtable
|
||||
|
||||
Note:
|
||||
- to use a reference \c Cp, set \c Cp to \c CpInf
|
||||
- to use a reference \c rho, set \c rho to \c rhoInf
|
||||
|
||||
SourceFiles
|
||||
ReynoldsAnalogy.C
|
||||
|
||||
SeeAlso
|
||||
Foam::heatTransferCoeffModel
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef heatTransferCoeffModels_ReynoldsAnalogy_H
|
||||
#define heatTransferCoeffModels_ReynoldsAnalogy_H
|
||||
|
||||
#include "heatTransferCoeffModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace heatTransferCoeffModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ReynoldsAnalogy Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class ReynoldsAnalogy
|
||||
:
|
||||
public heatTransferCoeffModel
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow copy construct
|
||||
ReynoldsAnalogy(const ReynoldsAnalogy&) = delete;
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const ReynoldsAnalogy&) = delete;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Name of velocity field
|
||||
word UName_;
|
||||
|
||||
//- Reference velocity
|
||||
vector URef_;
|
||||
|
||||
//- Name of density field
|
||||
word rhoName_;
|
||||
|
||||
//- Reference density
|
||||
scalar rhoRef_;
|
||||
|
||||
//- Name of specific heat capacity field
|
||||
word CpName_;
|
||||
|
||||
//- Reference specific heat capacity
|
||||
scalar CpRef_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
virtual tmp<Field<scalar>> rho(const label patchi) const;
|
||||
|
||||
virtual tmp<Field<scalar>> Cp(const label patchi) const;
|
||||
|
||||
virtual tmp<volSymmTensorField> devReff() const;
|
||||
|
||||
tmp<FieldField<Field, scalar>> Cf() const;
|
||||
|
||||
//- Set the heat transfer coefficient
|
||||
virtual void htc(volScalarField& htc);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("ReynoldsAnalogy");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
ReynoldsAnalogy
|
||||
(
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh,
|
||||
const word& TName
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~ReynoldsAnalogy()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Read from dictionary
|
||||
virtual bool read(const dictionary& dict);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace heatTransferCoeffModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,99 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 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 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fixedReferenceTemperature.H"
|
||||
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace heatTransferCoeffModels
|
||||
{
|
||||
defineTypeNameAndDebug(fixedReferenceTemperature, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
heatTransferCoeffModel,
|
||||
fixedReferenceTemperature,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::heatTransferCoeffModels::fixedReferenceTemperature::fixedReferenceTemperature
|
||||
(
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh,
|
||||
const word& TName
|
||||
)
|
||||
:
|
||||
heatTransferCoeffModel(dict, mesh, TName),
|
||||
TRef_(0)
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::heatTransferCoeffModels::fixedReferenceTemperature::read
|
||||
(
|
||||
const dictionary& dict
|
||||
)
|
||||
{
|
||||
if (heatTransferCoeffModel::read(dict))
|
||||
{
|
||||
dict.lookup("TRef") >> TRef_;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void Foam::heatTransferCoeffModels::fixedReferenceTemperature::htc
|
||||
(
|
||||
volScalarField& htc
|
||||
)
|
||||
{
|
||||
const FieldField<Field, scalar> qBf(q());
|
||||
const volScalarField& T = mesh_.lookupObject<volScalarField>(TName_);
|
||||
const volScalarField::Boundary& Tbf = T.boundaryField();
|
||||
const scalar eps = ROOTVSMALL;
|
||||
|
||||
volScalarField::Boundary& htcBf = htc.boundaryFieldRef();
|
||||
forAllConstIters(patchSet_, iter)
|
||||
{
|
||||
label patchi = iter.key();
|
||||
htcBf[patchi] = qBf[patchi]/(TRef_ - Tbf[patchi] + eps);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,145 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 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 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::heatTransferCoeffModels::fixedReferenceTemperature
|
||||
|
||||
Description
|
||||
Heat transfer coefficient calculation that employs a fixed reference
|
||||
temperature
|
||||
|
||||
The heat transfer coefficient is specified by:
|
||||
|
||||
\f[
|
||||
h = \frac{q}{T_{ref} - T_w}
|
||||
\f]
|
||||
|
||||
Usage
|
||||
Example of function object specification:
|
||||
\verbatim
|
||||
type heatTransferCoeff;
|
||||
libs ("libfieldFunctionObjects.so");
|
||||
...
|
||||
htcModel fixedReferenceTemperature;
|
||||
TRef 300;
|
||||
...
|
||||
\endverbatim
|
||||
|
||||
Where the entries comprise:
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
type | type name: heatTransferCoeff | yes |
|
||||
htcModel | selected htc model | yes |
|
||||
TRef | reference temperature | yes |
|
||||
\endtable
|
||||
|
||||
SourceFiles
|
||||
fixedReferenceTemperature.C
|
||||
|
||||
SeeAlso
|
||||
Foam::heatTransferCoeffModel
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef heatTransferCoeffModels_fixedReferenceTemperature_H
|
||||
#define heatTransferCoeffModels_fixedReferenceTemperature_H
|
||||
|
||||
#include "heatTransferCoeffModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace heatTransferCoeffModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class fixedReferenceTemperature Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class fixedReferenceTemperature
|
||||
:
|
||||
public heatTransferCoeffModel
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow copy construct
|
||||
fixedReferenceTemperature(const fixedReferenceTemperature&) = delete;
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const fixedReferenceTemperature&) = delete;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Reference tempetaure
|
||||
scalar TRef_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Set the heat transfer coefficient
|
||||
virtual void htc(volScalarField& htc);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("fixedReferenceTemperature");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
fixedReferenceTemperature
|
||||
(
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh,
|
||||
const word& TName
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~fixedReferenceTemperature()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Read from dictionary
|
||||
virtual bool read(const dictionary& dict);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace heatTransferCoeffModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,154 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 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 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "heatTransferCoeffModel.H"
|
||||
#include "fvMesh.H"
|
||||
#include "fluidThermo.H"
|
||||
#include "turbulentTransportModel.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(heatTransferCoeffModel, 0);
|
||||
defineRunTimeSelectionTable(heatTransferCoeffModel, dictionary);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::FieldField<Foam::Field, Foam::scalar>>
|
||||
Foam::heatTransferCoeffModel::q() const
|
||||
{
|
||||
const volScalarField& T = mesh_.lookupObject<volScalarField>(TName_);
|
||||
const volScalarField::Boundary& Tbf = T.boundaryField();
|
||||
|
||||
tmp<FieldField<Field, scalar>> tq
|
||||
(
|
||||
new FieldField<Field, scalar>(Tbf.size())
|
||||
);
|
||||
|
||||
FieldField<Field, scalar>& q = tq.ref();
|
||||
|
||||
forAll(q, patchi)
|
||||
{
|
||||
q.set(patchi, new Field<scalar>(Tbf[patchi].size(), 0));
|
||||
}
|
||||
|
||||
typedef compressible::turbulenceModel cmpTurbModel;
|
||||
|
||||
if (mesh_.foundObject<cmpTurbModel>(cmpTurbModel::propertiesName))
|
||||
{
|
||||
const cmpTurbModel& turb =
|
||||
mesh_.lookupObject<cmpTurbModel>(cmpTurbModel::propertiesName);
|
||||
|
||||
const volScalarField& he = turb.transport().he();
|
||||
const volScalarField::Boundary& hebf = he.boundaryField();
|
||||
|
||||
const volScalarField alphaEff(turb.alphaEff());
|
||||
const volScalarField::Boundary& alphaEffbf = alphaEff.boundaryField();
|
||||
|
||||
for (label patchi : patchSet_)
|
||||
{
|
||||
q[patchi] = alphaEffbf[patchi]*hebf[patchi].snGrad();
|
||||
}
|
||||
}
|
||||
else if (mesh_.foundObject<fluidThermo>(fluidThermo::dictName))
|
||||
{
|
||||
const fluidThermo& thermo =
|
||||
mesh_.lookupObject<fluidThermo>(fluidThermo::dictName);
|
||||
|
||||
const volScalarField& he = thermo.he();
|
||||
const volScalarField::Boundary& hebf = he.boundaryField();
|
||||
|
||||
const volScalarField& alpha(thermo.alpha());
|
||||
const volScalarField::Boundary& alphabf = alpha.boundaryField();
|
||||
|
||||
for (label patchi : patchSet_)
|
||||
{
|
||||
q[patchi] = alphabf[patchi]*hebf[patchi].snGrad();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unable to find a valid thermo model to evaluate q"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
// Add radiative heat flux contribution if present
|
||||
if (mesh_.foundObject<volScalarField>(qrName_))
|
||||
{
|
||||
const volScalarField& qr = mesh_.lookupObject<volScalarField>(qrName_);
|
||||
const volScalarField::Boundary& qrbf = qr.boundaryField();
|
||||
|
||||
for (label patchi : patchSet_)
|
||||
{
|
||||
q[patchi] += qrbf[patchi];
|
||||
}
|
||||
}
|
||||
|
||||
return tq;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::heatTransferCoeffModel::heatTransferCoeffModel
|
||||
(
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh,
|
||||
const word& TName
|
||||
)
|
||||
:
|
||||
mesh_(mesh),
|
||||
TName_(TName),
|
||||
patchSet_(),
|
||||
qrName_("qr")
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::heatTransferCoeffModel::read(const dictionary& dict)
|
||||
{
|
||||
const wordReList patchNames(dict.lookup("patches"));
|
||||
patchSet_ = mesh_.boundaryMesh().patchSet(patchNames);
|
||||
dict.readIfPresent("qr", qrName_);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::heatTransferCoeffModel::calc(volScalarField& result)
|
||||
{
|
||||
htc(result);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,158 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 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 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Namespace
|
||||
Foam::heatTransferCoeffModels
|
||||
|
||||
Description
|
||||
A namespace for various heat transfer coefficient model implementations.
|
||||
|
||||
Class
|
||||
Foam::heatTransferCoeffModel
|
||||
|
||||
Description
|
||||
An abstract base class for heat transfer coeffcient models.
|
||||
|
||||
SourceFiles
|
||||
heatTransferCoeffModel.C
|
||||
heatTransferCoeffModelNew.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef heatTransferCoeffModel_H
|
||||
#define heatTransferCoeffModel_H
|
||||
|
||||
#include "dictionary.H"
|
||||
#include "HashSet.H"
|
||||
#include "volFields.H"
|
||||
|
||||
#include "runTimeSelectionTables.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class fvMesh;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class heatTransferCoeffModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class heatTransferCoeffModel
|
||||
{
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow copy construct
|
||||
heatTransferCoeffModel(const heatTransferCoeffModel&) = delete;
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const heatTransferCoeffModel&) = delete;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
const fvMesh& mesh_;
|
||||
|
||||
const word TName_;
|
||||
|
||||
labelHashSet patchSet_;
|
||||
|
||||
word qrName_;
|
||||
|
||||
tmp<FieldField<Field, scalar>> q() const;
|
||||
|
||||
//- Set the heat transfer coefficient
|
||||
virtual void htc(volScalarField& htc) = 0;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("heatTransferCoeffModel");
|
||||
|
||||
|
||||
// Declare run-time constructor selection table
|
||||
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
heatTransferCoeffModel,
|
||||
dictionary,
|
||||
(
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh,
|
||||
const word& TName
|
||||
),
|
||||
(dict, mesh, TName)
|
||||
);
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Return a reference to the selected heat transfer coefficicent model
|
||||
static autoPtr<heatTransferCoeffModel> New
|
||||
(
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh,
|
||||
const word& TName
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
heatTransferCoeffModel
|
||||
(
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh,
|
||||
const word& TName
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~heatTransferCoeffModel()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Read from dictionary
|
||||
virtual bool read(const dictionary& dict);
|
||||
|
||||
virtual bool calc(volScalarField& result);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,59 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 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 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "heatTransferCoeffModel.H"
|
||||
#include "fvMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::heatTransferCoeffModel> Foam::heatTransferCoeffModel::New
|
||||
(
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh,
|
||||
const word& TName
|
||||
)
|
||||
{
|
||||
const word modelType(dict.lookup("htcModel"));
|
||||
|
||||
Info<< "Selecting heat transfer coefficient model " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown heatTransferCoeffModel type "
|
||||
<< modelType << nl << nl
|
||||
<< "Valid heatTransferCoeffModels :" << endl
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<heatTransferCoeffModel>(cstrIter()(dict, mesh, TName));
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,93 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 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 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "localReferenceTemperature.H"
|
||||
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace heatTransferCoeffModels
|
||||
{
|
||||
defineTypeNameAndDebug(localReferenceTemperature, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
heatTransferCoeffModel,
|
||||
localReferenceTemperature,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::heatTransferCoeffModels::localReferenceTemperature::
|
||||
localReferenceTemperature
|
||||
(
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh,
|
||||
const word& TName
|
||||
)
|
||||
:
|
||||
heatTransferCoeffModel(dict, mesh, TName)
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::heatTransferCoeffModels::localReferenceTemperature::read
|
||||
(
|
||||
const dictionary& dict
|
||||
)
|
||||
{
|
||||
return heatTransferCoeffModel::read(dict);
|
||||
}
|
||||
|
||||
|
||||
void Foam::heatTransferCoeffModels::localReferenceTemperature::htc
|
||||
(
|
||||
volScalarField& htc
|
||||
)
|
||||
{
|
||||
const FieldField<Field, scalar> qBf(q());
|
||||
const volScalarField& T = mesh_.lookupObject<volScalarField>(TName_);
|
||||
const volScalarField::Boundary& Tbf = T.boundaryField();
|
||||
const scalar eps = ROOTVSMALL;
|
||||
|
||||
volScalarField::Boundary& htcBf = htc.boundaryFieldRef();
|
||||
forAllConstIters(patchSet_, iter)
|
||||
{
|
||||
label patchi = iter.key();
|
||||
const scalarField Tc(Tbf[patchi].patchInternalField());
|
||||
htcBf[patchi] = qBf[patchi]/(Tc - Tbf[patchi] + eps);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,137 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 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 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::heatTransferCoeffModels::localReferenceTemperature
|
||||
|
||||
Description
|
||||
Heat transfer coefficient calculation that employs the patch internal
|
||||
field as the reference temperature
|
||||
|
||||
The heat transfer coefficient is specified by:
|
||||
|
||||
\f[
|
||||
h = \frac{q}{T_c - T_w}
|
||||
\f]
|
||||
|
||||
Usage
|
||||
Example of function object specification:
|
||||
\verbatim
|
||||
type heatTransferCoeff;
|
||||
libs ("libfieldFunctionObjects.so");
|
||||
...
|
||||
htcModel localReferenceTemperature;
|
||||
...
|
||||
\endverbatim
|
||||
|
||||
Where the entries comprise:
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
type | type name: heatTransferCoeff | yes |
|
||||
htcModel | selected htc model | yes |
|
||||
\endtable
|
||||
|
||||
SourceFiles
|
||||
localReferenceTemperature.C
|
||||
|
||||
SeeAlso
|
||||
Foam::heatTransferCoeffModel
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef heatTransferCoeffModels_localReferenceTemperature_H
|
||||
#define heatTransferCoeffModels_localReferenceTemperature_H
|
||||
|
||||
#include "heatTransferCoeffModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace heatTransferCoeffModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class localReferenceTemperature Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class localReferenceTemperature
|
||||
:
|
||||
public heatTransferCoeffModel
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow copy construct
|
||||
localReferenceTemperature(const localReferenceTemperature&) = delete;
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const localReferenceTemperature&) = delete;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Set the heat transfer coefficient
|
||||
virtual void htc(volScalarField& htc);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("localReferenceTemperature");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
localReferenceTemperature
|
||||
(
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh,
|
||||
const word& TName
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~localReferenceTemperature()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Read from dictionary
|
||||
virtual bool read(const dictionary& dict);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace heatTransferCoeffModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -85,7 +85,7 @@ void Foam::functionObjects::wallHeatFlux::calcHeatFlux
|
||||
|
||||
forAll(wallHeatFluxBf, patchi)
|
||||
{
|
||||
wallHeatFluxBf[patchi] += radHeatFluxBf[patchi];
|
||||
wallHeatFluxBf[patchi] -= radHeatFluxBf[patchi];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,10 +76,10 @@ Foam::Cloud<ParticleType>::Cloud
|
||||
:
|
||||
cloud(pMesh, cloudName),
|
||||
IDLList<ParticleType>(),
|
||||
geometryType_(IOPosition<Cloud<ParticleType>>::geometryType::COORDINATES),
|
||||
polyMesh_(pMesh),
|
||||
labels_(),
|
||||
globalPositionsPtr_()
|
||||
globalPositionsPtr_(),
|
||||
geometryType_(IOPosition<Cloud<ParticleType>>::geometryType::COORDINATES)
|
||||
{
|
||||
checkPatches();
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -75,9 +75,6 @@ class Cloud
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Geometry type
|
||||
typename IOPosition<Cloud<ParticleType>>::geometryType geometryType_;
|
||||
|
||||
//- Reference to the mesh database
|
||||
const polyMesh& polyMesh_;
|
||||
|
||||
@ -109,6 +106,12 @@ class Cloud
|
||||
void writeCloudUniformProperties() const;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
//- Geometry type
|
||||
typename IOPosition<Cloud<ParticleType>>::geometryType geometryType_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
friend class particle;
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -167,10 +167,10 @@ Foam::Cloud<ParticleType>::Cloud
|
||||
)
|
||||
:
|
||||
cloud(pMesh, cloudName),
|
||||
geometryType_(IOPosition<Cloud<ParticleType>>::geometryType::COORDINATES),
|
||||
polyMesh_(pMesh),
|
||||
labels_(),
|
||||
cellWallFacesPtr_()
|
||||
cellWallFacesPtr_(),
|
||||
geometryType_(IOPosition<Cloud<ParticleType>>::geometryType::COORDINATES)
|
||||
{
|
||||
checkPatches();
|
||||
|
||||
|
||||
@ -38,6 +38,7 @@ namespace Foam
|
||||
Foam::injectedParticle::injectedParticle(const injectedParticle& p)
|
||||
:
|
||||
particle(p),
|
||||
position_(p.position_),
|
||||
tag_(p.tag_),
|
||||
soi_(p.soi_),
|
||||
d_(p.d_),
|
||||
@ -52,6 +53,7 @@ Foam::injectedParticle::injectedParticle
|
||||
)
|
||||
:
|
||||
particle(p, mesh),
|
||||
position_(p.position_),
|
||||
tag_(p.tag_),
|
||||
soi_(p.soi_),
|
||||
d_(p.d_),
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -25,11 +25,18 @@ Class
|
||||
Foam::injectedParticle
|
||||
|
||||
Description
|
||||
Primarly stores particle properties so that it can be injected at a later
|
||||
time. Note that this stores its own local position as opposed to the
|
||||
base particle class barycentric coordinates since the particle is not
|
||||
(usually) attached to a mesh, and instead used for post-processing.
|
||||
|
||||
SourceFiles
|
||||
injectedParticle.C
|
||||
injectedParticleIO.C
|
||||
|
||||
SeeAlso
|
||||
Foam::functionObjects::extractEulerianParticles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef injectedParticle_H
|
||||
@ -74,6 +81,9 @@ protected:
|
||||
|
||||
// Particle properties
|
||||
|
||||
//- Position
|
||||
point position_;
|
||||
|
||||
//- Tag
|
||||
label tag_;
|
||||
|
||||
@ -125,7 +135,8 @@ public:
|
||||
const label tag,
|
||||
const scalar soi,
|
||||
const scalar d,
|
||||
const vector& U
|
||||
const vector& U,
|
||||
const bool doLocate = true
|
||||
);
|
||||
|
||||
//- Construct from Istream
|
||||
@ -225,6 +236,11 @@ public:
|
||||
objectRegistry& obr
|
||||
);
|
||||
|
||||
//- Write the particle position and cell
|
||||
// Note: This uses the local particle position, and bypasses the
|
||||
// barycentric description
|
||||
virtual void writePosition(Ostream&) const;
|
||||
|
||||
|
||||
// Ostream Operator
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -41,6 +41,9 @@ Foam::injectedParticleCloud::injectedParticleCloud
|
||||
:
|
||||
Cloud<injectedParticle>(mesh, cloudName, false)
|
||||
{
|
||||
geometryType_ =
|
||||
IOPosition<Cloud<injectedParticle>>::geometryType::POSITIONS;
|
||||
|
||||
if (readFields)
|
||||
{
|
||||
injectedParticle::readFields(*this);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -33,10 +33,12 @@ inline Foam::injectedParticle::injectedParticle
|
||||
const label tag,
|
||||
const scalar soi,
|
||||
const scalar d,
|
||||
const vector& U
|
||||
const vector& U,
|
||||
const bool doLocate
|
||||
)
|
||||
:
|
||||
particle(mesh, position, -1),
|
||||
particle(mesh, position, -1, -1, -1, doLocate),
|
||||
position_(position),
|
||||
tag_(tag),
|
||||
soi_(soi),
|
||||
d_(d),
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -38,6 +38,7 @@ Foam::string Foam::injectedParticle::propertyTypes_ =
|
||||
|
||||
const std::size_t Foam::injectedParticle::sizeofFields
|
||||
(
|
||||
// Note: does not include position_
|
||||
sizeof(label) + sizeof(scalar) + sizeof(scalar) + sizeof(vector)
|
||||
);
|
||||
|
||||
@ -52,7 +53,8 @@ Foam::injectedParticle::injectedParticle
|
||||
bool newFormat
|
||||
)
|
||||
:
|
||||
particle(mesh, is, readFields, newFormat),
|
||||
particle(mesh, is, readFields, false), // force to read old positions file
|
||||
position_(Zero),
|
||||
tag_(-1),
|
||||
soi_(0.0),
|
||||
d_(0.0),
|
||||
@ -60,6 +62,11 @@ Foam::injectedParticle::injectedParticle
|
||||
{
|
||||
if (readFields)
|
||||
{
|
||||
// After the base particle class has read the fields from file and
|
||||
// constructed the necessary barcentric co-ordinates we can update the
|
||||
// particle position on this mesh
|
||||
position_ = particle::position();
|
||||
|
||||
if (is.format() == IOstream::ASCII)
|
||||
{
|
||||
tag_ = readLabel(is);
|
||||
@ -84,6 +91,8 @@ void Foam::injectedParticle::readFields(Cloud<injectedParticle>& c)
|
||||
return;
|
||||
}
|
||||
|
||||
// Note: not reading local position_ - defer to base particle class
|
||||
|
||||
particle::readFields(c);
|
||||
|
||||
IOField<label> tag(c.fieldIOobject("tag", IOobject::MUST_READ));
|
||||
@ -100,7 +109,7 @@ void Foam::injectedParticle::readFields(Cloud<injectedParticle>& c)
|
||||
|
||||
label i = 0;
|
||||
|
||||
forAllIter(Cloud<injectedParticle>, c, iter)
|
||||
forAllIters(c, iter)
|
||||
{
|
||||
injectedParticle& p = iter();
|
||||
|
||||
@ -116,8 +125,14 @@ void Foam::injectedParticle::readFields(Cloud<injectedParticle>& c)
|
||||
|
||||
void Foam::injectedParticle::writeFields(const Cloud<injectedParticle>& c)
|
||||
{
|
||||
// Force writing positions instead of coordinates
|
||||
particle::writeLagrangianCoordinates = false;
|
||||
particle::writeLagrangianPositions = true;
|
||||
|
||||
particle::writeFields(c);
|
||||
|
||||
// Note: not writing local position_ - defer to base particle class
|
||||
|
||||
label np = c.size();
|
||||
|
||||
IOField<label> tag(c.fieldIOobject("tag", IOobject::NO_READ), np);
|
||||
@ -127,7 +142,7 @@ void Foam::injectedParticle::writeFields(const Cloud<injectedParticle>& c)
|
||||
|
||||
label i = 0;
|
||||
|
||||
forAllConstIter(Cloud<injectedParticle>, c, iter)
|
||||
forAllConstIters(c, iter)
|
||||
{
|
||||
const injectedParticle& p = iter();
|
||||
|
||||
@ -152,6 +167,10 @@ void Foam::injectedParticle::writeObjects
|
||||
objectRegistry& obr
|
||||
)
|
||||
{
|
||||
// Force writing positions instead of coordinates
|
||||
particle::writeLagrangianCoordinates = false;
|
||||
particle::writeLagrangianPositions = true;
|
||||
|
||||
particle::writeObjects(c, obr);
|
||||
|
||||
label np = c.size();
|
||||
@ -163,7 +182,7 @@ void Foam::injectedParticle::writeObjects
|
||||
|
||||
label i = 0;
|
||||
|
||||
forAllConstIter(Cloud<injectedParticle>, c, iter)
|
||||
forAllConstIters(c, iter)
|
||||
{
|
||||
const injectedParticle& p = iter();
|
||||
|
||||
@ -177,6 +196,40 @@ void Foam::injectedParticle::writeObjects
|
||||
}
|
||||
|
||||
|
||||
void Foam::injectedParticle::writePosition(Ostream& os) const
|
||||
{
|
||||
if (os.format() == IOstream::ASCII)
|
||||
{
|
||||
os << position_ << token::SPACE << cell();
|
||||
}
|
||||
else
|
||||
{
|
||||
struct oldParticle
|
||||
{
|
||||
vector position;
|
||||
label celli;
|
||||
label facei;
|
||||
scalar stepFraction;
|
||||
label tetFacei;
|
||||
label tetPti;
|
||||
label origProc;
|
||||
label origId;
|
||||
} p;
|
||||
|
||||
const size_t s =
|
||||
offsetof(oldParticle, facei) - offsetof(oldParticle, position);
|
||||
|
||||
p.position = position_;
|
||||
p.celli = cell();
|
||||
|
||||
os.write(reinterpret_cast<const char*>(&p.position), s);
|
||||
}
|
||||
|
||||
// Check state of Ostream
|
||||
os.check(FUNCTION_NAME);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<
|
||||
@ -185,6 +238,8 @@ Foam::Ostream& Foam::operator<<
|
||||
const injectedParticle& p
|
||||
)
|
||||
{
|
||||
// Note: not writing local position_ - defer to base particle class
|
||||
|
||||
if (os.format() == IOstream::ASCII)
|
||||
{
|
||||
os << static_cast<const particle&>(p)
|
||||
|
||||
@ -37,6 +37,10 @@ Foam::label Foam::particle::particleCount_ = 0;
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(particle, 0);
|
||||
bool particle::writeLagrangianCoordinates
|
||||
(
|
||||
debug::infoSwitch("writeLagrangianCoordinates", 1)
|
||||
);
|
||||
bool particle::writeLagrangianPositions
|
||||
(
|
||||
debug::infoSwitch("writeLagrangianPositions", 0)
|
||||
@ -388,7 +392,7 @@ void Foam::particle::changeFace(const label tetTriI)
|
||||
tetFacei_ = newFaceI;
|
||||
tetPti_ = edgeI;
|
||||
|
||||
// Exit the loop now that the the tet point has been found
|
||||
// Exit the loop now that the tet point has been found
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -87,9 +87,6 @@ class particle
|
||||
{
|
||||
// Private member data
|
||||
|
||||
//- Write particle positions file (v1706 format and earlier)
|
||||
static bool writeLagrangianPositions;
|
||||
|
||||
//- Size in bytes of the position data
|
||||
static const std::size_t sizeofPosition;
|
||||
|
||||
@ -335,8 +332,8 @@ public:
|
||||
//- String representation of properties
|
||||
DefinePropertyList
|
||||
(
|
||||
"(Px Py Pz) celli tetFacei tetPti "
|
||||
"facei stepFraction origProc origId"
|
||||
"(coordinatesa coordinatesb coordinatesc coordinatesd) "
|
||||
"celli tetFacei tetPti facei stepFraction origProc origId"
|
||||
);
|
||||
|
||||
//- String representation of property types
|
||||
@ -348,6 +345,14 @@ public:
|
||||
//- Cumulative particle counter - used to provide unique ID
|
||||
static label particleCount_;
|
||||
|
||||
//- Write particle coordinates file (v1712 and later)
|
||||
//- Default is true
|
||||
static bool writeLagrangianCoordinates;
|
||||
|
||||
//- Write particle positions file (v1706 format and earlier)
|
||||
//- Default is false
|
||||
static bool writeLagrangianPositions;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
@ -685,7 +690,7 @@ public:
|
||||
void writeCoordinates(Ostream&) const;
|
||||
|
||||
//- Write the particle position and cell
|
||||
void writePosition(Ostream&) const;
|
||||
virtual void writePosition(Ostream&) const;
|
||||
|
||||
|
||||
// Friend Operators
|
||||
|
||||
@ -72,6 +72,7 @@ void Foam::particle::writeFields(const TrackCloudType& c)
|
||||
{
|
||||
label np = c.size();
|
||||
|
||||
if (writeLagrangianCoordinates)
|
||||
{
|
||||
IOPosition<TrackCloudType> ioP(c);
|
||||
ioP.write(np > 0);
|
||||
|
||||
@ -220,7 +220,7 @@ void Foam::PairCollision<CloudType>::wallInteraction()
|
||||
typename CloudType::parcelType& p =
|
||||
*cellOccupancy[realCelli][cellParticleI];
|
||||
|
||||
const point& pos = p.position();
|
||||
const point pos(p.position());
|
||||
|
||||
scalar r = wallModel_->pREff(p);
|
||||
|
||||
|
||||
@ -292,7 +292,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
|
||||
continue;
|
||||
}
|
||||
|
||||
const point& pP = pPtr->position();
|
||||
const point pP(pPtr->position());
|
||||
const vector& pU = pPtr->U();
|
||||
|
||||
// Generate a tetrahedron of new positions with the
|
||||
|
||||
@ -93,7 +93,7 @@ Foam::forceSuSp Foam::SRFForce<CloudType>::calcNonCoupled
|
||||
|
||||
const vector& omega = srf.omega().value();
|
||||
|
||||
const vector& r = p.position();
|
||||
const vector r(p.position());
|
||||
|
||||
// Coriolis and centrifugal acceleration terms
|
||||
value.Su() =
|
||||
|
||||
@ -172,7 +172,7 @@ void Foam::SprayParcel<ParcelType>::calcAtomization
|
||||
|
||||
scalar soi = cloud.injectors().timeStart();
|
||||
scalar currentTime = cloud.db().time().value();
|
||||
const vector& pos = this->position();
|
||||
const vector pos(this->position());
|
||||
const vector& injectionPos = this->position0();
|
||||
|
||||
// Disregard the continous phase when calculating the relative velocity
|
||||
|
||||
@ -50,15 +50,15 @@ bool Foam::TrajectoryCollision<CloudType>::collideParcels
|
||||
{
|
||||
bool coalescence = false;
|
||||
|
||||
const vector& pos1 = p1.position();
|
||||
const vector& pos2 = p2.position();
|
||||
const vector pos1(p1.position());
|
||||
const vector pos2(p2.position());
|
||||
|
||||
const vector& U1 = p1.U();
|
||||
const vector& U2 = p2.U();
|
||||
|
||||
vector URel = U1 - U2;
|
||||
vector URel(U1 - U2);
|
||||
|
||||
vector d = pos2 - pos1;
|
||||
vector d(pos2 - pos1);
|
||||
scalar magd = mag(d);
|
||||
|
||||
scalar vAlign = URel & (d/(magd + ROOTVSMALL));
|
||||
|
||||
@ -29,20 +29,20 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::complexField> fft::realTransform1D(const scalarField& field)
|
||||
Foam::tmp<Foam::complexField>
|
||||
Foam::fft::realTransform1D(const scalarField& field)
|
||||
{
|
||||
const label n = field.size();
|
||||
const label nBy2 = n/2;
|
||||
|
||||
// Copy of input field for use by fftw
|
||||
// - fftw requires non-const access to input and output...
|
||||
scalar in[n], out[n];
|
||||
forAll(field, i)
|
||||
// - require non-const access to input and output
|
||||
// - use double to avoid additional libfftwf for single-precision
|
||||
|
||||
List<double> in(n);
|
||||
List<double> out(n);
|
||||
|
||||
for (label i=0; i < n; ++i)
|
||||
{
|
||||
in[i] = field[i];
|
||||
}
|
||||
@ -51,8 +51,8 @@ Foam::tmp<Foam::complexField> fft::realTransform1D(const scalarField& field)
|
||||
fftw_plan plan = fftw_plan_r2r_1d
|
||||
(
|
||||
n,
|
||||
in,
|
||||
out,
|
||||
in.data(),
|
||||
out.data(),
|
||||
FFTW_R2HC,
|
||||
FFTW_ESTIMATE
|
||||
);
|
||||
@ -77,7 +77,7 @@ Foam::tmp<Foam::complexField> fft::realTransform1D(const scalarField& field)
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::complexField> fft::realTransform1D
|
||||
Foam::tmp<Foam::complexField> Foam::fft::realTransform1D
|
||||
(
|
||||
const tmp<scalarField>& tfield
|
||||
)
|
||||
@ -88,7 +88,7 @@ Foam::tmp<Foam::complexField> fft::realTransform1D
|
||||
}
|
||||
|
||||
|
||||
void fft::transform
|
||||
void Foam::fft::transform
|
||||
(
|
||||
complexField& field,
|
||||
const UList<int>& nn,
|
||||
@ -110,7 +110,7 @@ void fft::transform
|
||||
}
|
||||
|
||||
// Copy field into fftw containers
|
||||
label N = field.size();
|
||||
const label N = field.size();
|
||||
fftw_complex in[N], out[N];
|
||||
|
||||
forAll(field, i)
|
||||
@ -128,7 +128,7 @@ void fft::transform
|
||||
// fftw_plan_dft_1d(N, in, out, FFTW_FORWARD, FFTW_ESTIMATE);
|
||||
|
||||
// Generic 1..3-D plan
|
||||
label rank = nn.size();
|
||||
const label rank = nn.size();
|
||||
fftw_plan plan =
|
||||
fftw_plan_dft(rank, nn.begin(), in, out, dir, FFTW_ESTIMATE);
|
||||
|
||||
@ -163,7 +163,7 @@ void fft::transform
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
tmp<complexField> fft::forwardTransform
|
||||
Foam::tmp<Foam::complexField> Foam::fft::forwardTransform
|
||||
(
|
||||
const tmp<complexField>& tfield,
|
||||
const UList<int>& nn
|
||||
@ -179,7 +179,7 @@ tmp<complexField> fft::forwardTransform
|
||||
}
|
||||
|
||||
|
||||
tmp<complexField> fft::reverseTransform
|
||||
Foam::tmp<Foam::complexField> Foam::fft::reverseTransform
|
||||
(
|
||||
const tmp<complexField>& tfield,
|
||||
const UList<int>& nn
|
||||
@ -195,7 +195,7 @@ tmp<complexField> fft::reverseTransform
|
||||
}
|
||||
|
||||
|
||||
tmp<complexVectorField> fft::forwardTransform
|
||||
Foam::tmp<Foam::complexVectorField> Foam::fft::forwardTransform
|
||||
(
|
||||
const tmp<complexVectorField>& tfield,
|
||||
const UList<int>& nn
|
||||
@ -224,7 +224,7 @@ tmp<complexVectorField> fft::forwardTransform
|
||||
}
|
||||
|
||||
|
||||
tmp<complexVectorField> fft::reverseTransform
|
||||
Foam::tmp<Foam::complexVectorField> Foam::fft::reverseTransform
|
||||
(
|
||||
const tmp<complexVectorField>& tfield,
|
||||
const UList<int>& nn
|
||||
@ -253,8 +253,4 @@ tmp<complexVectorField> fft::reverseTransform
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -285,8 +285,8 @@ Foam::tmp<Foam::scalarField> Foam::noiseFFT::Pf
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
List<scalar>& in = planInfo_.in;
|
||||
const List<scalar>& out = planInfo_.out;
|
||||
List<double>& in = planInfo_.in;
|
||||
const List<double>& out = planInfo_.out;
|
||||
forAll(in, i)
|
||||
{
|
||||
in[i] = pn[i];
|
||||
@ -305,8 +305,8 @@ Foam::tmp<Foam::scalarField> Foam::noiseFFT::Pf
|
||||
result[0] = out[0];
|
||||
for (label i = 1; i <= nBy2; ++i)
|
||||
{
|
||||
scalar re = out[i];
|
||||
scalar im = out[n - i];
|
||||
const auto re = out[i];
|
||||
const auto im = out[n - i];
|
||||
result[i] = sqrt(re*re + im*im);
|
||||
}
|
||||
|
||||
@ -443,7 +443,7 @@ Foam::graph Foam::noiseFFT::PSD(const graph& gPSDf) const
|
||||
Foam::graph Foam::noiseFFT::octaves
|
||||
(
|
||||
const graph& g,
|
||||
const labelList& freqBandIDs,
|
||||
const labelUList& freqBandIDs,
|
||||
bool integrate
|
||||
) const
|
||||
{
|
||||
|
||||
@ -68,13 +68,14 @@ class noiseFFT
|
||||
:
|
||||
public scalarField
|
||||
{
|
||||
//- FFTW planner information
|
||||
//- FFTW planner information.
|
||||
// Storage as double for use directly with FFTW.
|
||||
struct planInfo
|
||||
{
|
||||
bool active;
|
||||
label windowSize;
|
||||
scalarList in;
|
||||
scalarList out;
|
||||
List<double> in;
|
||||
List<double> out;
|
||||
fftw_plan plan;
|
||||
};
|
||||
|
||||
@ -174,7 +175,7 @@ public:
|
||||
graph octaves
|
||||
(
|
||||
const graph& g,
|
||||
const labelList& freqBandIDs,
|
||||
const labelUList& freqBandIDs,
|
||||
bool integrate
|
||||
) const;
|
||||
|
||||
|
||||
@ -787,6 +787,12 @@ bool Foam::sampledTriSurfaceMesh::update()
|
||||
{
|
||||
// Surface and mesh do not overlap at all. Guarantee a valid
|
||||
// bounding box so we don't get any 'invalid bounding box' errors.
|
||||
|
||||
WarningInFunction
|
||||
<< "Surface " << surface_.searchableSurface::name()
|
||||
<< " does not overlap bounding box of mesh " << mesh().bounds()
|
||||
<< endl;
|
||||
|
||||
bb = treeBoundBox(mesh().bounds());
|
||||
const vector span(bb.span());
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@ waveGenerationModels/derived/Boussinesq/BoussinesqWaveModel.C
|
||||
waveGenerationModels/derived/cnoidal/cnoidalWaveModel.C
|
||||
waveGenerationModels/derived/Grimshaw/GrimshawWaveModel.C
|
||||
waveGenerationModels/derived/McCowan/McCowanWaveModel.C
|
||||
waveGenerationModels/derived/streamFunction/streamFunctionWaveModel.C
|
||||
waveGenerationModels/derived/StokesII/StokesIIWaveModel.C
|
||||
waveGenerationModels/derived/StokesI/StokesIWaveModel.C
|
||||
waveGenerationModels/derived/StokesV/StokesVWaveModel.C
|
||||
|
||||
@ -0,0 +1,256 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015 IH-Cantabria
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "streamFunctionWaveModel.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
using namespace Foam::constant;
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace waveModels
|
||||
{
|
||||
defineTypeNameAndDebug(streamFunction, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
waveModel,
|
||||
streamFunction,
|
||||
patch
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||
|
||||
Foam::scalar Foam::waveModels::streamFunction::eta
|
||||
(
|
||||
const scalar h,
|
||||
const scalar kx,
|
||||
const scalar ky,
|
||||
const scalar T,
|
||||
const scalar x,
|
||||
const scalar y,
|
||||
const scalar omega,
|
||||
const scalar t,
|
||||
const scalar phase
|
||||
) const
|
||||
{
|
||||
|
||||
const scalar k = sqrt(kx*kx + ky*ky);
|
||||
scalar strfnAux = 0.0;
|
||||
forAll(Ejs_, iterSF)
|
||||
{
|
||||
strfnAux +=
|
||||
Ejs_[iterSF]*cos((iterSF + 1)
|
||||
*(kx*x + ky*y - omega*t + phase));
|
||||
}
|
||||
|
||||
return (1/k)*strfnAux;
|
||||
}
|
||||
|
||||
Foam::vector Foam::waveModels::streamFunction::Uf
|
||||
(
|
||||
const scalar h,
|
||||
const scalar kx,
|
||||
const scalar ky,
|
||||
const scalar T,
|
||||
const scalar x,
|
||||
const scalar y,
|
||||
const scalar omega,
|
||||
const scalar t,
|
||||
const scalar phase,
|
||||
const scalar z
|
||||
) const
|
||||
{
|
||||
const scalar k = sqrt(kx*kx + ky*ky);
|
||||
const scalar phaseTot = kx*x + ky*y - omega*t + phase;
|
||||
|
||||
scalar u = 0.0;
|
||||
scalar w = 0.0;
|
||||
|
||||
forAll(Bjs_, iterSF2)
|
||||
{
|
||||
u +=
|
||||
(iterSF2 + 1)*Bjs_[iterSF2]*cosh((iterSF2 + 1)*k*z)
|
||||
/cosh((iterSF2 + 1)*k*h)*cos((iterSF2 + 1)*phaseTot);
|
||||
|
||||
w +=
|
||||
(iterSF2 + 1)*Bjs_[iterSF2]*sinh((iterSF2 + 1)*k*z)
|
||||
/cosh((iterSF2 + 1)*k*h)*sin((iterSF2 + 1)*phaseTot);
|
||||
}
|
||||
|
||||
u = waveLength_/T - uMean_ + sqrt(mag(g_)/k)*u;
|
||||
w = sqrt(mag(g_)/k)*w;
|
||||
|
||||
scalar v = u*sin(waveAngle_);
|
||||
u *= cos(waveAngle_);
|
||||
|
||||
return vector(u, v, w);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
|
||||
|
||||
void Foam::waveModels::streamFunction::setLevel
|
||||
(
|
||||
const scalar t,
|
||||
const scalar tCoeff,
|
||||
scalarField& level
|
||||
) const
|
||||
{
|
||||
const scalar waveOmega = mathematical::twoPi/wavePeriod_;
|
||||
const scalar waveK = mathematical::twoPi/waveLength_;
|
||||
const scalar waveKx = waveK*cos(waveAngle_);
|
||||
const scalar waveKy = waveK*sin(waveAngle_);
|
||||
|
||||
forAll(level, paddlei)
|
||||
{
|
||||
const scalar eta =
|
||||
this->eta
|
||||
(
|
||||
waterDepthRef_,
|
||||
waveKx,
|
||||
waveKy,
|
||||
wavePeriod_,
|
||||
xPaddle_[paddlei],
|
||||
yPaddle_[paddlei],
|
||||
waveOmega,
|
||||
t,
|
||||
wavePhase_
|
||||
);
|
||||
|
||||
level[paddlei] = waterDepthRef_ + tCoeff*eta;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::waveModels::streamFunction::setVelocity
|
||||
(
|
||||
const scalar t,
|
||||
const scalar tCoeff,
|
||||
const scalarField& level
|
||||
)
|
||||
{
|
||||
const scalar waveOmega = mathematical::twoPi/wavePeriod_;
|
||||
const scalar waveK = mathematical::twoPi/waveLength_;
|
||||
const scalar waveKx = waveK*cos(waveAngle_);
|
||||
const scalar waveKy = waveK*sin(waveAngle_);
|
||||
|
||||
forAll(U_, facei)
|
||||
{
|
||||
// Fraction of geometry represented by paddle - to be set
|
||||
scalar fraction = 1;
|
||||
|
||||
// Height - to be set
|
||||
scalar z = 0;
|
||||
|
||||
setPaddlePropeties(level, facei, fraction, z);
|
||||
|
||||
if (fraction > 0)
|
||||
{
|
||||
const label paddlei = faceToPaddle_[facei];
|
||||
|
||||
const vector Uf = this->Uf
|
||||
(
|
||||
waterDepthRef_,
|
||||
waveKx,
|
||||
waveKy,
|
||||
wavePeriod_,
|
||||
xPaddle_[paddlei],
|
||||
yPaddle_[paddlei],
|
||||
waveOmega,
|
||||
t,
|
||||
wavePhase_,
|
||||
z
|
||||
);
|
||||
|
||||
U_[facei] = fraction*Uf*tCoeff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::waveModels::streamFunction::streamFunction
|
||||
(
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh,
|
||||
const polyPatch& patch,
|
||||
const bool readFields
|
||||
)
|
||||
:
|
||||
regularWaveModel(dict, mesh, patch, false),
|
||||
uMean_(0),
|
||||
Bjs_(),
|
||||
Ejs_()
|
||||
{
|
||||
if (readFields)
|
||||
{
|
||||
readDict(dict);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::waveModels::streamFunction::~streamFunction()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::waveModels::streamFunction::readDict(const dictionary& overrideDict)
|
||||
{
|
||||
if (regularWaveModel::readDict(overrideDict))
|
||||
{
|
||||
overrideDict.lookup("uMean") >> uMean_;
|
||||
overrideDict.lookup("waveLength") >> waveLength_;
|
||||
overrideDict.lookup("Bjs") >> Bjs_;
|
||||
overrideDict.lookup("Ejs") >> Ejs_;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void Foam::waveModels::streamFunction::info(Ostream& os) const
|
||||
{
|
||||
regularWaveModel::info(os);
|
||||
|
||||
os << " uMean : " << uMean_ << nl
|
||||
<< " Stream function wavelength : " << waveLength_ << nl
|
||||
<< " Bj coefficients : " << Bjs_ << nl
|
||||
<< " Ej coefficients : " << Ejs_ << nl;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,157 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015 IH-Cantabria
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::waveModels::streamFunction
|
||||
|
||||
Description
|
||||
streamFunction wave model
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef waveModels_streamFunction_H
|
||||
#define waveModels_streamFunction_H
|
||||
|
||||
#include "regularWaveModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace waveModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class streamFunction Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class streamFunction
|
||||
:
|
||||
public regularWaveModel
|
||||
{
|
||||
private:
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Wave height
|
||||
virtual scalar eta
|
||||
(
|
||||
const scalar h,
|
||||
const scalar kx,
|
||||
const scalar ky,
|
||||
const scalar T,
|
||||
const scalar x,
|
||||
const scalar y,
|
||||
const scalar omega,
|
||||
const scalar t,
|
||||
const scalar phase
|
||||
) const;
|
||||
|
||||
//- Wave velocity
|
||||
virtual vector Uf
|
||||
(
|
||||
const scalar d,
|
||||
const scalar kx,
|
||||
const scalar ky,
|
||||
const scalar T,
|
||||
const scalar x,
|
||||
const scalar y,
|
||||
const scalar omega,
|
||||
const scalar t,
|
||||
const scalar phase,
|
||||
const scalar z
|
||||
) const;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Mean fluid speed in frame of reference (stream function)
|
||||
scalar uMean_;
|
||||
|
||||
//- Stream Function Bj coefficients
|
||||
scalarList Bjs_;
|
||||
|
||||
//- Stream Function Ej coefficients
|
||||
scalarList Ejs_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
|
||||
//- Set the water level
|
||||
virtual void setLevel
|
||||
(
|
||||
const scalar t,
|
||||
const scalar tCoeff,
|
||||
scalarField& level
|
||||
) const;
|
||||
|
||||
//- Calculate the wave model velocity
|
||||
virtual void setVelocity
|
||||
(
|
||||
const scalar t,
|
||||
const scalar tCoeff,
|
||||
const scalarField& level
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("streamFunction");
|
||||
|
||||
//- Constructor
|
||||
streamFunction
|
||||
(
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh,
|
||||
const polyPatch& patch,
|
||||
const bool readFields = true
|
||||
);
|
||||
|
||||
//- Destructor
|
||||
virtual ~streamFunction();
|
||||
|
||||
|
||||
// Public Member Functions
|
||||
|
||||
//- Read from dictionary
|
||||
virtual bool readDict(const dictionary& overrideDict);
|
||||
|
||||
//- Info
|
||||
virtual void info(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace waveModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,18 +1,11 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/bin/tools/LogFunctions # Tutorial log-file functions
|
||||
|
||||
echo "--------"
|
||||
removeLogs
|
||||
|
||||
echo "Cleaning tutorials ..."
|
||||
echo "Removing backup files"
|
||||
|
||||
find . \( \
|
||||
-name '*~' -o -name '*.bak' \
|
||||
-name core -o -name 'core.[1-9]*' \
|
||||
-name '*.pvs' -o -name '*.OpenFOAM' \
|
||||
\) -type f -delete
|
||||
|
||||
rm -f logs testLoopReport > /dev/null 2>&1
|
||||
|
||||
foamCleanTutorials cases
|
||||
|
||||
echo "--------"
|
||||
|
||||
113
tutorials/Allrun
113
tutorials/Allrun
@ -7,26 +7,14 @@
|
||||
# \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# Allrun
|
||||
#
|
||||
# Description
|
||||
# Runs tutorial cases and summarizes the outcome as 'testLoopReport'
|
||||
# Run tutorial cases and summarize the outcome as 'testLoopReport'
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
@ -43,27 +31,26 @@ options:
|
||||
-collect Collect logs only. Can be useful for aborted runs.
|
||||
-help print the usage
|
||||
|
||||
* Runs tutorial cases and summarizes the outcome as 'testLoopReport'
|
||||
Run tutorial cases and summarize the outcome as 'testLoopReport'
|
||||
|
||||
USAGE
|
||||
exit 1
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
unset optCollect
|
||||
|
||||
unset optCollectOnly
|
||||
|
||||
# parse options
|
||||
# Parse options
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
-h | -help)
|
||||
-h | -help*)
|
||||
usage
|
||||
;;
|
||||
-collect)
|
||||
optCollectOnly=true
|
||||
optCollect=true
|
||||
;;
|
||||
-test) # Known options that should be passed through
|
||||
-test) # Known options to pass through
|
||||
break
|
||||
;;
|
||||
-*)
|
||||
@ -77,87 +64,13 @@ do
|
||||
done
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
. $WM_PROJECT_DIR/bin/tools/LogFunctions # Tutorial log-file functions
|
||||
|
||||
# logReport <logfile>
|
||||
# Extracts useful info from log file.
|
||||
logReport()
|
||||
{
|
||||
local logfile=$1
|
||||
|
||||
# logfile is path/to/case/log.application
|
||||
caseName=$(dirname $logfile | sed -e 's/\(.*\)\.\///g')
|
||||
app=$(echo $logfile | sed -e 's/\(.*\)log\.//g')
|
||||
appAndCase="Application $app - case $caseName"
|
||||
|
||||
if grep -q "FOAM FATAL" $logfile
|
||||
if [ -z "$optCollect" ]
|
||||
then
|
||||
echo "$appAndCase: ** FOAM FATAL ERROR **"
|
||||
return 1
|
||||
foamRunTutorials -skipFirst $* # Run tutorials recursively
|
||||
fi
|
||||
|
||||
# Check for solution singularity on U equation
|
||||
for eqn in Ux Uy Uz
|
||||
do
|
||||
if grep -q -E "${eqn}[:| ]*solution singularity" $logfile
|
||||
then
|
||||
if [ "$eqn" = Uz ]
|
||||
then
|
||||
# Can only get here if Ux,Uy,Uz all failed
|
||||
echo "$appAndCase: ** Solution singularity **"
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if grep -q -E "^[\t ]*[Ee]nd" $logfile
|
||||
then
|
||||
# Extract time from this type of content
|
||||
## ExecutionTime = 60.2 s ClockTime = 63 s --> "60.2 s"
|
||||
completionTime=$(tail -10 $logfile | \
|
||||
sed -n -e '/Execution/{s/^[^=]*=[ \t]*//; s/\( s\) .*$/\1/; p}')
|
||||
|
||||
echo "$appAndCase: completed${completionTime:+ in }$completionTime"
|
||||
else
|
||||
echo "$appAndCase: unconfirmed completion"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ -z "$optCollectOnly" ]
|
||||
then
|
||||
# Recursively run all tutorials
|
||||
foamRunTutorials -skipFirst $*
|
||||
fi
|
||||
|
||||
|
||||
# Analyse all log files
|
||||
echo "Collecting log files..." 1>&2
|
||||
rm -f logs testLoopReport > /dev/null 2>&1
|
||||
touch logs testLoopReport
|
||||
|
||||
for appDir in *
|
||||
do
|
||||
[ -d $appDir ] || continue
|
||||
echo -n " $appDir..." 1>&2
|
||||
|
||||
logs=$(find -L $appDir -name 'log.*' -type f)
|
||||
if [ -n "$logs" ]
|
||||
then
|
||||
echo 1>&2
|
||||
else
|
||||
echo " (no logs)" 1>&2
|
||||
continue
|
||||
fi
|
||||
|
||||
# Sort logs by time-stamp
|
||||
for log in $(echo $logs | xargs ls -rt)
|
||||
do
|
||||
# Concatenate and summarize logs
|
||||
cat "$log" >> logs 2>/dev/null
|
||||
logReport $log
|
||||
done
|
||||
echo
|
||||
done > testLoopReport
|
||||
collectLogs
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -23,7 +23,7 @@ startTime 0;
|
||||
|
||||
stopAt endTime;
|
||||
|
||||
endTime 0.01;
|
||||
endTime 0.0027;
|
||||
|
||||
deltaT 4e-08;
|
||||
|
||||
|
||||
@ -1,212 +0,0 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: plus |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class faBoundaryMesh;
|
||||
location "constant/faMesh";
|
||||
object faBoundary;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
3
|
||||
(
|
||||
inlet
|
||||
{
|
||||
type patch;
|
||||
edgeLabels List<label>
|
||||
20
|
||||
(
|
||||
2321
|
||||
2322
|
||||
2323
|
||||
2324
|
||||
2325
|
||||
2326
|
||||
2327
|
||||
2328
|
||||
2329
|
||||
2330
|
||||
2331
|
||||
2332
|
||||
2333
|
||||
2334
|
||||
2335
|
||||
2336
|
||||
2337
|
||||
2338
|
||||
2339
|
||||
2341
|
||||
)
|
||||
;
|
||||
ngbPolyPatchIndex 0;
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
edgeLabels List<label>
|
||||
20
|
||||
(
|
||||
2459
|
||||
2460
|
||||
2461
|
||||
2462
|
||||
2463
|
||||
2464
|
||||
2465
|
||||
2466
|
||||
2467
|
||||
2468
|
||||
2469
|
||||
2470
|
||||
2471
|
||||
2472
|
||||
2473
|
||||
2474
|
||||
2475
|
||||
2476
|
||||
2477
|
||||
2478
|
||||
)
|
||||
;
|
||||
ngbPolyPatchIndex 2;
|
||||
}
|
||||
bound
|
||||
{
|
||||
type symmetry;
|
||||
edgeLabels List<label>
|
||||
120
|
||||
(
|
||||
2320
|
||||
2340
|
||||
2342
|
||||
2343
|
||||
2344
|
||||
2345
|
||||
2346
|
||||
2347
|
||||
2348
|
||||
2349
|
||||
2350
|
||||
2351
|
||||
2352
|
||||
2353
|
||||
2354
|
||||
2355
|
||||
2356
|
||||
2357
|
||||
2358
|
||||
2359
|
||||
2360
|
||||
2361
|
||||
2362
|
||||
2363
|
||||
2364
|
||||
2365
|
||||
2366
|
||||
2367
|
||||
2368
|
||||
2369
|
||||
2370
|
||||
2371
|
||||
2372
|
||||
2373
|
||||
2374
|
||||
2375
|
||||
2376
|
||||
2377
|
||||
2378
|
||||
2379
|
||||
2380
|
||||
2381
|
||||
2382
|
||||
2383
|
||||
2384
|
||||
2385
|
||||
2386
|
||||
2387
|
||||
2388
|
||||
2389
|
||||
2390
|
||||
2391
|
||||
2392
|
||||
2393
|
||||
2394
|
||||
2395
|
||||
2396
|
||||
2397
|
||||
2398
|
||||
2399
|
||||
2400
|
||||
2401
|
||||
2402
|
||||
2403
|
||||
2404
|
||||
2405
|
||||
2406
|
||||
2407
|
||||
2408
|
||||
2409
|
||||
2410
|
||||
2411
|
||||
2412
|
||||
2413
|
||||
2414
|
||||
2415
|
||||
2416
|
||||
2417
|
||||
2418
|
||||
2419
|
||||
2420
|
||||
2421
|
||||
2422
|
||||
2423
|
||||
2424
|
||||
2425
|
||||
2426
|
||||
2427
|
||||
2428
|
||||
2429
|
||||
2430
|
||||
2431
|
||||
2432
|
||||
2433
|
||||
2434
|
||||
2435
|
||||
2436
|
||||
2437
|
||||
2438
|
||||
2439
|
||||
2440
|
||||
2441
|
||||
2442
|
||||
2443
|
||||
2444
|
||||
2445
|
||||
2446
|
||||
2447
|
||||
2448
|
||||
2449
|
||||
2450
|
||||
2451
|
||||
2452
|
||||
2453
|
||||
2454
|
||||
2455
|
||||
2456
|
||||
2457
|
||||
2458
|
||||
2479
|
||||
)
|
||||
;
|
||||
ngbPolyPatchIndex 1;
|
||||
}
|
||||
)
|
||||
|
||||
// ************************************************************************* //
|
||||
File diff suppressed because it is too large
Load Diff
@ -36,6 +36,9 @@ divSchemes
|
||||
div((phi+meshPhi),p) Gauss linear;
|
||||
|
||||
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
|
||||
|
||||
div(phi,thermo:rho.water) Gauss linear;
|
||||
div(phi,thermo:rho.air) Gauss linear;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
|
||||
@ -21,7 +21,7 @@ solvers
|
||||
{
|
||||
nAlphaCorr 1;
|
||||
nAlphaSubCycles 3;
|
||||
cAlpha 1.5;
|
||||
cAlpha 1;
|
||||
}
|
||||
|
||||
".*(rho|rhoFinal)"
|
||||
|
||||
@ -27,14 +27,16 @@ copyLagrangianData()
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dir=$dir/${latestTime}/lagrangian
|
||||
udir=$dir/${latestTime}/uniform/lagrangian
|
||||
ldir=$dir/${latestTime}/lagrangian
|
||||
|
||||
if [ -d $dir ]
|
||||
then
|
||||
echo "Copying lagrangian data from $dir to 0 directory"
|
||||
\cp -r $dir 0
|
||||
echo "Copying lagrangian data from $ldir to 0 directory"
|
||||
\cp -r $ldir 0
|
||||
mkdir 0/uniform && \cp -r $udir 0/uniform
|
||||
else
|
||||
echo "Error: unable to find Lagrangian data in case $dir"
|
||||
echo "Error: unable to find Lagrangian data in case $ldir"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
@ -46,10 +48,12 @@ copyLagrangianData ${eulerianCase}
|
||||
|
||||
runApplication blockMesh
|
||||
|
||||
runApplication decomposePar
|
||||
#runApplication decomposePar
|
||||
|
||||
runParallel $(getApplication)
|
||||
#runParallel $(getApplication)
|
||||
|
||||
runApplication reconstructPar
|
||||
#runApplication reconstructPar
|
||||
|
||||
runApplication $(getApplication)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -27,14 +27,16 @@ copyLagrangianData()
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dir=$dir/${latestTime}/lagrangian
|
||||
udir=$dir/${latestTime}/uniform/lagrangian
|
||||
ldir=$dir/${latestTime}/lagrangian
|
||||
|
||||
if [ -d $dir ]
|
||||
then
|
||||
echo "Copying lagrangian data from $dir to 0 directory"
|
||||
\cp -r $dir 0
|
||||
echo "Copying lagrangian data from $ldir to 0 directory"
|
||||
\cp -r $ldir 0
|
||||
mkdir 0/uniform && \cp -r $udir 0/uniform
|
||||
else
|
||||
echo "Error: unable to find Lagrangian data in case $dir"
|
||||
echo "Error: unable to find Lagrangian data in case $ldir"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
@ -46,10 +48,13 @@ copyLagrangianData ${eulerianCase}
|
||||
|
||||
runApplication blockMesh
|
||||
|
||||
runApplication decomposePar
|
||||
#runApplication decomposePar
|
||||
|
||||
runParallel $(getApplication)
|
||||
#runParallel $(getApplication)
|
||||
|
||||
#runApplication reconstructPar
|
||||
|
||||
runApplication $(getApplication)
|
||||
|
||||
runApplication reconstructPar
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -0,0 +1,54 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: plus |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volVectorField;
|
||||
location "0";
|
||||
object U;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 1 -1 0 0 0 0];
|
||||
|
||||
internalField uniform (0 0 0);
|
||||
|
||||
boundaryField
|
||||
{
|
||||
inlet
|
||||
{
|
||||
type waveVelocity;
|
||||
value uniform (0 0 0);
|
||||
}
|
||||
|
||||
outlet
|
||||
{
|
||||
type waveVelocity;
|
||||
value uniform (0 0 0);
|
||||
}
|
||||
|
||||
sides
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
|
||||
ground
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform (0 0 0);
|
||||
}
|
||||
|
||||
top
|
||||
{
|
||||
type pressureInletOutletVelocity;
|
||||
value uniform (0 0 0);
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,52 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: plus |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
object alpha.water;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 0 0 0 0 0 0];
|
||||
|
||||
internalField uniform 0;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
inlet
|
||||
{
|
||||
type waveAlpha;
|
||||
value uniform 0;
|
||||
}
|
||||
|
||||
outlet
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
|
||||
ground
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
|
||||
sides
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
|
||||
top
|
||||
{
|
||||
type inletOutlet;
|
||||
inletValue uniform 0;
|
||||
value uniform 0;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,54 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: plus |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
object p_rgh;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [1 -1 -2 0 0 0 0];
|
||||
|
||||
internalField uniform 0;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
inlet
|
||||
{
|
||||
type fixedFluxPressure;
|
||||
value uniform 0;
|
||||
}
|
||||
|
||||
outlet
|
||||
{
|
||||
type fixedFluxPressure;
|
||||
value uniform 0;
|
||||
}
|
||||
|
||||
ground
|
||||
{
|
||||
type fixedFluxPressure;
|
||||
value uniform 0;
|
||||
}
|
||||
|
||||
sides
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
|
||||
top
|
||||
{
|
||||
type totalPressure;
|
||||
p0 uniform 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
10
tutorials/multiphase/interFoam/laminar/waveExampleStreamFunction/Allclean
Executable file
10
tutorials/multiphase/interFoam/laminar/waveExampleStreamFunction/Allclean
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
rm -rf 0
|
||||
|
||||
cleanCase
|
||||
|
||||
15
tutorials/multiphase/interFoam/laminar/waveExampleStreamFunction/Allrun
Executable file
15
tutorials/multiphase/interFoam/laminar/waveExampleStreamFunction/Allrun
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
restore0Dir
|
||||
|
||||
runApplication blockMesh
|
||||
|
||||
runApplication decomposePar
|
||||
|
||||
runParallel setFields
|
||||
|
||||
runParallel $(getApplication)
|
||||
@ -0,0 +1,22 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: plus |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class uniformDimensionedVectorField;
|
||||
location "constant";
|
||||
object g;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 1 -2 0 0 0 0];
|
||||
value ( 0 0 -9.81 );
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,37 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: plus |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "constant";
|
||||
object transportProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
phases (water air);
|
||||
|
||||
water
|
||||
{
|
||||
transportModel Newtonian;
|
||||
nu 1e-06;
|
||||
rho 1000;
|
||||
}
|
||||
|
||||
air
|
||||
{
|
||||
transportModel Newtonian;
|
||||
nu 1.48e-05;
|
||||
rho 1;
|
||||
}
|
||||
|
||||
sigma 0.07;
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,20 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: plus |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "constant";
|
||||
object turbulenceProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
simulationType laminar;
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,80 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: plus |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "constant";
|
||||
object wavesProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
inlet
|
||||
{
|
||||
alpha alpha.water;
|
||||
|
||||
waveModel streamFunction;
|
||||
|
||||
nPaddle 1;
|
||||
|
||||
waveHeight 0.1517;
|
||||
|
||||
waveAngle 0.0;
|
||||
|
||||
rampTime 6.034;
|
||||
|
||||
activeAbsorption yes;
|
||||
|
||||
wavePeriod 3.017;
|
||||
|
||||
uMean 2.0825;
|
||||
|
||||
waveLength 6.2832;
|
||||
|
||||
Bjs
|
||||
(
|
||||
8.6669014e-002
|
||||
2.4849799e-002
|
||||
7.7446850e-003
|
||||
2.3355420e-003
|
||||
6.4497731e-004
|
||||
1.5205114e-004
|
||||
2.5433769e-005
|
||||
-2.2045436e-007
|
||||
-2.8711504e-006
|
||||
-1.2287334e-006
|
||||
);
|
||||
|
||||
Ejs
|
||||
(
|
||||
5.6009609e-002
|
||||
3.1638171e-002
|
||||
1.5375952e-002
|
||||
7.1743178e-003
|
||||
3.3737077e-003
|
||||
1.6324880e-003
|
||||
8.2331980e-004
|
||||
4.4403497e-004
|
||||
2.7580059e-004
|
||||
2.2810557e-004
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
outlet
|
||||
{
|
||||
alpha alpha.water;
|
||||
|
||||
waveModel shallowWaterAbsorption;
|
||||
|
||||
nPaddle 1;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,91 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: plus |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
convertToMeters 1;
|
||||
|
||||
vertices
|
||||
(
|
||||
( 0.0 0.0 0.0)
|
||||
( 40.0 0.0 0.0)
|
||||
( 40.0 0.01 0.0)
|
||||
( 0.0 0.01 0.0)
|
||||
( 0.0 0.0 0.8)
|
||||
( 40.0 0.0 0.8)
|
||||
( 40.0 0.01 0.8)
|
||||
( 0.0 0.01 0.8)
|
||||
);
|
||||
|
||||
blocks
|
||||
(
|
||||
hex (0 1 2 3 4 5 6 7) (2000 1 80) simpleGrading (1 1 1)
|
||||
);
|
||||
|
||||
edges
|
||||
(
|
||||
);
|
||||
|
||||
boundary
|
||||
(
|
||||
inlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(0 4 7 3)
|
||||
);
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(1 5 6 2)
|
||||
);
|
||||
}
|
||||
ground
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(0 1 2 3)
|
||||
);
|
||||
}
|
||||
top
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(4 5 6 7)
|
||||
);
|
||||
}
|
||||
sides
|
||||
{
|
||||
type empty;
|
||||
faces
|
||||
(
|
||||
(0 1 5 4)
|
||||
(3 2 6 7)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
mergePatchPairs
|
||||
(
|
||||
);
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
|
||||
@ -0,0 +1,162 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: plus |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object controlDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application interFoam;
|
||||
|
||||
startFrom latestTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
stopAt endTime;
|
||||
|
||||
endTime 30.0;
|
||||
|
||||
deltaT 0.01;
|
||||
|
||||
writeControl adjustableRunTime;
|
||||
|
||||
writeInterval 0.033;
|
||||
|
||||
purgeWrite 0;
|
||||
|
||||
writeFormat ascii;
|
||||
|
||||
writePrecision 6;
|
||||
|
||||
writeCompression off;
|
||||
|
||||
timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
runTimeModifiable yes;
|
||||
|
||||
adjustTimeStep yes;
|
||||
|
||||
maxCo 0.65;
|
||||
maxAlphaCo 0.65;
|
||||
|
||||
maxDeltaT 0.05;
|
||||
|
||||
|
||||
functions
|
||||
{
|
||||
line
|
||||
{
|
||||
type sets;
|
||||
libs ("libsampling.so");
|
||||
enabled true;
|
||||
writeControl writeTime;
|
||||
writeInterval 1;
|
||||
|
||||
interpolationScheme cellPoint;
|
||||
setFormat raw;
|
||||
sets
|
||||
(
|
||||
line1
|
||||
{
|
||||
type uniform;
|
||||
axis distance;
|
||||
start ( 1.0 0.005 0.0 );
|
||||
end ( 1.0 0.005 1.0 );
|
||||
nPoints 1001;
|
||||
}
|
||||
line2
|
||||
{
|
||||
type uniform;
|
||||
axis distance;
|
||||
start ( 2.0 0.005 0.0 );
|
||||
end ( 2.0 0.005 1.0 );
|
||||
nPoints 1001;
|
||||
}
|
||||
line3
|
||||
{
|
||||
type uniform;
|
||||
axis distance;
|
||||
start ( 3.0 0.005 0.0 );
|
||||
end ( 3.0 0.005 1.0 );
|
||||
nPoints 1001;
|
||||
}
|
||||
line4
|
||||
{
|
||||
type uniform;
|
||||
axis distance;
|
||||
start ( 5.0 0.005 0.0 );
|
||||
end ( 5.0 0.005 1.0 );
|
||||
nPoints 1001;
|
||||
}
|
||||
line5
|
||||
{
|
||||
type uniform;
|
||||
axis distance;
|
||||
start ( 7.5 0.005 0.0 );
|
||||
end ( 7.5 0.005 1.0 );
|
||||
nPoints 1001;
|
||||
}
|
||||
|
||||
line6
|
||||
{
|
||||
type uniform;
|
||||
axis distance;
|
||||
start ( 10.0 0.005 0.0 );
|
||||
end ( 10.0 0.005 1.0 );
|
||||
nPoints 1001;
|
||||
}
|
||||
line7
|
||||
{
|
||||
type uniform;
|
||||
axis distance;
|
||||
start ( 12.0 0.005 0.0 );
|
||||
end ( 12.0 0.005 1.0 );
|
||||
nPoints 1001;
|
||||
}
|
||||
line8
|
||||
{
|
||||
type uniform;
|
||||
axis distance;
|
||||
start ( 15.0 0.005 0.0 );
|
||||
end ( 15.0 0.005 1.0 );
|
||||
nPoints 1001;
|
||||
}
|
||||
line9
|
||||
{
|
||||
type uniform;
|
||||
axis distance;
|
||||
start ( 20.0 0.005 0.0 );
|
||||
end ( 20.0 0.005 1.0 );
|
||||
nPoints 1001;
|
||||
}
|
||||
line10
|
||||
{
|
||||
type uniform;
|
||||
axis distance;
|
||||
start ( 28.0 0.005 0.0 );
|
||||
end ( 28.0 0.005 1.0 );
|
||||
nPoints 1001;
|
||||
}
|
||||
);
|
||||
|
||||
fixedLocations false;
|
||||
fields
|
||||
(
|
||||
U alpha.water
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,29 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: plus |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object decomposeParDict;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
numberOfSubdomains 2;
|
||||
|
||||
method hierarchical;
|
||||
|
||||
hierarchicalCoeffs
|
||||
{
|
||||
n (2 1 1);
|
||||
delta 0.001;
|
||||
order xyz;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,54 @@
|
||||
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: plus |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object fvSchemes;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
ddtSchemes
|
||||
{
|
||||
default Euler;
|
||||
}
|
||||
|
||||
gradSchemes
|
||||
{
|
||||
default Gauss linear;
|
||||
}
|
||||
|
||||
divSchemes
|
||||
{
|
||||
div(rhoPhi,U) Gauss linearUpwind grad(U);
|
||||
div(phi,alpha) Gauss vanLeer;
|
||||
div(phirb,alpha) Gauss linear;
|
||||
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
{
|
||||
default Gauss linear orthogonal;
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
{
|
||||
default linear;
|
||||
}
|
||||
|
||||
snGradSchemes
|
||||
{
|
||||
default orthogonal;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -0,0 +1,78 @@
|
||||
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: plus |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object fvSolution;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
solvers
|
||||
{
|
||||
"alpha.water.*"
|
||||
{
|
||||
nAlphaCorr 1;
|
||||
nAlphaSubCycles 3;
|
||||
cAlpha 1;
|
||||
}
|
||||
|
||||
"pcorr.*"
|
||||
{
|
||||
solver PCG;
|
||||
preconditioner DIC;
|
||||
tolerance 1e-6;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
p_rgh
|
||||
{
|
||||
solver PCG;
|
||||
preconditioner DIC;
|
||||
tolerance 1e-6;
|
||||
relTol 0.1;
|
||||
}
|
||||
|
||||
p_rghFinal
|
||||
{
|
||||
solver GAMG;
|
||||
smoother DIC;
|
||||
tolerance 1e-7;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
U
|
||||
{
|
||||
solver PBiCG;
|
||||
preconditioner DILU;
|
||||
tolerance 1e-6;
|
||||
relTol 0.1;
|
||||
}
|
||||
|
||||
UFinal
|
||||
{
|
||||
solver PBiCG;
|
||||
preconditioner DILU;
|
||||
tolerance 1e-6;
|
||||
relTol 0;
|
||||
}
|
||||
}
|
||||
|
||||
PIMPLE
|
||||
{
|
||||
momentumPredictor no;
|
||||
nCorrectors 2;
|
||||
nNonOrthogonalCorrectors 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: plus |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object setFieldsDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
defaultFieldValues
|
||||
(
|
||||
volScalarFieldValue alpha.water 0
|
||||
);
|
||||
|
||||
regions
|
||||
(
|
||||
boxToCell
|
||||
{
|
||||
box (0 0 0) (40.0 1.0 0.4046);
|
||||
fieldValues
|
||||
(
|
||||
volScalarFieldValue alpha.water 1
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -63,7 +63,7 @@ options
|
||||
volumeMode absolute;
|
||||
injectionRateSuSp
|
||||
{
|
||||
e.steam (3700 0); // kg*m^2/s^3
|
||||
h.steam (3700 0); // kg*m^2/s^3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
# Flags for compiling/linking openmp
|
||||
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
|
||||
# -
|
||||
# Clang provides 'omp' and a link for 'gomp'.
|
||||
# With 'gomp' we can use system libs.
|
||||
|
||||
COMP_OPENMP = -DUSE_OMP -fopenmp
|
||||
LINK_OPENMP = -lgomp
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
# Flags for compiling/linking openmp
|
||||
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
|
||||
|
||||
COMP_OPENMP = -DUSE_OMP -fopenmp
|
||||
LINK_OPENMP = -lgomp
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
# Flags for compiling/linking openmp
|
||||
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
|
||||
|
||||
COMP_OPENMP = -DUSE_OMP -fopenmp
|
||||
LINK_OPENMP = -lgomp
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
# Flags for compiling/linking openmp
|
||||
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
|
||||
|
||||
COMP_OPENMP = -DUSE_OMP -fopenmp
|
||||
LINK_OPENMP = -lgomp
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user