Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
laurence
2012-03-30 08:54:05 +01:00
14 changed files with 282 additions and 109 deletions

View File

@ -36,7 +36,6 @@ Description
(nonuniformTransform)cyclic \<zoneA\>_\<zoneB\> (nonuniformTransform)cyclic \<zoneA\>_\<zoneB\>
- extrudes into master direction (i.e. away from the owner cell - extrudes into master direction (i.e. away from the owner cell
if flipMap is false) if flipMap is false)
- not parallel
\verbatim \verbatim

View File

@ -47,12 +47,14 @@ formatOptions
} }
// interpolationScheme. choice of // interpolationScheme. choice of
// cell : use cell-centre value only; constant over cells (default) // cell : use cell-centre value only; constant over cells
// (default)
// cellPoint : use cell-centre and vertex values // cellPoint : use cell-centre and vertex values
// cellPointFace : use cell-centre, vertex and face values. // cellPointFace : use cell-centre, vertex and face values.
// pointMVC : use point values only (Mean Value Coordinates) // pointMVC : use point values only (Mean Value Coordinates)
// cellPatchConstrained : use cell-centre except on boundary faces where // cellPatchConstrained : like 'cell' but uses cell-centre except on
// it uses the boundary value. For use with e.g. patchCloudSet. // boundary faces where it uses the boundary value.
// For use with e.g. patchCloudSet.
// 1] vertex values determined from neighbouring cell-centre values // 1] vertex values determined from neighbouring cell-centre values
// 2] face values determined using the current face interpolation scheme // 2] face values determined using the current face interpolation scheme
// for the field (linear, gamma, etc.) // for the field (linear, gamma, etc.)

View File

@ -486,7 +486,7 @@ int main(int argc, char *argv[])
( (
"dict", "dict",
"word", "word",
"name of dictionary to provide feature extraction information" "specify alternative dictionary for the feature extraction information"
); );
# include "setRootCase.H" # include "setRootCase.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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -36,7 +36,22 @@ Foam::UniformDimensionedField<Type>::UniformDimensionedField
: :
regIOobject(io), regIOobject(io),
dimensioned<Type>(dt) dimensioned<Type>(dt)
{} {
// Read value
if
(
(
io.readOpt() == IOobject::MUST_READ
|| io.readOpt() == IOobject::MUST_READ_IF_MODIFIED
)
|| (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{
dictionary dict(readStream(typeName));
this->dimensions().reset(dict.lookup("dimensions"));
dict.lookup("value") >> this->value();
}
}
template<class Type> template<class Type>

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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -64,7 +64,7 @@ public:
// Constructors // Constructors
//- Construct from components //- Construct from components. Either reads or uses supplied value.
UniformDimensionedField(const IOobject&, const dimensioned<Type>&); UniformDimensionedField(const IOobject&, const dimensioned<Type>&);
//- Construct as copy //- Construct as copy

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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -1745,6 +1745,7 @@ void Foam::hexRef8::setInstance(const fileName& inst)
cellLevel_.instance() = inst; cellLevel_.instance() = inst;
pointLevel_.instance() = inst; pointLevel_.instance() = inst;
level0Edge_.instance() = inst;
history_.instance() = inst; history_.instance() = inst;
} }
@ -1752,7 +1753,7 @@ void Foam::hexRef8::setInstance(const fileName& inst)
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from mesh, read refinement data // Construct from mesh, read refinement data
Foam::hexRef8::hexRef8(const polyMesh& mesh) Foam::hexRef8::hexRef8(const polyMesh& mesh, const bool readHistory)
: :
mesh_(mesh), mesh_(mesh),
cellLevel_ cellLevel_
@ -1781,7 +1782,19 @@ Foam::hexRef8::hexRef8(const polyMesh& mesh)
), ),
labelList(mesh_.nPoints(), 0) labelList(mesh_.nPoints(), 0)
), ),
level0Edge_(getLevel0EdgeLength()), level0Edge_
(
IOobject
(
"level0Edge",
mesh_.facesInstance(),
polyMesh::meshSubDir,
mesh_,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
dimensionedScalar("level0Edge", dimLength, getLevel0EdgeLength())
),
history_ history_
( (
IOobject IOobject
@ -1790,15 +1803,24 @@ Foam::hexRef8::hexRef8(const polyMesh& mesh)
mesh_.facesInstance(), mesh_.facesInstance(),
polyMesh::meshSubDir, polyMesh::meshSubDir,
mesh_, mesh_,
IOobject::READ_IF_PRESENT, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh_.nCells() // All cells visible if could not be read (readHistory ? mesh_.nCells() : 0) // All cells visible if not be read
), ),
faceRemover_(mesh_, GREAT), // merge boundary faces wherever possible faceRemover_(mesh_, GREAT), // merge boundary faces wherever possible
savedPointLevel_(0), savedPointLevel_(0),
savedCellLevel_(0) savedCellLevel_(0)
{ {
if (readHistory)
{
history_.readOpt() = IOobject::READ_IF_PRESENT;
if (history_.headerOk())
{
history_.read();
}
}
if (history_.active() && history_.visibleCells().size() != mesh_.nCells()) if (history_.active() && history_.visibleCells().size() != mesh_.nCells())
{ {
FatalErrorIn FatalErrorIn
@ -1849,7 +1871,8 @@ Foam::hexRef8::hexRef8
const polyMesh& mesh, const polyMesh& mesh,
const labelList& cellLevel, const labelList& cellLevel,
const labelList& pointLevel, const labelList& pointLevel,
const refinementHistory& history const refinementHistory& history,
const scalar level0Edge
) )
: :
mesh_(mesh), mesh_(mesh),
@ -1879,7 +1902,24 @@ Foam::hexRef8::hexRef8
), ),
pointLevel pointLevel
), ),
level0Edge_(getLevel0EdgeLength()), level0Edge_
(
IOobject
(
"level0Edge",
mesh_.facesInstance(),
polyMesh::meshSubDir,
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
dimensionedScalar
(
"level0Edge",
dimLength,
(level0Edge >= 0 ? level0Edge : getLevel0EdgeLength())
)
),
history_ history_
( (
IOobject IOobject
@ -1945,7 +1985,8 @@ Foam::hexRef8::hexRef8
( (
const polyMesh& mesh, const polyMesh& mesh,
const labelList& cellLevel, const labelList& cellLevel,
const labelList& pointLevel const labelList& pointLevel,
const scalar level0Edge
) )
: :
mesh_(mesh), mesh_(mesh),
@ -1975,7 +2016,24 @@ Foam::hexRef8::hexRef8
), ),
pointLevel pointLevel
), ),
level0Edge_(getLevel0EdgeLength()), level0Edge_
(
IOobject
(
"level0Edge",
mesh_.facesInstance(),
polyMesh::meshSubDir,
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
dimensionedScalar
(
"level0Edge",
dimLength,
(level0Edge >= 0 ? level0Edge : getLevel0EdgeLength())
)
),
history_ history_
( (
IOobject IOobject
@ -2621,7 +2679,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
<< "Value should be >= 1" << exit(FatalError); << "Value should be >= 1" << exit(FatalError);
} }
const scalar level0Size = 2*maxFaceDiff*level0Edge_; const scalar level0Size = 2*maxFaceDiff*level0EdgeLength();
// Bit tricky. Say we want a distance of three cells between two // Bit tricky. Say we want a distance of three cells between two
@ -5514,7 +5572,10 @@ void Foam::hexRef8::setUnrefinement
// Write refinement to polyMesh directory. // Write refinement to polyMesh directory.
bool Foam::hexRef8::write() const bool Foam::hexRef8::write() const
{ {
bool writeOk = cellLevel_.write() && pointLevel_.write(); bool writeOk =
cellLevel_.write()
&& pointLevel_.write()
&& level0Edge_.write();
if (history_.active()) if (history_.active())
{ {

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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -43,6 +43,7 @@ SourceFiles
#include "removeFaces.H" #include "removeFaces.H"
#include "refinementHistory.H" #include "refinementHistory.H"
#include "PackedBoolList.H" #include "PackedBoolList.H"
#include "uniformDimensionedFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -74,7 +75,7 @@ class hexRef8
labelIOList pointLevel_; labelIOList pointLevel_;
//- Typical edge length between unrefined points //- Typical edge length between unrefined points
const scalar level0Edge_; uniformDimensionedScalarField level0Edge_;
//- Refinement history //- Refinement history
refinementHistory history_; refinementHistory history_;
@ -319,24 +320,29 @@ public:
// Constructors // Constructors
//- Construct from mesh, read_if_present refinement data //- Construct from mesh, read_if_present refinement data
// (from write below) // (from write below). If readHistory is true does read_if_present
hexRef8(const polyMesh& mesh); // of refinement history. If false clears all history
hexRef8(const polyMesh& mesh, const bool readHistory = true);
//- Construct from mesh and un/refinement data. //- Construct from mesh and un/refinement data and optional size of
// starting cells
hexRef8 hexRef8
( (
const polyMesh& mesh, const polyMesh& mesh,
const labelList& cellLevel, const labelList& cellLevel,
const labelList& pointLevel, const labelList& pointLevel,
const refinementHistory& history const refinementHistory& history,
const scalar level0Edge = -GREAT
); );
//- Construct from mesh and refinement data. //- Construct from mesh and refinement data and optional size of
// starting cells
hexRef8 hexRef8
( (
const polyMesh& mesh, const polyMesh& mesh,
const labelList& cellLevel, const labelList& cellLevel,
const labelList& pointLevel const labelList& pointLevel,
const scalar level0Edge = -GREAT
); );
@ -367,7 +373,7 @@ public:
//- Typical edge length between unrefined points //- Typical edge length between unrefined points
scalar level0EdgeLength() const scalar level0EdgeLength() const
{ {
return level0Edge_; return level0Edge_.value();
} }
// Refinement // Refinement

View File

@ -704,6 +704,7 @@ void Foam::vtkUnstructuredReader::read(ISstream& inFile)
labelList faceVerts; labelList faceVerts;
readBlock(inFile, nNumbers, faceVerts); readBlock(inFile, nNumbers, faceVerts);
faces_.setSize(nFaces); faces_.setSize(nFaces);
faceMap_.setSize(nFaces);
label elemI = 0; label elemI = 0;
forAll(faces_, faceI) forAll(faces_, faceI)
{ {

View File

@ -877,49 +877,7 @@ Foam::meshRefinement::meshRefinement
meshCutter_ meshCutter_
( (
mesh, mesh,
labelIOList false // do not try to read history.
(
IOobject
(
"cellLevel",
mesh_.facesInstance(),
fvMesh::meshSubDir,
mesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE,
false
),
labelList(mesh_.nCells(), 0)
),
labelIOList
(
IOobject
(
"pointLevel",
mesh_.facesInstance(),
fvMesh::meshSubDir,
mesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE,
false
),
labelList(mesh_.nPoints(), 0)
),
refinementHistory
(
IOobject
(
"refinementHistory",
mesh_.facesInstance(),
fvMesh::meshSubDir,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
List<refinementHistory::splitCell8>(0),
labelList(0)
) // no unrefinement
), ),
surfaceIndex_ surfaceIndex_
( (

View File

@ -284,24 +284,7 @@ Foam::radiation::greyMeanAbsorptionEmission::aCont(const label bandI) const
Foam::tmp<Foam::volScalarField> Foam::tmp<Foam::volScalarField>
Foam::radiation::greyMeanAbsorptionEmission::eCont(const label bandI) const Foam::radiation::greyMeanAbsorptionEmission::eCont(const label bandI) const
{ {
tmp<volScalarField> e return aCont(bandI);
(
new volScalarField
(
IOobject
(
"eCont" + name(bandI),
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh(),
dimensionedScalar("e", dimless/dimLength, 0.0)
)
);
return e;
} }

View File

@ -231,24 +231,7 @@ Foam::radiation::wideBandAbsorptionEmission::aCont(const label bandI) const
Foam::tmp<Foam::volScalarField> Foam::tmp<Foam::volScalarField>
Foam::radiation::wideBandAbsorptionEmission::eCont(const label bandI) const Foam::radiation::wideBandAbsorptionEmission::eCont(const label bandI) const
{ {
tmp<volScalarField> e return aCont(bandI);
(
new volScalarField
(
IOobject
(
"e",
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh(),
dimensionedScalar("e", dimless/dimLength, 0.0)
)
);
return e;
} }

View File

@ -137,6 +137,61 @@ greyMeanAbsorptionEmissionCoeffs
); );
} }
O2
{
Tcommon 300;
invTemp true;
Tlow 200;
Thigh 2500;
loTcoeffs
(
0
0
0
0
0
0
);
hiTcoeffs
(
0.1
0
0
0
0
0
);
}
N2
{
Tcommon 300;
invTemp true;
Tlow 200;
Thigh 2500;
loTcoeffs
(
0
0
0
0
0
0
);
hiTcoeffs
(
0.1
0
0
0
0
0
);
}
} }
scatterModel constantScatter; scatterModel constantScatter;

View File

@ -43,7 +43,7 @@ absorptionEmissionModel greyMeanAbsorptionEmission;
constantAbsorptionEmissionCoeffs constantAbsorptionEmissionCoeffs
{ {
a a [ 0 -1 0 0 0 0 0 ] 0.01; a a [ 0 -1 0 0 0 0 0 ] 0.01;
e e [ 0 -1 0 0 0 0 0 ] 0; e e [ 0 -1 0 0 0 0 0 ] 0.01;
E E [ 1 -1 -3 0 0 0 0 ] 0; E E [ 1 -1 -3 0 0 0 0 ] 0;
} }
@ -134,6 +134,61 @@ greyMeanAbsorptionEmissionCoeffs
0 0
); );
} }
O2
{
Tcommon 300;
invTemp true;
Tlow 200;
Thigh 2500;
loTcoeffs
(
0
0
0
0
0
0
);
hiTcoeffs
(
0.1
0
0
0
0
0
);
}
N2
{
Tcommon 300;
invTemp true;
Tlow 200;
Thigh 2500;
loTcoeffs
(
0
0
0
0
0
0
);
hiTcoeffs
(
0.1
0
0
0
0
0
);
}
} }
scatterModel constantScatter; scatterModel constantScatter;

View File

@ -135,6 +135,61 @@ greyMeanAbsorptionEmissionCoeffs
0 0
); );
} }
O2
{
Tcommon 300;
invTemp true;
Tlow 200;
Thigh 2500;
loTcoeffs
(
0
0
0
0
0
0
);
hiTcoeffs
(
0.1
0
0
0
0
0
);
}
N2
{
Tcommon 300;
invTemp true;
Tlow 200;
Thigh 2500;
loTcoeffs
(
0
0
0
0
0
0
);
hiTcoeffs
(
0.1
0
0
0
0
0
);
}
} }
scatterModel constantScatter; scatterModel constantScatter;