GIT: Resolved merge conflict

This commit is contained in:
andy
2014-01-10 09:59:37 +00:00
267 changed files with 1828 additions and 7849 deletions

View File

@ -14,6 +14,7 @@ heatTransferModels/RanzMarshall/RanzMarshall.C
liftModels/liftModel/liftModel.C liftModels/liftModel/liftModel.C
liftModels/liftModel/newLiftModel.C liftModels/liftModel/newLiftModel.C
liftModels/noLift/noLift.C
liftModels/constantCoefficient/constantCoefficient.C liftModels/constantCoefficient/constantCoefficient.C
LIB = $(FOAM_LIBBIN)/libcompressibleEulerianInterfacialModels LIB = $(FOAM_LIBBIN)/libcompressibleEulerianInterfacialModels

View File

@ -56,7 +56,8 @@ Foam::liftModels::constantCoefficient::constantCoefficient
) )
: :
liftModel(dict, alpha1, phase1, phase2), liftModel(dict, alpha1, phase1, phase2),
Cl_("Cl", dimless, dict.lookup("Cl")) coeffDict_(dict.subDict(typeName + "Coeffs")),
Cl_("Cl", dimless, coeffDict_.lookup("Cl"))
{} {}

View File

@ -53,6 +53,9 @@ class constantCoefficient
{ {
// Private data // Private data
//- Coefficient dictionary
const dictionary& coeffDict_;
//- Constant lift coefficient //- Constant lift coefficient
dimensionedScalar Cl_; dimensionedScalar Cl_;

View File

@ -85,6 +85,10 @@ public:
// Constructors // Constructors
//- Construct null
liftModel();
//- Construct from components
liftModel liftModel
( (
const dictionary& dict, const dictionary& dict,

View File

@ -61,7 +61,7 @@ Foam::autoPtr<Foam::liftModel> Foam::liftModel::New
return return
cstrIter() cstrIter()
( (
dict.subDict(phase1.name()).subDict(liftModelType + "Coeffs"), dict.subDict(phase1.name()),
alpha1, alpha1,
phase1, phase1,
phase2 phase2

View File

@ -0,0 +1,97 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\/ 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 "noLift.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace liftModels
{
defineTypeNameAndDebug(noLift, 0);
addToRunTimeSelectionTable
(
liftModel,
noLift,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::liftModels::noLift::noLift
(
const dictionary& dict,
const volScalarField& alpha1,
const phaseModel& phase1,
const phaseModel& phase2
)
:
liftModel(dict, alpha1, phase1, phase2)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::liftModels::noLift::~noLift()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volVectorField> Foam::liftModels::noLift::F
(
const volVectorField& U
) const
{
return
tmp<volVectorField>
(
new volVectorField
(
IOobject
(
"zero",
U.time().timeName(),
U.mesh()
),
U.mesh(),
dimensionedVector
(
"zero",
dimensionSet(1, -2, -2, 0, 0, 0, 0),
vector::zero
)
)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,98 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\/ 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::liftModels::noLift
Description
SourceFiles
noLift.C
\*---------------------------------------------------------------------------*/
#ifndef noLift_H
#define noLift_H
#include "liftModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace liftModels
{
/*---------------------------------------------------------------------------*\
Class noLift Declaration
\*---------------------------------------------------------------------------*/
class noLift
:
public liftModel
{
// Private data
//- Constant lift coefficient
dimensionedScalar Cl_;
public:
//- Runtime type information
TypeName("none");
// Constructors
//- Construct from components
noLift
(
const dictionary& dict,
const volScalarField& alpha1,
const phaseModel& phase1,
const phaseModel& phase2
);
//- Destructor
virtual ~noLift();
// Member Functions
//- Lift force
tmp<volVectorField> F(const volVectorField& U) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace liftModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -55,8 +55,6 @@ Foam::RASModels::kineticTheoryModel::kineticTheoryModel
phase_(phase), phase_(phase),
draga_(phase.fluid().drag1()),
viscosityModel_ viscosityModel_
( (
kineticTheoryModels::viscosityModel::New kineticTheoryModels::viscosityModel::New
@ -401,7 +399,11 @@ void Foam::RASModels::kineticTheoryModel::correct()
( (
alpha*(1.0 - alpha), alpha*(1.0 - alpha),
phase_.fluid().residualPhaseFraction() phase_.fluid().residualPhaseFraction()
)*draga_.K(magUr + phase_.fluid().residualSlip())/rho )
*phase_.fluid().drag(phase_).K
(
magUr + phase_.fluid().residualSlip()
)/rho
); );
// Eq. 3.25, p. 50 Js = J1 - J2 // Eq. 3.25, p. 50 Js = J1 - J2

View File

@ -82,8 +82,8 @@ class kineticTheoryModel
const phaseModel& phase_; const phaseModel& phase_;
//- Drag model ////- Drag model
const dragModel& draga_; //const dragModel& draga_;
// Sub-models // Sub-models

View File

@ -82,7 +82,7 @@ class twoPhaseSystem
//- Total volumetric flux //- Total volumetric flux
surfaceScalarField phi_; surfaceScalarField phi_;
//- //- Dilatation term
volScalarField dgdt_; volScalarField dgdt_;
//- Surface tension coefficient //- Surface tension coefficient
@ -224,7 +224,7 @@ public:
return phi_; return phi_;
} }
//- Return //- Return the dilatation term
const volScalarField& dgdt() const const volScalarField& dgdt() const
{ {
return dgdt_; return dgdt_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -475,7 +475,11 @@ int main(int argc, char *argv[])
word regionName = polyMesh::defaultRegion; word regionName = polyMesh::defaultRegion;
word regionDir = word::null; word regionDir = word::null;
if (args.optionReadIfPresent("region", regionName)) if
(
args.optionReadIfPresent("region", regionName)
&& regionName != polyMesh::defaultRegion
)
{ {
regionDir = regionName; regionDir = regionName;
Info<< "Operating on region " << regionName << nl << endl; Info<< "Operating on region " << regionName << nl << endl;
@ -578,7 +582,7 @@ int main(int argc, char *argv[])
// Loop over all times // Loop over all times
forAll(Times, timeI) for (label timeI = startTime; timeI < endTime; timeI++)
{ {
// Set time for global database // Set time for global database
runTime.setTime(Times[timeI], timeI); runTime.setTime(Times[timeI], timeI);
@ -591,6 +595,19 @@ int main(int argc, char *argv[])
databases[procI].setTime(Times[timeI], timeI); databases[procI].setTime(Times[timeI], timeI);
} }
const fileName meshPath =
databases[0].path()
/databases[0].timeName()
/regionDir
/polyMesh::meshSubDir;
if (!isFile(meshPath/"faces"))
{
Info<< "No mesh." << nl << endl;
continue;
}
// Read point on individual processors to determine merge tolerance // Read point on individual processors to determine merge tolerance
// (otherwise single cell domains might give problems) // (otherwise single cell domains might give problems)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -458,6 +458,8 @@ int main(int argc, char *argv[])
regIOobject::fileModificationChecking = regIOobject::timeStamp; regIOobject::fileModificationChecking = regIOobject::timeStamp;
# include "createTime.H" # include "createTime.H"
runTime.functionObjects().off();
word regionName = polyMesh::defaultRegion; word regionName = polyMesh::defaultRegion;
fileName meshSubDir; fileName meshSubDir;

View File

@ -1,9 +1,11 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/surfMesh/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude -I$(LIB_SRC)/triSurface/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lsampling \
-ltriSurface \ -ltriSurface \
-lsurfMesh \ -lsurfMesh \
-lmeshTools -lmeshTools

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -39,6 +39,7 @@ Description
#include "surfaceIntersection.H" #include "surfaceIntersection.H"
#include "SortableList.H" #include "SortableList.H"
#include "PatchTools.H" #include "PatchTools.H"
#include "vtkSurfaceWriter.H"
using namespace Foam; using namespace Foam;
@ -183,6 +184,12 @@ int main(int argc, char *argv[])
"also check for self-intersection" "also check for self-intersection"
); );
argList::addBoolOption argList::addBoolOption
(
"splitNonManifold",
"split surface along non-manifold edges"
" (default split is fully disconnected)"
);
argList::addBoolOption
( (
"verbose", "verbose",
"verbose operation" "verbose operation"
@ -198,6 +205,7 @@ int main(int argc, char *argv[])
const fileName surfFileName = args[1]; const fileName surfFileName = args[1];
const bool checkSelfIntersect = args.optionFound("checkSelfIntersection"); const bool checkSelfIntersect = args.optionFound("checkSelfIntersection");
const bool verbose = args.optionFound("verbose"); const bool verbose = args.optionFound("verbose");
const bool splitNonManifold = args.optionFound("splitNonManifold");
Info<< "Reading surface from " << surfFileName << " ..." << nl << endl; Info<< "Reading surface from " << surfFileName << " ..." << nl << endl;
@ -565,8 +573,22 @@ int main(int argc, char *argv[])
// Check singly connected domain // Check singly connected domain
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{
boolList borderEdge(surf.nEdges(), false);
if (splitNonManifold)
{
const labelListList& eFaces = surf.edgeFaces();
forAll(eFaces, edgeI)
{
if (eFaces[edgeI].size() > 2)
{
borderEdge[edgeI] = true;
}
}
}
labelList faceZone; labelList faceZone;
label numZones = surf.markZones(boolList(surf.nEdges(), false), faceZone); label numZones = surf.markZones(borderEdge, faceZone);
Info<< "Number of unconnected parts : " << numZones << endl; Info<< "Number of unconnected parts : " << numZones << endl;
@ -584,6 +606,43 @@ int main(int argc, char *argv[])
surfFileNameBase = surfFileNameBase.lessExt(); surfFileNameBase = surfFileNameBase.lessExt();
} }
{
Info<< "Writing zoning to "
<< fileName
(
"zone_"
+ surfFileNameBase
+ '.'
+ vtkSurfaceWriter::typeName
)
<< "..." << endl << endl;
// Convert data
scalarField scalarFaceZone(faceZone.size());
forAll(faceZone, i)
{
scalarFaceZone[i] = faceZone[i];
}
faceList faces(surf.size());
forAll(surf, i)
{
faces[i] = surf[i].triFaceFace();
}
vtkSurfaceWriter().write
(
surfFileName.path(),
surfFileNameBase,
surf.points(),
faces,
"zone",
scalarFaceZone,
true
);
}
for (label zone = 0; zone < numZones; zone++) for (label zone = 0; zone < numZones; zone++)
{ {
boolList includeMap(surf.size(), false); boolList includeMap(surf.size(), false);
@ -609,12 +668,13 @@ int main(int argc, char *argv[])
) )
); );
fileName subFileName(surfFileNameBase + "_" + name(zone) + ".obj"); fileName subName(surfFileNameBase + "_" + name(zone) + ".obj");
Info<< "writing part " << zone << " size " << subSurf.size() Info<< "writing part " << zone << " size " << subSurf.size()
<< " to " << subFileName << endl; << " to " << subName << endl;
subSurf.write(subFileName); subSurf.write(subName);
}
} }
} }

View File

@ -188,12 +188,12 @@ Foam::OSstream& Foam::messageStream::operator()
Foam::OSstream& Foam::messageStream::operator()(const bool output) Foam::OSstream& Foam::messageStream::operator()(const bool output)
{ {
if (output && level) if (level)
{ {
bool collect = (severity_ == INFO || severity_ == WARNING); bool collect = (severity_ == INFO || severity_ == WARNING);
// Report the error // Report the error
if (collect) if (!output && collect)
{ {
return Snull; return Snull;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -652,7 +652,7 @@ Foam::Ostream& Foam::dimensionSet::write
os << token::BEGIN_SQR; os << token::BEGIN_SQR;
if (writeUnits.valid()) if (writeUnits.valid() && os.format() == IOstream::ASCII)
{ {
scalarField exponents(dimensionSet::nDimensions); scalarField exponents(dimensionSet::nDimensions);
for (int d=0; d<dimensionSet::nDimensions; d++) for (int d=0; d<dimensionSet::nDimensions; d++)

View File

@ -352,7 +352,11 @@ void Foam::GAMGSolver::Vcycle
// Scale coarse-grid correction field // Scale coarse-grid correction field
// but not on the coarsest level because it evaluates to 1 // but not on the coarsest level because it evaluates to 1
if (scaleCorrection_ && leveli < coarsestLevel - 1) if
(
scaleCorrection_
&& (interpolateCorrection_ || leveli < coarsestLevel - 1)
)
{ {
scale scale
( (

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -43,7 +43,7 @@ Foam::Ostream& Foam::operator<<
os.write os.write
( (
reinterpret_cast<const char*>(&tbl.table_), reinterpret_cast<const char*>(&tbl.table_),
sizeof(tbl.table_) tbl.table_.byteSize()
); );
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -261,7 +261,7 @@ Foam::label Foam::UIPstream::read
( (
buf, buf,
bufSize, bufSize,
MPI_PACKED, MPI_BYTE,
fromProcNo, fromProcNo,
tag, tag,
PstreamGlobals::MPICommunicators_[communicator], PstreamGlobals::MPICommunicators_[communicator],
@ -317,7 +317,7 @@ Foam::label Foam::UIPstream::read
( (
buf, buf,
bufSize, bufSize,
MPI_PACKED, MPI_BYTE,
fromProcNo, fromProcNo,
tag, tag,
PstreamGlobals::MPICommunicators_[communicator], PstreamGlobals::MPICommunicators_[communicator],

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -74,7 +74,7 @@ bool Foam::UOPstream::write
( (
const_cast<char*>(buf), const_cast<char*>(buf),
bufSize, bufSize,
MPI_PACKED, MPI_BYTE,
toProcNo, //procID(toProcNo), toProcNo, //procID(toProcNo),
tag, tag,
PstreamGlobals::MPICommunicators_[communicator] //MPI_COMM_WORLD PstreamGlobals::MPICommunicators_[communicator] //MPI_COMM_WORLD
@ -94,7 +94,7 @@ bool Foam::UOPstream::write
( (
const_cast<char*>(buf), const_cast<char*>(buf),
bufSize, bufSize,
MPI_PACKED, MPI_BYTE,
toProcNo, //procID(toProcNo), toProcNo, //procID(toProcNo),
tag, tag,
PstreamGlobals::MPICommunicators_[communicator] //MPI_COMM_WORLD PstreamGlobals::MPICommunicators_[communicator] //MPI_COMM_WORLD
@ -116,7 +116,7 @@ bool Foam::UOPstream::write
( (
const_cast<char*>(buf), const_cast<char*>(buf),
bufSize, bufSize,
MPI_PACKED, MPI_BYTE,
toProcNo, //procID(toProcNo), toProcNo, //procID(toProcNo),
tag, tag,
PstreamGlobals::MPICommunicators_[communicator],//MPI_COMM_WORLD, PstreamGlobals::MPICommunicators_[communicator],//MPI_COMM_WORLD,

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -81,15 +81,6 @@ private:
const label unmappedIndex const label unmappedIndex
); );
//- Map from old to new according to map. Handles map = -1.
template<class Type>
static void map
(
const Field<Type>&,
const labelList& map,
Field<Type>&
);
//- Update single volField. //- Update single volField.
template<class Type> template<class Type>
static void MapVolField static void MapVolField

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,26 +30,6 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::fvMeshAdder::map
(
const Field<Type>& oldFld,
const labelList& oldToNew,
Field<Type>& fld
)
{
forAll(oldFld, cellI)
{
label newCellI = oldToNew[cellI];
if (newCellI >= 0 && newCellI < fld.size())
{
fld[newCellI] = oldFld[cellI];
}
}
}
template<class Type> template<class Type>
void Foam::fvMeshAdder::MapVolField void Foam::fvMeshAdder::MapVolField
( (
@ -73,8 +53,8 @@ void Foam::fvMeshAdder::MapVolField
intFld.setSize(mesh.nCells()); intFld.setSize(mesh.nCells());
map(oldInternalField, meshMap.oldCellMap(), intFld); intFld.rmap(oldInternalField, meshMap.oldCellMap());
map(fldToAdd.internalField(), meshMap.addedCellMap(), intFld); intFld.rmap(fldToAdd.internalField(), meshMap.addedCellMap());
} }
@ -156,7 +136,7 @@ void Foam::fvMeshAdder::MapVolField
oldPatchSizes[patchI], oldPatchSizes[patchI],
meshMap.oldFaceMap(), meshMap.oldFaceMap(),
mesh.boundaryMesh()[newPatchI], mesh.boundaryMesh()[newPatchI],
0 // unmapped value -1 // unmapped value
) )
); );
@ -218,7 +198,7 @@ void Foam::fvMeshAdder::MapVolField
oldPatch.size(), oldPatch.size(),
meshMap.addedFaceMap(), meshMap.addedFaceMap(),
newPatch, newPatch,
0 // unmapped values -1 // unmapped values
) )
); );
@ -241,34 +221,23 @@ void Foam::fvMeshAdder::MapVolField
// PatchField will have correct size already. Just slot in // PatchField will have correct size already. Just slot in
// my elements. // my elements.
// From new patch faces to patch faces on added mesh. This labelList addedToNew(oldPatch.size(), -1);
// time keep unmapped elements -1. forAll(addedToNew, i)
labelList newToAdded {
label addedFaceI = oldPatch.start()+i;
label newFaceI = meshMap.addedFaceMap()[addedFaceI];
label patchFaceI = newFaceI-newPatch.start();
if (patchFaceI >= 0 && patchFaceI < newPatch.size())
{
addedToNew[i] = patchFaceI;
}
}
bfld[newPatchI].rmap
( (
calcPatchMap fldToAdd.boundaryField()[patchI],
( addedToNew
oldPatch.start(),
oldPatch.size(),
meshMap.addedFaceMap(),
newPatch,
-1 // unmapped values
)
); );
const fvPatchField<Type>& addedFld =
fldToAdd.boundaryField()[patchI];
fvPatchField<Type>& newFld = bfld[newPatchI];
forAll(newFld, i)
{
label oldFaceI = newToAdded[i];
if (oldFaceI >= 0 && oldFaceI < addedFld.size())
{
newFld[i] = addedFld[oldFaceI];
}
}
} }
} }
} }
@ -375,8 +344,9 @@ void Foam::fvMeshAdder::MapSurfaceField
intFld.setSize(mesh.nInternalFaces()); intFld.setSize(mesh.nInternalFaces());
map(oldField, meshMap.oldFaceMap(), intFld); intFld.rmap(oldField, meshMap.oldFaceMap());
map(fldToAdd, meshMap.addedFaceMap(), intFld); intFld.rmap(fldToAdd, meshMap.addedFaceMap());
// Faces that were boundary faces but are not anymore. // Faces that were boundary faces but are not anymore.
// Use owner value (so lowest numbered cell, i.e. from 'old' not 'added' // Use owner value (so lowest numbered cell, i.e. from 'old' not 'added'
@ -474,13 +444,12 @@ void Foam::fvMeshAdder::MapSurfaceField
oldPatchSizes[patchI], oldPatchSizes[patchI],
meshMap.oldFaceMap(), meshMap.oldFaceMap(),
mesh.boundaryMesh()[newPatchI], mesh.boundaryMesh()[newPatchI],
0 // unmapped value -1 // unmapped value
) )
); );
directFvPatchFieldMapper patchMapper(newToOld); directFvPatchFieldMapper patchMapper(newToOld);
// Create new patchField with same type as existing one. // Create new patchField with same type as existing one.
// Note: // Note:
// - boundaryField already in new order so access with newPatchI // - boundaryField already in new order so access with newPatchI
@ -536,7 +505,7 @@ void Foam::fvMeshAdder::MapSurfaceField
oldPatch.size(), oldPatch.size(),
meshMap.addedFaceMap(), meshMap.addedFaceMap(),
newPatch, newPatch,
0 // unmapped values -1 // unmapped values
) )
); );
@ -559,34 +528,23 @@ void Foam::fvMeshAdder::MapSurfaceField
// PatchField will have correct size already. Just slot in // PatchField will have correct size already. Just slot in
// my elements. // my elements.
// From new patch faces to patch faces on added mesh. This labelList addedToNew(oldPatch.size(), -1);
// time keep unmapped elements -1. forAll(addedToNew, i)
labelList newToAdded {
label addedFaceI = oldPatch.start()+i;
label newFaceI = meshMap.addedFaceMap()[addedFaceI];
label patchFaceI = newFaceI-newPatch.start();
if (patchFaceI >= 0 && patchFaceI < newPatch.size())
{
addedToNew[i] = patchFaceI;
}
}
bfld[newPatchI].rmap
( (
calcPatchMap fldToAdd.boundaryField()[patchI],
( addedToNew
oldPatch.start(),
oldPatch.size(),
meshMap.addedFaceMap(),
newPatch,
-1 // unmapped values
)
); );
const fvsPatchField<Type>& addedFld =
fldToAdd.boundaryField()[patchI];
fvsPatchField<Type>& newFld = bfld[newPatchI];
forAll(newFld, i)
{
label oldFaceI = newToAdded[i];
if (oldFaceI >= 0 && oldFaceI < addedFld.size())
{
newFld[i] = addedFld[oldFaceI];
}
}
} }
} }
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -1058,7 +1058,7 @@ void Foam::fvMeshDistribute::sendMesh
const labelList& sourceProc, const labelList& sourceProc,
const labelList& sourcePatch, const labelList& sourcePatch,
const labelList& sourceNewNbrProc, const labelList& sourceNewNbrProc,
UOPstream& toDomain Ostream& toDomain
) )
{ {
if (debug) if (debug)
@ -1217,7 +1217,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::fvMeshDistribute::receiveMesh
labelList& domainSourceProc, labelList& domainSourceProc,
labelList& domainSourcePatch, labelList& domainSourcePatch,
labelList& domainSourceNewNbrProc, labelList& domainSourceNewNbrProc,
UIPstream& fromNbr Istream& fromNbr
) )
{ {
pointField domainPoints(fromNbr); pointField domainPoints(fromNbr);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -255,7 +255,7 @@ class fvMeshDistribute
const labelList& sourceProc, const labelList& sourceProc,
const labelList& sourcePatch, const labelList& sourcePatch,
const labelList& sourceNewProc, const labelList& sourceNewProc,
UOPstream& toDomain Ostream& toDomain
); );
//- Send subset of fields //- Send subset of fields
template<class GeoField> template<class GeoField>
@ -264,7 +264,7 @@ class fvMeshDistribute
const label domain, const label domain,
const wordList& fieldNames, const wordList& fieldNames,
const fvMeshSubset&, const fvMeshSubset&,
UOPstream& toNbr Ostream& toNbr
); );
//- Receive mesh. Opposite of sendMesh //- Receive mesh. Opposite of sendMesh
@ -279,7 +279,7 @@ class fvMeshDistribute
labelList& domainSourceProc, labelList& domainSourceProc,
labelList& domainSourcePatch, labelList& domainSourcePatch,
labelList& domainSourceNewProc, labelList& domainSourceNewProc,
UIPstream& fromNbr Istream& fromNbr
); );
//- Receive fields. Opposite of sendFields //- Receive fields. Opposite of sendFields

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -216,7 +216,7 @@ void Foam::fvMeshDistribute::sendFields
const label domain, const label domain,
const wordList& fieldNames, const wordList& fieldNames,
const fvMeshSubset& subsetter, const fvMeshSubset& subsetter,
UOPstream& toNbr Ostream& toNbr
) )
{ {
toNbr << GeoField::typeName << token::NL << token::BEGIN_BLOCK << token::NL; toNbr << GeoField::typeName << token::NL << token::BEGIN_BLOCK << token::NL;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -475,7 +475,7 @@ Foam::scalarField Foam::edgeCollapser::calcTargetFaceSizes() const
{ {
scalarField targetFaceSizes(mesh_.nFaces(), -1); scalarField targetFaceSizes(mesh_.nFaces(), -1);
const scalarField& cellVolumes = mesh_.cellVolumes(); const scalarField& V = mesh_.cellVolumes();
const polyBoundaryMesh& patches = mesh_.boundaryMesh(); const polyBoundaryMesh& patches = mesh_.boundaryMesh();
const labelList& cellOwner = mesh_.faceOwner(); const labelList& cellOwner = mesh_.faceOwner();
@ -486,8 +486,8 @@ Foam::scalarField Foam::edgeCollapser::calcTargetFaceSizes() const
// Calculate face size from cell volumes for internal faces // Calculate face size from cell volumes for internal faces
for (label intFaceI = 0; intFaceI < mesh_.nInternalFaces(); ++intFaceI) for (label intFaceI = 0; intFaceI < mesh_.nInternalFaces(); ++intFaceI)
{ {
const scalar cellOwnerVol = cellVolumes[cellOwner[intFaceI]]; const scalar cellOwnerVol = max(0.0, V[cellOwner[intFaceI]]);
const scalar cellNeighbourVol = cellVolumes[cellNeighbour[intFaceI]]; const scalar cellNeighbourVol = max(0.0, V[cellNeighbour[intFaceI]]);
scalar targetFaceSizeA = Foam::pow(cellOwnerVol, 1.0/3.0); scalar targetFaceSizeA = Foam::pow(cellOwnerVol, 1.0/3.0);
scalar targetFaceSizeB = Foam::pow(cellNeighbourVol, 1.0/3.0); scalar targetFaceSizeB = Foam::pow(cellNeighbourVol, 1.0/3.0);
@ -512,7 +512,7 @@ Foam::scalarField Foam::edgeCollapser::calcTargetFaceSizes() const
forAll(faceCells, facei) forAll(faceCells, facei)
{ {
neiCellVolumes[bFaceI++] = cellVolumes[faceCells[facei]]; neiCellVolumes[bFaceI++] = max(0.0, V[faceCells[facei]]);
} }
} }
else else
@ -522,7 +522,7 @@ Foam::scalarField Foam::edgeCollapser::calcTargetFaceSizes() const
forAll(patch, patchFaceI) forAll(patch, patchFaceI)
{ {
const label extFaceI = patchFaceI + patch.start(); const label extFaceI = patchFaceI + patch.start();
const scalar cellOwnerVol = cellVolumes[cellOwner[extFaceI]]; const scalar cellOwnerVol = max(0.0, V[cellOwner[extFaceI]]);
targetFaceSizes[extFaceI] = Foam::pow(cellOwnerVol, 1.0/3.0); targetFaceSizes[extFaceI] = Foam::pow(cellOwnerVol, 1.0/3.0);
} }
@ -542,7 +542,7 @@ Foam::scalarField Foam::edgeCollapser::calcTargetFaceSizes() const
forAll(patch, patchFaceI) forAll(patch, patchFaceI)
{ {
const label localFaceI = patchFaceI + patch.start(); const label localFaceI = patchFaceI + patch.start();
const scalar cellOwnerVol = cellVolumes[cellOwner[localFaceI]]; const scalar cellOwnerVol = max(0.0, V[cellOwner[localFaceI]]);
const scalar cellNeighbourVol = neiCellVolumes[bFaceI++]; const scalar cellNeighbourVol = neiCellVolumes[bFaceI++];
scalar targetFaceSizeA = Foam::pow(cellOwnerVol, 1.0/3.0); scalar targetFaceSizeA = Foam::pow(cellOwnerVol, 1.0/3.0);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -102,9 +102,10 @@ Foam::porosityModels::DarcyForchheimer::DarcyForchheimer
D_[zoneI][i].yy() = d.value().y(); D_[zoneI][i].yy() = d.value().y();
D_[zoneI][i].zz() = d.value().z(); D_[zoneI][i].zz() = d.value().z();
F_[zoneI][i].xx() = f.value().x(); // leading 0.5 is from 1/2*rho
F_[zoneI][i].yy() = f.value().y(); F_[zoneI][i].xx() = 0.5*f.value().x();
F_[zoneI][i].zz() = f.value().z(); F_[zoneI][i].yy() = 0.5*f.value().y();
F_[zoneI][i].zz() = 0.5*f.value().z();
} }
D_[zoneI] = coordSys_.R().transformTensor(D_[zoneI], cells); D_[zoneI] = coordSys_.R().transformTensor(D_[zoneI], cells);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -55,7 +55,7 @@ Ostream& operator<<(Ostream& os, const porosityModelList& models);
class porosityModelList class porosityModelList
: :
PtrList<porosityModel> public PtrList<porosityModel>
{ {
private: private:

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -78,7 +78,6 @@ SourceFiles
#define uniformTotalPressureFvPatchScalarField_H #define uniformTotalPressureFvPatchScalarField_H
#include "fixedValueFvPatchFields.H" #include "fixedValueFvPatchFields.H"
#include "interpolationTable.H"
#include "DataEntry.H" #include "DataEntry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,8 +25,8 @@ License
#include "MGridGenGAMGAgglomeration.H" #include "MGridGenGAMGAgglomeration.H"
#include "fvMesh.H" #include "fvMesh.H"
#include "processorPolyPatch.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "processorLduInterface.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -43,6 +43,121 @@ namespace Foam
} }
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::MGridGenGAMGAgglomeration::swap
(
const lduInterfacePtrsList& interfaces,
const labelUList& cellValues,
PtrList<labelList>& nbrValues
) const
{
// Initialise transfer of restrict addressing on the interface
forAll(interfaces, inti)
{
if (interfaces.set(inti))
{
interfaces[inti].initInternalFieldTransfer
(
Pstream::nonBlocking,
cellValues
);
}
}
if (Pstream::parRun())
{
Pstream::waitRequests();
}
// Get the interface agglomeration
nbrValues.setSize(interfaces.size());
forAll(interfaces, inti)
{
if (interfaces.set(inti))
{
nbrValues.set
(
inti,
new labelList
(
interfaces[inti].internalFieldTransfer
(
Pstream::nonBlocking,
cellValues
)
)
);
}
}
}
void Foam::MGridGenGAMGAgglomeration::getNbrAgglom
(
const lduAddressing& addr,
const lduInterfacePtrsList& interfaces,
const PtrList<labelList>& nbrGlobalAgglom,
labelList& cellToNbrAgglom
) const
{
cellToNbrAgglom.setSize(addr.size());
cellToNbrAgglom = -1;
forAll(interfaces, inti)
{
if (interfaces.set(inti))
{
if (isA<processorLduInterface>(interfaces[inti]))
{
const processorLduInterface& pldui =
refCast<const processorLduInterface>(interfaces[inti]);
if (pldui.myProcNo() > pldui.neighbProcNo())
{
const labelUList& faceCells =
interfaces[inti].faceCells();
const labelList& nbrData = nbrGlobalAgglom[inti];
forAll(faceCells, i)
{
cellToNbrAgglom[faceCells[i]] = nbrData[i];
}
}
}
}
}
}
void Foam::MGridGenGAMGAgglomeration::detectSharedFaces
(
const lduMesh& mesh,
const labelList& value,
labelHashSet& sharedFaces
) const
{
const lduAddressing& addr = mesh.lduAddr();
const labelUList& lower = addr.lowerAddr();
const labelUList& upper = addr.upperAddr();
sharedFaces.clear();
sharedFaces.resize(addr.lowerAddr().size()/100);
// Detect any faces inbetween same value
forAll(lower, faceI)
{
label lowerData = value[lower[faceI]];
label upperData = value[upper[faceI]];
if (lowerData != -1 && lowerData == upperData)
{
sharedFaces.insert(faceI);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::MGridGenGAMGAgglomeration::MGridGenGAMGAgglomeration Foam::MGridGenGAMGAgglomeration::MGridGenGAMGAgglomeration
@ -58,6 +173,13 @@ Foam::MGridGenGAMGAgglomeration::MGridGenGAMGAgglomeration
label minSize(readLabel(controlDict.lookup("minSize"))); label minSize(readLabel(controlDict.lookup("minSize")));
label maxSize(readLabel(controlDict.lookup("maxSize"))); label maxSize(readLabel(controlDict.lookup("maxSize")));
// Number of iterations applied to improve agglomeration consistency across
// processor boundaries
label nProcConsistencyIter
(
readLabel(controlDict.lookup("nProcConsistencyIter"))
);
// Start geometric agglomeration from the cell volumes and areas of the mesh // Start geometric agglomeration from the cell volumes and areas of the mesh
scalarField* VPtr = const_cast<scalarField*>(&fvMesh_.cellVolumes()); scalarField* VPtr = const_cast<scalarField*>(&fvMesh_.cellVolumes());
@ -87,28 +209,6 @@ Foam::MGridGenGAMGAgglomeration::MGridGenGAMGAgglomeration
} }
} }
/*
{
scalarField& magSb = *magSbPtr;
const polyBoundaryMesh& patches = fvMesh_.boundaryMesh();
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchi];
if (!(Pstream::parRun() && isA<processorPolyPatch>(pp)))
{
const labelUList& faceCells = pp.faceCells();
const vectorField& pSf = pp.faceAreas();
forAll(faceCells, pfi)
{
magSb[faceCells[pfi]] += mag(pSf[pfi]);
}
}
}
}
*/
// Agglomerate until the required number of cells in the coarsest level // Agglomerate until the required number of cells in the coarsest level
// is reached // is reached
@ -129,6 +229,63 @@ Foam::MGridGenGAMGAgglomeration::MGridGenGAMGAgglomeration
*magSbPtr *magSbPtr
); );
// Adjust weights only
for (int i=0; i<nProcConsistencyIter; i++)
{
const lduMesh& mesh = meshLevel(nCreatedLevels);
const lduAddressing& addr = mesh.lduAddr();
const lduInterfacePtrsList interfaces = mesh.interfaces();
const labelField& agglom = finalAgglomPtr();
// Global nubmering
const globalIndex globalNumbering(nCoarseCells);
labelField globalAgglom(addr.size());
forAll(agglom, cellI)
{
globalAgglom[cellI] = globalNumbering.toGlobal(agglom[cellI]);
}
// Get the interface agglomeration
PtrList<labelList> nbrGlobalAgglom;
swap(interfaces, globalAgglom, nbrGlobalAgglom);
// Get the interface agglomeration on a cell basis (-1 for all
// other cells)
labelList cellToNbrAgglom;
getNbrAgglom(addr, interfaces, nbrGlobalAgglom, cellToNbrAgglom);
// Mark all faces inbetween cells with same nbragglomeration
labelHashSet sharedFaces(addr.size()/100);
detectSharedFaces(mesh, cellToNbrAgglom, sharedFaces);
//- Note: in-place update of weights is more effective it seems?
// Should not be. fluke?
//scalarField weights(*faceWeightsPtr);
scalarField weights = *magSfPtr;
forAllConstIter(labelHashSet, sharedFaces, iter)
{
label faceI= iter.key();
weights[faceI] *= 2.0;
}
// Redo the agglomeration using the new weights
finalAgglomPtr = agglomerate
(
nCoarseCells,
minSize,
maxSize,
meshLevel(nCreatedLevels).lduAddr(),
*VPtr,
weights,
*magSbPtr
);
}
if (continueAgglomerating(nCoarseCells)) if (continueAgglomerating(nCoarseCells))
{ {
nCells_[nCreatedLevels] = nCoarseCells; nCells_[nCreatedLevels] = nCoarseCells;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -67,6 +67,29 @@ class MGridGenGAMGAgglomeration
// Private Member Functions // Private Member Functions
void swap
(
const lduInterfacePtrsList& interfaces,
const labelUList& cellValues,
PtrList<labelList>& nbrValues
) const;
void getNbrAgglom
(
const lduAddressing& addr,
const lduInterfacePtrsList& interfaces,
const PtrList<labelList>& nbrGlobalAgglom,
labelList& cellToNbrAgglom
) const;
void detectSharedFaces
(
const lduMesh& mesh,
const labelList& value,
labelHashSet& sharedFaces
) const;
//- Construct the CSR format addressing //- Construct the CSR format addressing
void makeCompactCellFaceAddressingAndFaceWeights void makeCompactCellFaceAddressingAndFaceWeights
( (

View File

@ -65,14 +65,14 @@ void Foam::fv::CodedSource<Type>::prepare
dynCode.setMakeOptions dynCode.setMakeOptions
( (
"EXE_INC = -g \\\n" "EXE_INC = -g \\\n"
"-I$(LIB_SRC)/fieldSources/lnInclude \\\n" "-I$(LIB_SRC)/fvOptions/lnInclude \\\n"
"-I$(LIB_SRC)/finiteVolume/lnInclude \\\n" "-I$(LIB_SRC)/finiteVolume/lnInclude \\\n"
"-I$(LIB_SRC)/meshTools/lnInclude \\\n" "-I$(LIB_SRC)/meshTools/lnInclude \\\n"
"-I$(LIB_SRC)/sampling/lnInclude \\\n" "-I$(LIB_SRC)/sampling/lnInclude \\\n"
+ context.options() + context.options()
+ "\n\nLIB_LIBS = \\\n" + "\n\nLIB_LIBS = \\\n"
+ " -lmeshTools \\\n" + " -lmeshTools \\\n"
+ " -lfieldSources \\\n" + " -lfvOptions \\\n"
+ " -lsampling \\\n" + " -lsampling \\\n"
+ " -lfiniteVolume \\\n" + " -lfiniteVolume \\\n"
+ context.libs() + context.libs()

View File

@ -25,16 +25,51 @@ Class
Foam::fv::codedSource Foam::fv::codedSource
Description Description
Constructs on-the-fly source Constructs on-the-fly fvOption source
The hook functions take the following arguments:
codeCorrect
(
GeometricField<Type, fvPatchField, volMesh>& fld
)
codeAddSup
(
fvMatrix<Type}>& eqn,
const label fieldI
)
setValue
(
fvMatrix<Type}>& eqn,
const label fieldI
)
where :
fld is the field in fieldNames
eqn is the fvMatrix
\heading Source usage \heading Source usage
Example usage: Example usage in controlDict:
\verbatim \verbatim
vectorCodedSourceCoeffs energySource
{ {
fieldNames (U); type scalarCodedSource;
redirectType ramp;
active true;
selectionMode all;
scalarCodedSourceCoeffs
{
fieldNames (h);
redirectType sourceTime;
codeInclude
#{
#};
codeCorrect codeCorrect
#{ #{
@ -43,7 +78,10 @@ Description
codeAddSup codeAddSup
#{ #{
Pout<< "**codeAddSup**" << endl; const Time& time = mesh().time();
const scalarField& V = mesh_.V();
scalarField& heSource = eqn.source();
heSource -= 0.1*sqr(time.value())*V;
#}; #};
codeSetValue codeSetValue
@ -54,15 +92,18 @@ Description
// Dummy entry. Make dependent on above to trigger recompilation // Dummy entry. Make dependent on above to trigger recompilation
code code
#{ #{
$codeInclude
$codeCorrect $codeCorrect
$codeAddSup $codeAddSup
$codeSetValue $codeSetValue
#}; #};
} }
sourceTimeCoeffs
{
// Dummy entry // Dummy entry
rampCoeffs }
{} }
\endverbatim \endverbatim

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -173,7 +173,7 @@ void Foam::refinementFeatures::read
labelListList(0), // edgeNormals labelListList(0), // edgeNormals
labelListList(0), // featurePointNormals labelListList(0), // featurePointNormals
labelListList(0), // featurePointEdges labelListList(0), // featurePointEdges
labelList(0) // regionEdges identity(newEdges.size()) // regionEdges
); );
@ -313,6 +313,58 @@ void Foam::refinementFeatures::buildTrees(const label featI)
} }
const Foam::PtrList<Foam::indexedOctree<Foam::treeDataEdge> >&
Foam::refinementFeatures::regionEdgeTrees() const
{
if (!regionEdgeTreesPtr_.valid())
{
regionEdgeTreesPtr_.reset
(
new PtrList<indexedOctree<treeDataEdge> >(size())
);
PtrList<indexedOctree<treeDataEdge> >& trees = regionEdgeTreesPtr_();
forAll(*this, featI)
{
const extendedEdgeMesh& eMesh = operator[](featI);
const pointField& points = eMesh.points();
const edgeList& edges = eMesh.edges();
// Calculate bb of all points
treeBoundBox bb(points);
// Random number generator. Bit dodgy since not exactly random ;-)
Random rndGen(65431);
// Slightly extended bb. Slightly off-centred just so on symmetric
// geometry there are less face/edge aligned items.
bb = bb.extend(rndGen, 1e-4);
bb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
bb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
trees.set
(
featI,
new indexedOctree<treeDataEdge>
(
treeDataEdge
(
false, // do not cache bb
edges,
points,
eMesh.regionEdges()
),
bb, // overall search domain
8, // maxLevel
10, // leafsize
3.0 // duplicity
)
);
}
}
return regionEdgeTreesPtr_();
}
// Find maximum level of a shell. // Find maximum level of a shell.
void Foam::refinementFeatures::findHigherLevel void Foam::refinementFeatures::findHigherLevel
@ -543,6 +595,68 @@ void Foam::refinementFeatures::findNearestEdge
} }
void Foam::refinementFeatures::findNearestRegionEdge
(
const pointField& samples,
const scalarField& nearestDistSqr,
labelList& nearFeature,
List<pointIndexHit>& nearInfo,
vectorField& nearNormal
) const
{
nearFeature.setSize(samples.size());
nearFeature = -1;
nearInfo.setSize(samples.size());
nearInfo = pointIndexHit();
nearNormal.setSize(samples.size());
nearNormal = vector::zero;
const PtrList<indexedOctree<treeDataEdge> >& regionTrees =
regionEdgeTrees();
forAll(regionTrees, featI)
{
const indexedOctree<treeDataEdge>& regionTree = regionTrees[featI];
forAll(samples, sampleI)
{
const point& sample = samples[sampleI];
scalar distSqr;
if (nearInfo[sampleI].hit())
{
distSqr = magSqr(nearInfo[sampleI].hitPoint()-sample);
}
else
{
distSqr = nearestDistSqr[sampleI];
}
// Find anything closer than current best
pointIndexHit info = regionTree.findNearest(sample, distSqr);
if (info.hit())
{
const treeDataEdge& td = regionTree.shapes();
nearFeature[sampleI] = featI;
nearInfo[sampleI] = pointIndexHit
(
info.hit(),
info.hitPoint(),
regionTree.shapes().edgeLabels()[info.index()]
);
const edge& e = td.edges()[nearInfo[sampleI].index()];
nearNormal[sampleI] = e.vec(td.points());
nearNormal[sampleI] /= mag(nearNormal[sampleI])+VSMALL;
}
}
}
}
//void Foam::refinementFeatures::findNearestPoint //void Foam::refinementFeatures::findNearestPoint
//( //(
// const pointField& samples, // const pointField& samples,

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -69,6 +69,10 @@ private:
//- Features points //- Features points
PtrList<indexedOctree<treeDataPoint> > pointTrees_; PtrList<indexedOctree<treeDataPoint> > pointTrees_;
//- Region edge trees (demand driven)
mutable autoPtr<PtrList<indexedOctree<treeDataEdge> > >
regionEdgeTreesPtr_;
// Private Member Functions // Private Member Functions
@ -100,6 +104,8 @@ protected:
} }
const PtrList<indexedOctree<treeDataEdge> >& regionEdgeTrees() const;
public: public:
// Constructors // Constructors
@ -149,6 +155,21 @@ public:
vectorField& nearNormal vectorField& nearNormal
) const; ) const;
//- Find nearest point on nearest region edge. Sets
// - nearFeature: index of feature mesh
// - nearInfo : location on feature edge and edge index
// (note: not feature edge index but index into
// edges() directly)
// - nearNormal : local feature edge normal
void findNearestRegionEdge
(
const pointField& samples,
const scalarField& nearestDistSqr,
labelList& nearFeature,
List<pointIndexHit>& nearInfo,
vectorField& nearNormal
) const;
//- Find nearest feature point. Sets //- Find nearest feature point. Sets
// - nearFeature: index of feature mesh // - nearFeature: index of feature mesh
// - nearInfo : location on feature point and point index. // - nearInfo : location on feature point and point index.

View File

@ -55,7 +55,7 @@ Description
In between ratio 0 and 1 the gradient and value contributions are In between ratio 0 and 1 the gradient and value contributions are
weighted using the ratio field in the followig way: weighted using the ratio field in the followig way:
qConv = ratio*htcwfilm*(Tfilm - *this)*convectiveScaling_; qConv = ratio*htcwfilm*(Tfilm - *this);
qRad = (1.0 - ratio)*Qr; qRad = (1.0 - ratio)*Qr;
Then the solid can gain or loose energy through radiation or conduction Then the solid can gain or loose energy through radiation or conduction

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -39,14 +39,14 @@ Description
- 2-D, normal and tangential components - 2-D, normal and tangential components
The thermodynamic properties of the baffle material are specified via The thermodynamic properties of the baffle material are specified via
dictionary entries. dictionary entries on the master patch
\heading Patch usage \heading Patch usage
Example of the boundary condition specification: Example of the boundary condition specification:
\verbatim \verbatim
myPatch myPatch_master
{ {
type compressible::temperatureThermoBaffle; type compressible::thermalBaffle;
// Underlaying coupled boundary condition // Underlaying coupled boundary condition
Tnbr T; Tnbr T;
@ -56,16 +56,15 @@ Description
Qr none;// or none.Name of Qr field on localregion Qr none;// or none.Name of Qr field on localregion
value uniform 300; value uniform 300;
// Thermo baffle model // Baffle region name
regionName baffleRegion; // solid region name regionName baffleRegion;
infoOutput yes;
active yes; active yes;
// Solid thermo in solid region // Solid thermo in solid region
thermoType thermoType
{ {
type heSolidThermo; type heSolidThermo;
mixture pureSolidMixture; mixture pureMixture;
transport constIso; transport constIso;
thermo hConst; thermo hConst;
equationOfState rhoConst; equationOfState rhoConst;
@ -114,37 +113,40 @@ Description
thickness 0.02; thickness 0.02;
} }
// New mesh polyPatch information
bottomCoeffs
{
name "bottom";
type mappedWall;
sampleMode nearestPatchFace;
samplePatch baffle3DWall_master;
offsetMode uniform;
offset (0 0 0);
}
topCoeffs
{
name "top";
type mappedWall;
sampleMode nearestPatchFace;
samplePatch baffle3DWall_slave;
offsetMode uniform;
offset (0 0 0);
}
sideCoeffs
{
name "side";
type patch;
}
} }
\endverbatim \endverbatim
/- Slave patch on primary region
\verbatim
myPatch_slave
{
type compressible::thermalBaffle;
kappa fluidThermo;
kappaName none;
value uniform 300;
\endverbatim
/- Patches on baffle region
\verbatim
bottom
{
type compressible::thermalBaffle;
kappa solidThermo;
kappaName none;
value uniform 300;
}
top
{
type compressible::thermalBaffle;
kappa solidThermo;
kappaName none;
value uniform 300;
}
\endverbatim
SeeAlso SeeAlso
Foam::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField Foam::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
Foam::regionModels::thermalBaffleModels::thermalBaffleModel Foam::regionModels::thermalBaffleModels::thermalBaffleModel

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -26,6 +26,7 @@ License
#include "radiationModel.H" #include "radiationModel.H"
#include "absorptionEmissionModel.H" #include "absorptionEmissionModel.H"
#include "scatterModel.H" #include "scatterModel.H"
#include "sootModel.H"
#include "fvmSup.H" #include "fvmSup.H"
#include "fluidThermo.H" #include "fluidThermo.H"
@ -83,6 +84,8 @@ void Foam::radiation::radiationModel::initialise()
); );
scatter_.reset(scatterModel::New(*this, mesh_).ptr()); scatter_.reset(scatterModel::New(*this, mesh_).ptr());
soot_.reset(sootModel::New(*this, mesh_).ptr());
} }
} }
@ -110,7 +113,8 @@ Foam::radiation::radiationModel::radiationModel(const volScalarField& T)
solverFreq_(0), solverFreq_(0),
firstIter_(true), firstIter_(true),
absorptionEmission_(NULL), absorptionEmission_(NULL),
scatter_(NULL) scatter_(NULL),
soot_(NULL)
{} {}
@ -129,7 +133,8 @@ Foam::radiation::radiationModel::radiationModel
solverFreq_(1), solverFreq_(1),
firstIter_(true), firstIter_(true),
absorptionEmission_(NULL), absorptionEmission_(NULL),
scatter_(NULL) scatter_(NULL),
soot_(NULL)
{ {
if (readOpt() == IOobject::NO_READ) if (readOpt() == IOobject::NO_READ)
{ {
@ -167,7 +172,8 @@ Foam::radiation::radiationModel::radiationModel
solverFreq_(1), solverFreq_(1),
firstIter_(true), firstIter_(true),
absorptionEmission_(NULL), absorptionEmission_(NULL),
scatter_(NULL) scatter_(NULL),
soot_(NULL)
{ {
initialise(); initialise();
} }
@ -212,6 +218,11 @@ void Foam::radiation::radiationModel::correct()
calculate(); calculate();
firstIter_ = false; firstIter_ = false;
} }
if (!soot_.empty())
{
soot_->correct();
}
} }
@ -265,4 +276,22 @@ Foam::radiation::radiationModel::absorptionEmission() const
} }
const Foam::radiation::sootModel&
Foam::radiation::radiationModel::soot() const
{
if (!soot_.valid())
{
FatalErrorIn
(
"const Foam::radiation::sootModel&"
"Foam::radiation::radiationModel::soot() const"
)
<< "Requested radiation sootModel model, but model is "
<< "not activate" << abort(FatalError);
}
return soot_();
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -64,6 +64,7 @@ namespace radiation
// Forward declaration of classes // Forward declaration of classes
class absorptionEmissionModel; class absorptionEmissionModel;
class scatterModel; class scatterModel;
class sootModel;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class radiationModel Declaration Class radiationModel Declaration
@ -108,6 +109,9 @@ protected:
//- Scatter model //- Scatter model
autoPtr<scatterModel> scatter_; autoPtr<scatterModel> scatter_;
//- Soot model
autoPtr<sootModel> soot_;
private: private:
@ -232,6 +236,9 @@ public:
//- Access to absorptionEmission model //- Access to absorptionEmission model
const absorptionEmissionModel& absorptionEmission() const; const absorptionEmissionModel& absorptionEmission() const;
//- Access to soot Model
const sootModel& soot() const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -47,7 +47,10 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
: :
mixedFvPatchScalarField(p, iF), mixedFvPatchScalarField(p, iF),
temperatureCoupledBase(patch(), "undefined", "undefined-K"), temperatureCoupledBase(patch(), "undefined", "undefined-K"),
TnbrName_("undefined-Tnbr") TnbrName_("undefined-Tnbr"),
thicknessLayers_(0),
kappaLayers_(0),
contactRes_(0)
{ {
this->refValue() = 0.0; this->refValue() = 0.0;
this->refGrad() = 0.0; this->refGrad() = 0.0;
@ -66,7 +69,10 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
: :
mixedFvPatchScalarField(ptf, p, iF, mapper), mixedFvPatchScalarField(ptf, p, iF, mapper),
temperatureCoupledBase(patch(), ptf.KMethod(), ptf.kappaName()), temperatureCoupledBase(patch(), ptf.KMethod(), ptf.kappaName()),
TnbrName_(ptf.TnbrName_) TnbrName_(ptf.TnbrName_),
thicknessLayers_(ptf.thicknessLayers_),
kappaLayers_(ptf.kappaLayers_),
contactRes_(ptf.contactRes_)
{} {}
@ -80,7 +86,10 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
: :
mixedFvPatchScalarField(p, iF), mixedFvPatchScalarField(p, iF),
temperatureCoupledBase(patch(), dict), temperatureCoupledBase(patch(), dict),
TnbrName_(dict.lookup("Tnbr")) TnbrName_(dict.lookup("Tnbr")),
thicknessLayers_(0),
kappaLayers_(0),
contactRes_(0.0)
{ {
if (!isA<mappedPatchBase>(this->patch().patch())) if (!isA<mappedPatchBase>(this->patch().patch()))
{ {
@ -101,6 +110,24 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
<< exit(FatalError); << exit(FatalError);
} }
if (dict.found("thicknessLayers"))
{
dict.lookup("thicknessLayers") >> thicknessLayers_;
dict.lookup("kappaLayers") >> kappaLayers_;
if (thicknessLayers_.size() > 0)
{
forAll (thicknessLayers_, iLayer)
{
const scalar l = thicknessLayers_[iLayer];
if (l > 0.0)
{
contactRes_ += kappaLayers_[iLayer]/l;
}
}
}
}
fvPatchScalarField::operator=(scalarField("value", dict, p.size())); fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
if (dict.found("refValue")) if (dict.found("refValue"))
@ -129,7 +156,10 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
: :
mixedFvPatchScalarField(wtcsf, iF), mixedFvPatchScalarField(wtcsf, iF),
temperatureCoupledBase(patch(), wtcsf.KMethod(), wtcsf.kappaName()), temperatureCoupledBase(patch(), wtcsf.KMethod(), wtcsf.kappaName()),
TnbrName_(wtcsf.TnbrName_) TnbrName_(wtcsf.TnbrName_),
thicknessLayers_(wtcsf.thicknessLayers_),
kappaLayers_(wtcsf.kappaLayers_),
contactRes_(wtcsf.contactRes_)
{} {}
@ -155,7 +185,7 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs()
const fvPatch& nbrPatch = const fvPatch& nbrPatch =
refCast<const fvMesh>(nbrMesh).boundary()[samplePatchI]; refCast<const fvMesh>(nbrMesh).boundary()[samplePatchI];
tmp<scalarField> intFld = patchInternalField(); //tmp<scalarField> intFld = patchInternalField();
// Calculate the temperature by harmonic averaging // Calculate the temperature by harmonic averaging
@ -174,12 +204,22 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs()
); );
// Swap to obtain full local values of neighbour internal field // Swap to obtain full local values of neighbour internal field
scalarField nbrIntFld(nbrField.patchInternalField()); tmp<scalarField> nbrIntFld(new scalarField(nbrField.size(), 0.0));
mpp.distribute(nbrIntFld); tmp<scalarField> nbrKDelta(new scalarField(nbrField.size(), 0.0));
// Swap to obtain full local values of neighbour kappa*delta if (contactRes_ == 0.0)
scalarField nbrKDelta(nbrField.kappa(nbrField)*nbrPatch.deltaCoeffs()); {
mpp.distribute(nbrKDelta); nbrIntFld() = nbrField.patchInternalField();
nbrKDelta() = nbrField.kappa(nbrField)*nbrPatch.deltaCoeffs();
}
else
{
nbrIntFld() = nbrField;
nbrKDelta() = contactRes_;
}
mpp.distribute(nbrIntFld());
mpp.distribute(nbrKDelta());
tmp<scalarField> myKDelta = kappa(*this)*patch().deltaCoeffs(); tmp<scalarField> myKDelta = kappa(*this)*patch().deltaCoeffs();
@ -200,11 +240,11 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs()
// - mixFraction = nbrKDelta / (nbrKDelta + myKDelta()) // - mixFraction = nbrKDelta / (nbrKDelta + myKDelta())
this->refValue() = nbrIntFld; this->refValue() = nbrIntFld();
this->refGrad() = 0.0; this->refGrad() = 0.0;
this->valueFraction() = nbrKDelta/(nbrKDelta + myKDelta()); this->valueFraction() = nbrKDelta()/(nbrKDelta() + myKDelta());
mixedFvPatchScalarField::updateCoeffs(); mixedFvPatchScalarField::updateCoeffs();
@ -239,6 +279,9 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::write
mixedFvPatchScalarField::write(os); mixedFvPatchScalarField::write(os);
os.writeKeyword("Tnbr")<< TnbrName_ os.writeKeyword("Tnbr")<< TnbrName_
<< token::END_STATEMENT << nl; << token::END_STATEMENT << nl;
thicknessLayers_.writeEntry("thicknessLayers", os);
thicknessLayers_.writeEntry("kappaLayers", os);
temperatureCoupledBase::write(os); temperatureCoupledBase::write(os);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,11 +22,20 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::compressible::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField Foam::
compressible::
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
Description Description
Mixed boundary condition for temperature, to be used for heat-transfer Mixed boundary condition for temperature, to be used for heat-transfer
on back-to-back baffles. on back-to-back baffles.Optional thin thermal layer
resistances can be specified through thicknessLayers and kappaLayers
entries.
The thermal conductivity, \c kappa, can either be retrieved from the
mesh database using the \c lookup option, or from a \c solidThermo
or \c fluidThermo thermophysical package.
Specifies gradient and temperature such that the equations are the same Specifies gradient and temperature such that the equations are the same
on both sides: on both sides:
@ -36,13 +45,27 @@ Description
where KDelta is heat-transfer coefficient K * deltaCoeffs where KDelta is heat-transfer coefficient K * deltaCoeffs
Example usage: \heading Patch usage
myInterfacePatchName
\table
Property | Description | Required | Default value
kappa | thermal conductivity option | yes |
kappaName | name of thermal conductivity field | no |
Tnbr | name of the field | no | T
thicknessLayers | list of thicknesses per layer [m] | no |
kappaLayers | list of thermal conductivites per layer [W/m/K] | no |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{ {
type compressible::turbulentTemperatureCoupledBaffleMixed; type compressible::turbulentTemperatureCoupledBaffleMixed;
Tnbr T; Tnbr T;
kappa lookup; kappa lookup;
kappaName kappa; KappaName kappa;
thicknessLayers (0.1 0.2 0.3 0.4);
kappaLayers (1 2 3 4)
value uniform 300; value uniform 300;
} }
@ -50,15 +73,13 @@ Description
Note: kappa : heat conduction at patch. Gets supplied how to lookup Note: kappa : heat conduction at patch. Gets supplied how to lookup
calculate kappa: calculate kappa:
- 'lookup' : lookup volScalarField (or volSymmTensorField) with name - 'lookup' : lookup volScalarField (or volSymmTensorField) with name
- 'fluidThermo' : use fluidThermo and compressible::RASmodel to calculate - 'fluidThermo' : use fluidThermo and compressible::RASmodel to calculate
kappa kappa
- 'solidThermo' : use solidThermo kappa() - 'solidThermo' : use solidThermo kappa()
- 'directionalSolidThermo' directionalKappa() - 'directionalSolidThermo' directionalKappa()
Note: runs in parallel with arbitrary decomposition. Uses mapped
functionality to calculate exchange.
SourceFiles SourceFiles
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C
@ -69,6 +90,7 @@ SourceFiles
#include "mixedFvPatchFields.H" #include "mixedFvPatchFields.H"
#include "temperatureCoupledBase.H" #include "temperatureCoupledBase.H"
#include "scalarField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -91,6 +113,15 @@ class turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
//- Name of field on the neighbour region //- Name of field on the neighbour region
const word TnbrName_; const word TnbrName_;
//- Thickness of layers
scalarList thicknessLayers_;
//- Conductivity of layers
scalarList kappaLayers_;
//- Total contact resistance
scalar contactRes_;
public: public:

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -49,7 +49,10 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField
temperatureCoupledBase(patch(), "undefined", "undefined-K"), temperatureCoupledBase(patch(), "undefined", "undefined-K"),
TnbrName_("undefined-Tnbr"), TnbrName_("undefined-Tnbr"),
QrNbrName_("undefined-QrNbr"), QrNbrName_("undefined-QrNbr"),
QrName_("undefined-Qr") QrName_("undefined-Qr"),
thicknessLayers_(0),
kappaLayers_(0),
contactRes_(0)
{ {
this->refValue() = 0.0; this->refValue() = 0.0;
this->refGrad() = 0.0; this->refGrad() = 0.0;
@ -70,7 +73,10 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField
temperatureCoupledBase(patch(), psf.KMethod(), psf.kappaName()), temperatureCoupledBase(patch(), psf.KMethod(), psf.kappaName()),
TnbrName_(psf.TnbrName_), TnbrName_(psf.TnbrName_),
QrNbrName_(psf.QrNbrName_), QrNbrName_(psf.QrNbrName_),
QrName_(psf.QrName_) QrName_(psf.QrName_),
thicknessLayers_(psf.thicknessLayers_),
kappaLayers_(psf.kappaLayers_),
contactRes_(psf.contactRes_)
{} {}
@ -86,7 +92,10 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField
temperatureCoupledBase(patch(), dict), temperatureCoupledBase(patch(), dict),
TnbrName_(dict.lookupOrDefault<word>("Tnbr", "T")), TnbrName_(dict.lookupOrDefault<word>("Tnbr", "T")),
QrNbrName_(dict.lookupOrDefault<word>("QrNbr", "none")), QrNbrName_(dict.lookupOrDefault<word>("QrNbr", "none")),
QrName_(dict.lookupOrDefault<word>("Qr", "none")) QrName_(dict.lookupOrDefault<word>("Qr", "none")),
thicknessLayers_(0),
kappaLayers_(0),
contactRes_(0.0)
{ {
if (!isA<mappedPatchBase>(this->patch().patch())) if (!isA<mappedPatchBase>(this->patch().patch()))
{ {
@ -107,6 +116,24 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField
<< exit(FatalError); << exit(FatalError);
} }
if (dict.found("thicknessLayers"))
{
dict.lookup("thicknessLayers") >> thicknessLayers_;
dict.lookup("kappaLayers") >> kappaLayers_;
if (thicknessLayers_.size() > 0)
{
forAll (thicknessLayers_, iLayer)
{
const scalar l = thicknessLayers_[iLayer];
if (l > 0.0)
{
contactRes_ += kappaLayers_[iLayer]/l;
}
}
}
}
fvPatchScalarField::operator=(scalarField("value", dict, p.size())); fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
if (dict.found("refValue")) if (dict.found("refValue"))
@ -137,7 +164,10 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField
temperatureCoupledBase(patch(), psf.KMethod(), psf.kappaName()), temperatureCoupledBase(patch(), psf.KMethod(), psf.kappaName()),
TnbrName_(psf.TnbrName_), TnbrName_(psf.TnbrName_),
QrNbrName_(psf.QrNbrName_), QrNbrName_(psf.QrNbrName_),
QrName_(psf.QrName_) QrName_(psf.QrName_),
thicknessLayers_(psf.thicknessLayers_),
kappaLayers_(psf.kappaLayers_),
contactRes_(psf.contactRes_)
{} {}
@ -180,9 +210,17 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
// Swap to obtain full local values of neighbour K*delta // Swap to obtain full local values of neighbour K*delta
scalarField KDeltaNbr(nbrField.kappa(nbrField)*nbrPatch.deltaCoeffs()); tmp<scalarField> KDeltaNbr(new scalarField(TcNbr.size(), 0.0));
mpp.distribute(KDeltaNbr); if (contactRes_ == 0.0)
{
// Swap to obtain full local values of neighbour K*delta
KDeltaNbr() = nbrField.kappa(nbrField)*nbrPatch.deltaCoeffs();
}
else
{
KDeltaNbr() = contactRes_;
}
mpp.distribute(KDeltaNbr());
scalarField KDelta(kappa(*this)*patch().deltaCoeffs()); scalarField KDelta(kappa(*this)*patch().deltaCoeffs());
@ -199,16 +237,34 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
mpp.distribute(QrNbr); mpp.distribute(QrNbr);
} }
scalarField alpha(KDeltaNbr - (Qr + QrNbr)/Tp); scalarField alpha(KDeltaNbr() - (Qr + QrNbr)/Tp);
valueFraction() = alpha/(alpha + KDelta); valueFraction() = alpha/(alpha + KDelta);
refValue() = (KDeltaNbr*TcNbr)/alpha; refValue() = (KDeltaNbr()*TcNbr)/alpha;
mixedFvPatchScalarField::updateCoeffs();
if (debug)
{
scalar Q = gSum(kappa(*this)*patch().magSf()*snGrad());
Info<< patch().boundaryMesh().mesh().name() << ':'
<< patch().name() << ':'
<< this->dimensionedInternalField().name() << " <- "
<< nbrMesh.name() << ':'
<< nbrPatch.name() << ':'
<< this->dimensionedInternalField().name() << " :"
<< " heat transfer rate:" << Q
<< " walltemperature "
<< " min:" << gMin(*this)
<< " max:" << gMax(*this)
<< " avg:" << gAverage(*this)
<< endl;
}
// Restore tag // Restore tag
UPstream::msgType() = oldTag; UPstream::msgType() = oldTag;
mixedFvPatchScalarField::updateCoeffs();
} }
@ -221,6 +277,10 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::write
os.writeKeyword("Tnbr")<< TnbrName_ << token::END_STATEMENT << nl; os.writeKeyword("Tnbr")<< TnbrName_ << token::END_STATEMENT << nl;
os.writeKeyword("QrNbr")<< QrNbrName_ << token::END_STATEMENT << nl; os.writeKeyword("QrNbr")<< QrNbrName_ << token::END_STATEMENT << nl;
os.writeKeyword("Qr")<< QrName_ << token::END_STATEMENT << nl; os.writeKeyword("Qr")<< QrName_ << token::END_STATEMENT << nl;
os.writeKeyword("Qr")<< QrName_ << token::END_STATEMENT << nl;
thicknessLayers_.writeEntry("thicknessLayers", os);
thicknessLayers_.writeEntry("kappaLayers", os);
temperatureCoupledBase::write(os); temperatureCoupledBase::write(os);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -28,17 +28,39 @@ Class
Description Description
Mixed boundary condition for temperature and radiation heat transfer Mixed boundary condition for temperature and radiation heat transfer
to be used for in multiregion cases to be used for in multiregion cases. Optional thin thermal layer
resistances can be specified through thicknessLayers and kappaLayers
entries.
Example usage: The thermal conductivity, \c kappa, can either be retrieved from the
myInterfacePatchName mesh database using the \c lookup option, or from a \c solidThermo
or \c fluidThermo thermophysical package.
\heading Patch usage
\table
Property | Description | Required | Default value
kappa | thermal conductivity option | yes |
kappaName | name of thermal conductivity field | no |
Tnbr | name of the field | no | T
QrNbr | name of the radiative flux in the nbr region | no | none
Qr | name of the radiative flux in this region | no | none
thicknessLayers | list of thicknesses per layer [m] | no |
kappaLayers | list of thermal conductivites per layer [W/m/K] | no |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{ {
type compressible::turbulentTemperatureRadCoupledMixed; type compressible::turbulentTemperatureRadCoupledMixed;
Tnbr T; // name of T field on neighbour region Tnbr T;
kappa lookup; kappa lookup;
KappaName kappa; KappaName kappa;
QrNbr Qr; // or none. Name of Qr field on neighbour region QrNbr Qr; // or none. Name of Qr field on neighbour region
Qr Qr; // or none. Name of Qr field on local region Qr Qr; // or none. Name of Qr field on local region
thicknessLayers (0.1 0.2 0.3 0.4);
kappaLayers (1 2 3 4)
value uniform 300; value uniform 300;
} }
@ -52,9 +74,6 @@ Description
- 'solidThermo' : use solidThermo kappa() - 'solidThermo' : use solidThermo kappa()
- 'directionalSolidThermo' directionalKappa() - 'directionalSolidThermo' directionalKappa()
Note: runs in parallel with arbitrary decomposition. Uses mapped
functionality to calculate exchange.
SourceFiles SourceFiles
turbulentTemperatureRadCoupledMixedFvPatchScalarField.C turbulentTemperatureRadCoupledMixedFvPatchScalarField.C
@ -65,6 +84,7 @@ SourceFiles
#include "mixedFvPatchFields.H" #include "mixedFvPatchFields.H"
#include "temperatureCoupledBase.H" #include "temperatureCoupledBase.H"
#include "scalarList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -93,6 +113,15 @@ class turbulentTemperatureRadCoupledMixedFvPatchScalarField
//- Name of the radiative heat flux in local region //- Name of the radiative heat flux in local region
const word QrName_; const word QrName_;
//- Thickness of layers
scalarList thicknessLayers_;
//- Conductivity of layers
scalarList kappaLayers_;
//- Total contact resistance
scalar contactRes_;
public: public:

View File

@ -16,11 +16,12 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation on;
radiationModel opaqueSolid; radiationModel opaqueSolid;
absorptionEmissionModel greyMeanSolidAbsorptionEmission; absorptionEmissionModel greyMeanSolidAbsorptionEmission;
greyMeanSolidAbsorptionEmissionCoeffs greyMeanSolidAbsorptionEmissionCoeffs
{ {
wood wood

View File

@ -34,7 +34,7 @@ solvers
p_rgh p_rgh
{ {
solver GAMG; solver GAMG;
tolerance 1e-7; tolerance 1e-6;
relTol 0.01; relTol 0.01;
smoother GaussSeidel; smoother GaussSeidel;
cacheAgglomeration true; cacheAgglomeration true;
@ -46,7 +46,7 @@ solvers
p_rghFinal p_rghFinal
{ {
$p_rgh; $p_rgh;
tolerance 1e-7; tolerance 1e-6;
relTol 0; relTol 0;
}; };
@ -55,7 +55,7 @@ solvers
{ {
solver PBiCG; solver PBiCG;
preconditioner DILU; preconditioner DILU;
tolerance 1e-7; tolerance 1e-6;
relTol 0.1; relTol 0.1;
nSweeps 1; nSweeps 1;
}; };
@ -63,19 +63,11 @@ solvers
"(U|Yi|k|h|omega)Final" "(U|Yi|k|h|omega)Final"
{ {
$U; $U;
tolerance 1e-7; tolerance 1e-6;
relTol 0; relTol 0;
}; };
"(h|hFinal|Yi)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-8;
relTol 0;
};
Ii Ii
{ {
solver GAMG; solver GAMG;
@ -105,7 +97,7 @@ PIMPLE
{ {
momentumPredictor yes; momentumPredictor yes;
nOuterCorrectors 1; nOuterCorrectors 1;
nCorrectors 3; nCorrectors 2;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
} }

View File

@ -32,8 +32,8 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default none; default none;
laplacian(thermo:alpha,h) Gauss linear uncorrected; laplacian(thermo:alpha,h) Gauss linear corrected;
laplacian(kappa,T) Gauss harmonic uncorrected; laplacian(kappa,T) Gauss harmonic corrected;
} }
interpolationSchemes interpolationSchemes
@ -43,7 +43,7 @@ interpolationSchemes
snGradSchemes snGradSchemes
{ {
default uncorrected; default corrected;
} }
fluxRequired fluxRequired

View File

@ -23,7 +23,7 @@ boundaryField
{ {
".*" ".*"
{ {
type calculate; type calculated;
} }
frontAndBack frontAndBack

View File

@ -0,0 +1,53 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
5
(
base
{
type patch;
nFaces 134;
startFace 44700;
}
outlet
{
type patch;
nFaces 150;
startFace 44834;
}
sides
{
type patch;
nFaces 300;
startFace 44984;
}
frontAndBack
{
type empty;
inGroups 1(empty);
nFaces 45000;
startFace 45284;
}
inlet
{
type patch;
nFaces 16;
startFace 90284;
}
)
// ************************************************************************* //

View File

@ -22,22 +22,22 @@ solvers
{ {
solver PCG; solver PCG;
preconditioner DIC; preconditioner DIC;
tolerance 1e-7; tolerance 1e-6;
relTol 0.1; relTol 0.1;
}; };
rhoFinal rhoFinal
{ {
$rho; $rho;
tolerance 1e-7; tolerance 1e-6;
relTol 0; relTol 0;
}; };
p_rgh p_rgh
{ {
solver GAMG; solver GAMG;
tolerance 1e-7; tolerance 1e-6;
relTol 0.01; relTol 0.05;
smoother GaussSeidel; smoother GaussSeidel;
cacheAgglomeration true; cacheAgglomeration true;
nCellsInCoarsestLevel 10; nCellsInCoarsestLevel 10;
@ -48,7 +48,7 @@ solvers
p_rghFinal p_rghFinal
{ {
$p_rgh; $p_rgh;
tolerance 1e-7; tolerance 1e-6;
relTol 0; relTol 0;
}; };
@ -57,7 +57,7 @@ solvers
{ {
solver PBiCG; solver PBiCG;
preconditioner DILU; preconditioner DILU;
tolerance 1e-7; tolerance 1e-6;
relTol 0.1; relTol 0.1;
nSweeps 1; nSweeps 1;
}; };
@ -65,7 +65,7 @@ solvers
"(U|Yi|k|h|omega)Final" "(U|Yi|k|h|omega)Final"
{ {
$U; $U;
tolerance 1e-7; tolerance 1e-6;
relTol 0; relTol 0;
}; };

View File

@ -22,13 +22,13 @@ startTime 0.0;
stopAt endTime; stopAt endTime;
endTime 0.75; endTime 4.0;
deltaT 0.001; deltaT 0.001;
writeControl adjustableRunTime; writeControl adjustableRunTime;
writeInterval 0.5; writeInterval 0.1;
purgeWrite 0; purgeWrite 0;
@ -48,7 +48,7 @@ runTimeModifiable yes;
adjustTimeStep yes; adjustTimeStep yes;
maxCo 0.5; maxCo 0.6;
maxDeltaT 0.1; maxDeltaT 0.1;

View File

@ -21,14 +21,14 @@ solvers
{ {
solver PCG; solver PCG;
preconditioner DIC; preconditioner DIC;
tolerance 1e-7; tolerance 1e-6;
relTol 0; relTol 0;
}; };
p_rgh p_rgh
{ {
solver GAMG; solver GAMG;
tolerance 1e-7; tolerance 1e-6;
relTol 0.1; relTol 0.1;
smoother GaussSeidel; smoother GaussSeidel;
cacheAgglomeration true; cacheAgglomeration true;
@ -40,7 +40,7 @@ solvers
p_rghFinal p_rghFinal
{ {
$p_rgh; $p_rgh;
tolerance 1e-8; tolerance 1e-6;
relTol 0; relTol 0;
}; };
@ -49,7 +49,7 @@ solvers
{ {
solver PBiCG; solver PBiCG;
preconditioner DILU; preconditioner DILU;
tolerance 1e-7; tolerance 1e-6;
relTol 0.1; relTol 0.1;
nSweeps 1; nSweeps 1;
}; };
@ -57,7 +57,7 @@ solvers
"(U|Yi|k|h)Final" "(U|Yi|k|h)Final"
{ {
$U; $U;
tolerance 1e-8; tolerance 1e-6;
relTol 0; relTol 0;
}; };
@ -90,7 +90,7 @@ PIMPLE
{ {
momentumPredictor yes; momentumPredictor yes;
nOuterCorrectors 1; nOuterCorrectors 1;
nCorrectors 3; nCorrectors 2;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
} }

View File

@ -9,45 +9,42 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class polyBoundaryMesh;
object thermophysicalProperties; location "constant/polyMesh";
object boundary;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType 4
(
frontAndBack
{ {
type heSolidThermo; type wall;
mixture pureMixture; inGroups 1(wall);
transport constIso; nFaces 1050;
thermo hConst; startFace 228225;
equationOfState rhoConst;
specie specie;
energy sensibleEnthalpy;
} }
topAndBottom
mixture
{ {
specie type wall;
inGroups 1(wall);
nFaces 10500;
startFace 229275;
}
hot
{ {
nMoles 1; type wall;
molWeight 12; inGroups 1(wall);
nFaces 2250;
startFace 239775;
} }
cold
transport
{ {
kappa 80; type wall;
} inGroups 1(wall);
nFaces 2250;
thermodynamics startFace 242025;
{
Hf 0;
Cp 450;
}
equationOfState
{
rho 8000;
}
} }
)
// ************************************************************************* // // ************************************************************************* //

View File

@ -9,45 +9,42 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class polyBoundaryMesh;
object thermophysicalProperties; location "constant/polyMesh";
object boundary;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType 4
(
frontAndBack
{ {
type heSolidThermo; type wall;
mixture pureMixture; inGroups 1(wall);
transport constIso; nFaces 1050;
thermo hConst; startFace 228225;
equationOfState rhoConst;
specie specie;
energy sensibleEnthalpy;
} }
topAndBottom
mixture
{ {
specie type wall;
inGroups 1(wall);
nFaces 10500;
startFace 229275;
}
hot
{ {
nMoles 1; type wall;
molWeight 12; inGroups 1(wall);
nFaces 2250;
startFace 239775;
} }
cold
transport
{ {
kappa 80; type wall;
} inGroups 1(wall);
nFaces 2250;
thermodynamics startFace 242025;
{
Hf 0;
Cp 450;
}
equationOfState
{
rho 8000;
}
} }
)
// ************************************************************************* // // ************************************************************************* //

View File

@ -15,43 +15,35 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
6 4
( (
maxY box
{ {
type wall; type wall;
inGroups 1(wall);
nFaces 300; nFaces 300;
startFace 8300; startFace 303675;
} }
minX floor
{
type patch;
nFaces 100;
startFace 8600;
}
maxX
{
type patch;
nFaces 100;
startFace 8700;
}
minY
{ {
type wall; type wall;
nFaces 300; inGroups 1(wall);
startFace 8800; nFaces 5125;
startFace 303975;
} }
minZ ceiling
{ {
type wall; type wall;
nFaces 300; inGroups 1(wall);
startFace 9100; nFaces 5225;
startFace 309100;
} }
maxZ fixedWalls
{ {
type wall; type wall;
nFaces 300; inGroups 1(wall);
startFace 9400; nFaces 6000;
startFace 314325;
} }
) )

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation on;
radiationModel P1; radiationModel P1;
// Number of flow iterations per radiation iteration // Number of flow iterations per radiation iteration
@ -31,5 +33,7 @@ constantAbsorptionEmissionCoeffs
scatterModel none; scatterModel none;
sootModel none;
// ************************************************************************* // // ************************************************************************* //

View File

@ -15,43 +15,35 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
6 4
( (
maxY box
{ {
type wall; type wall;
inGroups 1(wall);
nFaces 300; nFaces 300;
startFace 8300; startFace 303675;
} }
minX floor
{
type patch;
nFaces 100;
startFace 8600;
}
maxX
{
type patch;
nFaces 100;
startFace 8700;
}
minY
{ {
type wall; type wall;
nFaces 300; inGroups 1(wall);
startFace 8800; nFaces 5125;
startFace 303975;
} }
minZ ceiling
{ {
type wall; type wall;
nFaces 300; inGroups 1(wall);
startFace 9100; nFaces 5225;
startFace 309100;
} }
maxZ fixedWalls
{ {
type wall; type wall;
nFaces 300; inGroups 1(wall);
startFace 9400; nFaces 6000;
startFace 314325;
} }
) )

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation on;
radiationModel fvDOM; radiationModel fvDOM;
fvDOMCoeffs fvDOMCoeffs
@ -23,6 +25,7 @@ fvDOMCoeffs
nTheta 5; // polar angles in PI (from Z to X-Y plane) nTheta 5; // polar angles in PI (from Z to X-Y plane)
convergence 1e-3; // convergence criteria for radiation iteration convergence 1e-3; // convergence criteria for radiation iteration
maxIter 10; // maximum number of iterations maxIter 10; // maximum number of iterations
cacheDiv false;
} }
// Number of flow iterations per radiation iteration // Number of flow iterations per radiation iteration
@ -32,12 +35,13 @@ absorptionEmissionModel constantAbsorptionEmission;
constantAbsorptionEmissionCoeffs constantAbsorptionEmissionCoeffs
{ {
absorptivity absorptivity [ 0 -1 0 0 0 0 0 ] 0.01; absorptivity absorptivity [ m^-1 ] 0.5;
emissivity emissivity [ 0 -1 0 0 0 0 0 ] 0.01; emissivity emissivity [ m^-1 ] 0.5;
E E [ 1 -1 -3 0 0 0 0 ] 0; E E [ kg m^-1 s^-3 ] 0;
} }
scatterModel none; scatterModel none;
sootModel none;
// ************************************************************************* // // ************************************************************************* //

View File

@ -33,7 +33,7 @@ divSchemes
div(phi,h) bounded Gauss upwind; div(phi,h) bounded Gauss upwind;
div(phi,k) bounded Gauss upwind; div(phi,k) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind; div(phi,epsilon) bounded Gauss upwind;
div(Ji,Ii_h) Gauss linearUpwind grad(Ii_h); div(Ji,Ii_h) bounded Gauss linearUpwind grad(Ii_h);
div((muEff*dev2(T(grad(U))))) Gauss linear; div((muEff*dev2(T(grad(U))))) Gauss linear;
} }

View File

@ -19,17 +19,28 @@ solvers
{ {
p_rgh p_rgh
{ {
solver GAMG; solver PCG;
preconditioner DIC;
tolerance 1e-06; tolerance 1e-06;
relTol 0.01; relTol 0.01;
smoother GaussSeidel; }
Ii
{
solver GAMG;
tolerance 1e-4;
relTol 0;
smoother symGaussSeidel;
cacheAgglomeration true; cacheAgglomeration true;
nCellsInCoarsestLevel 10; nCellsInCoarsestLevel 10;
agglomerator faceAreaPair; agglomerator faceAreaPair;
mergeLevels 1; mergeLevels 1;
maxIter 5;
nPreSweeps 0;
nPostSweeps 1;
} }
"(U|h|k|epsilon|Ii)" "(U|h|k|epsilon)"
{ {
solver PBiCG; solver PBiCG;
preconditioner DILU; preconditioner DILU;
@ -53,6 +64,7 @@ SIMPLE
// possibly check turbulence fields // possibly check turbulence fields
"(k|epsilon|omega)" 1e-3; "(k|epsilon|omega)" 1e-3;
"ILambda.*" 1e-3;
} }
} }
@ -61,14 +73,14 @@ relaxationFactors
fields fields
{ {
rho 1.0; rho 1.0;
p_rgh 0.3; p_rgh 0.7;
} }
equations equations
{ {
U 0.7; U 0.2;
h 0.7; h 0.2;
k 0.7; k 0.5;
epsilon 0.7; epsilon 0.5;
"ILambda.*" 0.7; "ILambda.*" 0.7;
} }
} }

View File

@ -1,39 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 300;
boundaryField
{
floor
{
type fixedValue;
value uniform 300;
}
ceiling
{
type fixedValue;
value uniform 300;
}
fixedWalls
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -1,39 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 300;
boundaryField
{
floor
{
type fixedValue;
value uniform 300;
}
ceiling
{
type fixedValue;
value uniform 300;
}
fixedWalls
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -1,42 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 1e5;
boundaryField
{
floor
{
type calculated;
value $internalField;
}
ceiling
{
type calculated;
value $internalField;
}
fixedWalls
{
type calculated;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -1,10 +0,0 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase
cp 0/T.org 0/T
# ----------------------------------------------------------------- end-of-file

View File

@ -1,13 +0,0 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
application=`getApplication`
runApplication blockMesh
runApplication setFields
runApplication $application
# ----------------------------------------------------------------- end-of-file

View File

@ -1,25 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object RASProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
RASModel kEpsilon;
turbulence on;
printCoeffs on;
// ************************************************************************* //

View File

@ -1,21 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value (0 -9.81 0);
// ************************************************************************* //

View File

@ -1,75 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(0 0 0)
(10 0 0)
(10 5 0)
(0 5 0)
(0 0 10)
(10 0 10)
(10 5 10)
(0 5 10)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (20 10 20) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
floor
{
type wall;
faces
(
(1 5 4 0)
);
}
ceiling
{
type wall;
faces
(
(3 7 6 2)
);
}
fixedWalls
{
type wall;
faces
(
(0 4 7 3)
(2 6 5 1)
(0 3 2 1)
(4 5 6 7)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -1,51 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType
{
type heRhoThermo;
mixture pureMixture;
transport const;
thermo hConst;
energy sensibleEnthalpy;
equationOfState perfectGas;
specie specie;
}
pRef 100000;
mixture
{
specie
{
nMoles 1;
molWeight 28.9;
}
thermodynamics
{
Cp 1000;
Hf 0;
}
transport
{
mu 1.8e-05;
Pr 0.7;
}
}
// ************************************************************************* //

View File

@ -1,49 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application buoyantSimpleFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 1000;
deltaT 1;
writeControl timeStep;
writeInterval 100;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //

View File

@ -1,61 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default steadyState;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phi,U) bounded Gauss upwind;
div(phi,h) bounded Gauss upwind;
div(phi,K) bounded Gauss upwind;
div(phi,k) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
div((muEff*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear uncorrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p_rgh;
}
// ************************************************************************* //

View File

@ -1,71 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p_rgh
{
solver PCG;
preconditioner DIC;
tolerance 1e-8;
relTol 0.01;
}
"(U|h|e|k|epsilon|R)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-6;
relTol 0.1;
}
}
SIMPLE
{
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;
residualControl
{
p_rgh 1e-2;
U 1e-3;
h 1e-3;
e 1e-3;
// possibly check turbulence fields
"(k|epsilon|omega)" 1e-3;
}
}
relaxationFactors
{
fields
{
rho 1.0;
p_rgh 0.7;
}
equations
{
U 0.3;
"(h|e)" 0.3;
"(k|epsilon|R)" 0.5;
}
}
// ************************************************************************* //

View File

@ -1,37 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defaultFieldValues
(
volScalarFieldValue T 300
);
regions
(
// Set patch values (using ==)
boxToFace
{
box (4.5 -1000 4.5) (5.5 1e-5 5.5);
fieldValues
(
volScalarFieldValue T 600
);
}
);
// ************************************************************************* //

View File

@ -0,0 +1,77 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0/bottomWater";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 0 0 1 0 0 0 ];
internalField uniform 300;
boundaryField
{
minX
{
type fixedValue;
value uniform 300;
}
maxX
{
type inletOutlet;
value uniform 300;
inletValue uniform 300;
}
minY
{
type zeroGradient;
value uniform 300;
}
minZ
{
type zeroGradient;
value uniform 300;
}
maxZ
{
type zeroGradient;
value uniform 300;
}
bottomWater_to_rightSolid
{
type compressible::turbulentTemperatureCoupledBaffleMixed;
value uniform 300;
Tnbr T;
kappa fluidThermo;
kappaName none;
}
bottomWater_to_leftSolid
{
type compressible::turbulentTemperatureCoupledBaffleMixed;
value uniform 300;
Tnbr T;
kappa fluidThermo;
kappaName none;
}
bottomWater_to_heater
{
type compressible::turbulentTemperatureCoupledBaffleMixed;
value uniform 300;
Tnbr T;
kappa fluidThermo;
kappaName none;
}
}
// ************************************************************************* //

View File

@ -10,33 +10,59 @@ FoamFile
version 2.0; version 2.0;
format ascii; format ascii;
class volVectorField; class volVectorField;
location "0/bottomWater";
object U; object U;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 1 -1 0 0 0 0 ]; dimensions [ 0 1 -1 0 0 0 0 ];
internalField uniform (0 0 0); internalField uniform ( 0.001 0 0 );
boundaryField boundaryField
{ {
floor minX
{
type fixedValue;
value uniform ( 0.001 0 0 );
}
maxX
{
type inletOutlet;
value uniform ( 0.01 0 0 );
inletValue uniform ( 0 0 0 );
}
minY
{ {
type fixedValue; type fixedValue;
value uniform ( 0 0 0 ); value uniform ( 0 0 0 );
} }
minZ
{
type fixedValue;
value uniform ( 0 0 0 );
}
maxZ
{
type fixedValue;
value uniform ( 0 0 0 );
}
bottomWater_to_rightSolid
{
type fixedValue;
value uniform ( 0 0 0 );
}
bottomWater_to_leftSolid
{
type fixedValue;
value uniform ( 0 0 0 );
}
bottomWater_to_heater
{
type fixedValue;
value uniform ( 0 0 0 );
}
}
ceiling
{
type fixedValue;
value uniform (0 0 0);
}
fixedWalls
{
type fixedValue;
value uniform (0 0 0);
}
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -10,39 +10,50 @@ FoamFile
version 2.0; version 2.0;
format ascii; format ascii;
class volScalarField; class volScalarField;
location "0"; location "0/bottomWater";
object mut; object cellToRegion;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0]; dimensions [0 0 0 0 0 0 0];
internalField uniform 0; internalField uniform 0;
boundaryField boundaryField
{ {
floor minX
{ {
type mutkWallFunction; type zeroGradient;
Cmu 0.09; }
kappa 0.41; maxX
E 9.8; {
type zeroGradient;
}
minY
{
type zeroGradient;
}
minZ
{
type zeroGradient;
}
maxZ
{
type zeroGradient;
}
bottomWater_to_rightSolid
{
type calculated;
value uniform 0; value uniform 0;
} }
ceiling bottomWater_to_leftSolid
{ {
type mutkWallFunction; type calculated;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0; value uniform 0;
} }
fixedWalls bottomWater_to_heater
{ {
type mutkWallFunction; type calculated;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0; value uniform 0;
} }
} }

View File

@ -10,7 +10,7 @@ FoamFile
version 2.0; version 2.0;
format ascii; format ascii;
class volScalarField; class volScalarField;
location "0"; location "0/bottomWater";
object epsilon; object epsilon;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -21,28 +21,45 @@ internalField uniform 0.01;
boundaryField boundaryField
{ {
floor minX
{ {
type compressible::epsilonWallFunction; type fixedValue;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0.01; value uniform 0.01;
} }
ceiling maxX
{
type inletOutlet;
value uniform 0.01;
inletValue uniform 0.01;
}
minY
{ {
type compressible::epsilonWallFunction; type compressible::epsilonWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0.01; value uniform 0.01;
} }
fixedWalls minZ
{
type compressible::epsilonWallFunction;
value uniform 0.01;
}
maxZ
{
type compressible::epsilonWallFunction;
value uniform 0.01;
}
bottomWater_to_rightSolid
{
type compressible::epsilonWallFunction;
value uniform 0.01;
}
bottomWater_to_leftSolid
{
type compressible::epsilonWallFunction;
value uniform 0.01;
}
bottomWater_to_heater
{ {
type compressible::epsilonWallFunction; type compressible::epsilonWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0.01; value uniform 0.01;
} }
} }

View File

@ -10,7 +10,7 @@ FoamFile
version 2.0; version 2.0;
format ascii; format ascii;
class volScalarField; class volScalarField;
location "0"; location "0/bottomWater";
object k; object k;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -21,17 +21,43 @@ internalField uniform 0.1;
boundaryField boundaryField
{ {
floor minX
{
type inletOutlet;
value uniform 0.1;
inletValue uniform 0.1;
}
maxX
{
type zeroGradient;
value uniform 0.1;
}
minY
{ {
type compressible::kqRWallFunction; type compressible::kqRWallFunction;
value uniform 0.1; value uniform 0.1;
} }
ceiling minZ
{ {
type compressible::kqRWallFunction; type compressible::kqRWallFunction;
value uniform 0.1; value uniform 0.1;
} }
fixedWalls maxZ
{
type compressible::kqRWallFunction;
value uniform 0.1;
}
bottomWater_to_rightSolid
{
type compressible::kqRWallFunction;
value uniform 0.1;
}
bottomWater_to_leftSolid
{
type compressible::kqRWallFunction;
value uniform 0.1;
}
bottomWater_to_heater
{ {
type compressible::kqRWallFunction; type compressible::kqRWallFunction;
value uniform 0.1; value uniform 0.1;

View File

@ -10,33 +10,55 @@ FoamFile
version 2.0; version 2.0;
format ascii; format ascii;
class volScalarField; class volScalarField;
location "0"; location "0/bottomWater";
object alphat; object p;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0]; dimensions [ 1 -1 -2 0 0 0 0 ];
internalField uniform 0; internalField uniform 0;
boundaryField boundaryField
{ {
floor minX
{ {
type compressible::alphatWallFunction; type calculated;
Prt 0.85;
value uniform 0; value uniform 0;
} }
ceiling maxX
{ {
type compressible::alphatWallFunction; type calculated;
Prt 0.85;
value uniform 0; value uniform 0;
} }
fixedWalls minY
{ {
type compressible::alphatWallFunction; type calculated;
Prt 0.85; value uniform 0;
}
minZ
{
type calculated;
value uniform 0;
}
maxZ
{
type calculated;
value uniform 0;
}
bottomWater_to_rightSolid
{
type calculated;
value uniform 0;
}
bottomWater_to_leftSolid
{
type calculated;
value uniform 0;
}
bottomWater_to_heater
{
type calculated;
value uniform 0; value uniform 0;
} }
} }

View File

@ -10,33 +10,58 @@ FoamFile
version 2.0; version 2.0;
format ascii; format ascii;
class volScalarField; class volScalarField;
location "0/bottomWater";
object p_rgh; object p_rgh;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 1 -1 -2 0 0 0 0 ]; dimensions [ 1 -1 -2 0 0 0 0 ];
internalField uniform 1e5; internalField uniform 0;
boundaryField boundaryField
{ {
floor minX
{
type zeroGradient;
value uniform 0;
}
maxX
{
type fixedValue;
value uniform 0;
}
minY
{ {
type fixedFluxPressure; type fixedFluxPressure;
value uniform 1e5; value uniform 0;
}
minZ
{
type fixedFluxPressure;
value uniform 0;
}
maxZ
{
type fixedFluxPressure;
value uniform 0;
}
bottomWater_to_rightSolid
{
type fixedFluxPressure;
value uniform 0;
}
bottomWater_to_leftSolid
{
type fixedFluxPressure;
value uniform 0;
}
bottomWater_to_heater
{
type fixedFluxPressure;
value uniform 0;
}
} }
ceiling
{
type fixedFluxPressure;
value uniform 1e5;
}
fixedWalls
{
type fixedFluxPressure;
value uniform 1e5;
}
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -13,7 +13,7 @@ rm -rf 0/heater
rm -rf 0/leftSolid rm -rf 0/leftSolid
rm -rf 0/rightSolid rm -rf 0/rightSolid
rm -f 0/cellToRegion rm -f 0/cellToRegion
rm -rf constant/bottomAir/polyMesh rm -rf constant/bottomWater/polyMesh
rm -rf constant/topAir/polyMesh rm -rf constant/topAir/polyMesh
rm -rf constant/heater/polyMesh rm -rf constant/heater/polyMesh
rm -rf constant/leftSolid/polyMesh rm -rf constant/leftSolid/polyMesh

View File

@ -16,7 +16,7 @@ do
done done
for i in bottomAir topAir heater leftSolid rightSolid for i in bottomWater topAir heater leftSolid rightSolid
do do
changeDictionary -region $i > log.changeDictionary.$i 2>&1 changeDictionary -region $i > log.changeDictionary.$i 2>&1
done done

View File

@ -1,49 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant/bottomAir";
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType
{
type heRhoThermo;
mixture pureMixture;
transport const;
thermo hConst;
equationOfState perfectGas;
specie specie;
energy sensibleEnthalpy;
}
mixture
{
specie
{
nMoles 1;
molWeight 28.9;
}
thermodynamics
{
Cp 1000;
Hf 0;
}
transport
{
mu 1.8e-05;
Pr 0.7;
}
}
// ************************************************************************* //

View File

@ -16,6 +16,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation on;
radiationModel opaqueSolid; radiationModel opaqueSolid;
absorptionEmissionModel constantAbsorptionEmission; absorptionEmissionModel constantAbsorptionEmission;
@ -29,5 +31,6 @@ constantAbsorptionEmissionCoeffs
scatterModel none; scatterModel none;
sootModel none;
// ************************************************************************* // // ************************************************************************* //

View File

@ -1,33 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object radiationProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiationModel opaqueSolid;
absorptionEmissionModel constantAbsorptionEmission;
constantAbsorptionEmissionCoeffs
{
absorptivity absorptivity [ 0 -1 0 0 0 0 0 ] 0.0; //opaque
emissivity emissivity [ 0 -1 0 0 0 0 0 ] 0.1;
E E [ 1 -1 -3 0 0 0 0 ] 0;
}
scatterModel none;
// ************************************************************************* //

View File

@ -0,0 +1 @@
../heater/radiationProperties

View File

@ -17,7 +17,7 @@ FoamFile
regions regions
( (
fluid (bottomAir topAir) fluid (bottomWater topAir)
solid (heater leftSolid rightSolid) solid (heater leftSolid rightSolid)
); );

View File

@ -1,33 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object radiationProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiationModel opaqueSolid;
absorptionEmissionModel constantAbsorptionEmission;
constantAbsorptionEmissionCoeffs
{
absorptivity absorptivity [ 0 -1 0 0 0 0 0 ] 0.0; //opaque
emissivity emissivity [ 0 -1 0 0 0 0 0 ] 0.1;
E E [ 1 -1 -3 0 0 0 0 ] 0;
}
scatterModel none;
// ************************************************************************* //

View File

@ -0,0 +1 @@
../heater/radiationProperties

View File

@ -1,24 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object RASProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
RASModel laminar;
turbulence on;
printCoeffs on;
// ************************************************************************* //

View File

@ -1,20 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value (0 -9.81 0);
// ************************************************************************* //

View File

@ -0,0 +1 @@
../bottomWater/g

View File

@ -1,22 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object radiationProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel none;
// ************************************************************************* //

View File

@ -0,0 +1 @@
../bottomWater/radiationProperties

View File

@ -10,7 +10,7 @@ FoamFile
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class dictionary;
location "constant/topAir"; location "constant/bottomAir";
object thermophysicalProperties; object thermophysicalProperties;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

Some files were not shown because too many files have changed in this diff Show More