From 0545576016a80a3b4d3e31a3e0b89001cb43eec9 Mon Sep 17 00:00:00 2001 From: graham Date: Wed, 30 Sep 2009 12:32:49 +0100 Subject: [PATCH] Adding rhoInf data member to be passed to the forces function object. --- ...fRigidBodyDisplacementPointPatchVectorField.C | 16 +++++++++++----- ...fRigidBodyDisplacementPointPatchVectorField.H | 4 ++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/fvMotionSolver/pointPatchFields/derived/sixDofRigidBodyDisplacement/sixDofRigidBodyDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/sixDofRigidBodyDisplacement/sixDofRigidBodyDisplacementPointPatchVectorField.C index 324b10f574..b5c6b9b8a2 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/sixDofRigidBodyDisplacement/sixDofRigidBodyDisplacementPointPatchVectorField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/sixDofRigidBodyDisplacement/sixDofRigidBodyDisplacementPointPatchVectorField.C @@ -49,7 +49,8 @@ sixDofRigidBodyDisplacementPointPatchVectorField : fixedValuePointPatchField(p, iF), motion_(), - p0_(p.localPoints()) + p0_(p.localPoints()), + rhoInf_(1.0) {} @@ -62,7 +63,8 @@ sixDofRigidBodyDisplacementPointPatchVectorField ) : fixedValuePointPatchField(p, iF, dict), - motion_(dict) + motion_(dict), + rhoInf_(readScalar(dict.lookup("rhoInf"))) { if (!dict.found("value")) { @@ -91,7 +93,8 @@ sixDofRigidBodyDisplacementPointPatchVectorField : fixedValuePointPatchField(ptf, p, iF, mapper), motion_(ptf.motion_), - p0_(ptf.p0_) + p0_(ptf.p0_), + rhoInf_(ptf.rhoInf_) {} @@ -104,7 +107,8 @@ sixDofRigidBodyDisplacementPointPatchVectorField : fixedValuePointPatchField(ptf, iF), motion_(ptf.motion_), - p0_(ptf.p0_) + p0_(ptf.p0_), + rhoInf_(ptf.rhoInf_) {} @@ -130,7 +134,7 @@ void sixDofRigidBodyDisplacementPointPatchVectorField::updateCoeffs() dictionary forcesDict; forcesDict.add("patches", wordList(1, ptPatch.name())); - forcesDict.add("rhoInf", 1.0); + forcesDict.add("rhoInf", rhoInf_); forcesDict.add("CofR", motion_.centreOfMass()); forces f("forces", db(), forcesDict); @@ -166,6 +170,8 @@ void sixDofRigidBodyDisplacementPointPatchVectorField::write(Ostream& os) const { pointPatchField::write(os); motion_.write(os); + os.writeKeyword("rhoInf") + << rhoInf_ << token::END_STATEMENT << nl; p0_.writeEntry("p0", os); writeEntry("value", os); } diff --git a/src/fvMotionSolver/pointPatchFields/derived/sixDofRigidBodyDisplacement/sixDofRigidBodyDisplacementPointPatchVectorField.H b/src/fvMotionSolver/pointPatchFields/derived/sixDofRigidBodyDisplacement/sixDofRigidBodyDisplacementPointPatchVectorField.H index b619baa3f2..417c56033e 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/sixDofRigidBodyDisplacement/sixDofRigidBodyDisplacementPointPatchVectorField.H +++ b/src/fvMotionSolver/pointPatchFields/derived/sixDofRigidBodyDisplacement/sixDofRigidBodyDisplacementPointPatchVectorField.H @@ -60,6 +60,10 @@ class sixDofRigidBodyDisplacementPointPatchVectorField //- Reference positions of points on the patch pointField p0_; + //- Reference density required by the forces object for + // incompressible calculations + scalar rhoInf_; + public: