Commit 54ec95e2 authored by mattijs's avatar mattijs
Browse files

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

parents fa77b7ce 1bc097af
......@@ -32,7 +32,5 @@ if (dieselSpray.twoD())
gasMass0 *= 2.0*mathematicalConstant::pi/dieselSpray.angleOfWedge();
}
reduce(gasMass0, sumOp<scalar>());
gasMass0 -=
dieselSpray.injectedMass(runTime.value()) - dieselSpray.liquidMass();
......@@ -23,8 +23,6 @@
gasMass *= 2.0*mathematicalConstant::pi/dieselSpray.angleOfWedge();
}
reduce(gasMass, sumOp<scalar>());
scalar addedMass = gasMass - gasMass0;
Info<< "Added gas mass................. | " << 1e6*addedMass << " mg"
......
......@@ -224,7 +224,16 @@ Foam::Istream& Foam::ISstream::read(token& t)
}
else
{
t = label(atol(numberBuffer));
long lt = atol(numberBuffer);
t = label(lt);
// If the integer is too large to be represented as a label
// return it as a scalar
if (t.labelToken() != lt)
{
isScalar = true;
t = scalar(atof(numberBuffer));
}
}
}
else
......
......@@ -43,7 +43,7 @@ Foam::engineMesh::engineMesh(const IOobject& io)
linerIndex_(-1),
cylinderHeadIndex_(-1),
deckHeight_("deckHeight", dimLength, GREAT),
pistonPosition_("deckHeight", dimLength, GREAT)
pistonPosition_("pistonPosition", dimLength, -GREAT)
{
bool foundPiston = false;
bool foundLiner = false;
......@@ -80,14 +80,14 @@ Foam::engineMesh::engineMesh(const IOobject& io)
}
if (!foundLiner)
{
{
FatalErrorIn("engineMesh::engineMesh(const IOobject& io)")
<< "cannot find liner patch"
<< exit(FatalError);
}
if (!foundCylinderHead)
{
{
FatalErrorIn("engineMesh::engineMesh(const IOobject& io)")
<< "cannot find cylinderHead patch"
<< exit(FatalError);
......@@ -96,17 +96,25 @@ Foam::engineMesh::engineMesh(const IOobject& io)
{
if (pistonIndex_ != -1)
{
pistonPosition_.value() =
max(boundary()[pistonIndex_].patch().localPoints()).z();
pistonPosition_.value() = -GREAT;
if (boundary()[pistonIndex_].patch().localPoints().size())
{
pistonPosition_.value() =
max(boundary()[pistonIndex_].patch().localPoints()).z();
}
}
reduce(pistonPosition_.value(), minOp<scalar>());
reduce(pistonPosition_.value(), maxOp<scalar>());
if (cylinderHeadIndex_ != -1)
{
deckHeight_.value() = min
(
boundary()[cylinderHeadIndex_].patch().localPoints()
).z();
deckHeight_.value() = GREAT;
if (boundary()[cylinderHeadIndex_].patch().localPoints().size())
{
deckHeight_.value() = min
(
boundary()[cylinderHeadIndex_].patch().localPoints()
).z();
}
}
reduce(deckHeight_.value(), minOp<scalar>());
......
......@@ -63,9 +63,7 @@ Foam::fixedInternalValueFvPatchField<Type>::fixedInternalValueFvPatchField
)
:
zeroGradientFvPatchField<Type>(p, iF, dict)
{
fvPatchField<Type>::operator=(this->patchInternalField());
}
{}
template<class Type>
......
......@@ -129,7 +129,7 @@ kEpsilon::kEpsilon
autoCreateNut("nut", mesh_)
)
{
nut_ == Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_);
nut_ = Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_);
nut_.correctBoundaryConditions();
printCoeffs();
......@@ -259,7 +259,7 @@ void kEpsilon::correct()
// Re-calculate viscosity
nut_ == Cmu_*sqr(k_)/epsilon_;
nut_ = Cmu_*sqr(k_)/epsilon_;
nut_.correctBoundaryConditions();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment