Commit 5dd31ee0 authored by henry's avatar henry
Browse files

Bug fixes from Niklas.

parent 9f83184c
......@@ -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"
......
......@@ -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>());
......
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