From ea5c2cb49681b6b88bd06f3858b9ae767557fd24 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 4 Apr 2024 13:33:41 +0100 Subject: [PATCH] multiValveEngine: Removed the normalisation of the fractionalTravelInterval So the user specification is travelInterval rather than fractionalTravelInterval, and with the dimensions of the distance the object travels: - travelInterval: part of the stroke travelled after which the cached motion scaling weights are recalculated Unfortunately this is a lot less convenient to specify, particularly as it is now a dimensioned input which may have to be changed if the stroke or valve lift table are changed but it was felt by the sponsors of the project that the automatic method to evaluate the valve lift from the Function1 was not sufficiently robust. --- src/fvMeshMovers/multiValveEngine/movingObject.C | 6 ++---- .../multiValveEngine/multiValveEngine.H | 14 +++++--------- src/fvMeshMovers/multiValveEngine/piston.C | 4 ++-- src/fvMeshMovers/multiValveEngine/valve.C | 2 +- .../XiFluid/kivaTest/constant/dynamicMeshDict | 2 +- .../fluid/engine2Valve2D/constant/dynamicMeshDict | 4 ++-- 6 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/fvMeshMovers/multiValveEngine/movingObject.C b/src/fvMeshMovers/multiValveEngine/movingObject.C index 4d72c02b46..3ce574af1b 100644 --- a/src/fvMeshMovers/multiValveEngine/movingObject.C +++ b/src/fvMeshMovers/multiValveEngine/movingObject.C @@ -317,9 +317,9 @@ Foam::fvMeshMovers::multiValveEngine::movingObject::movingObject dimensionedScalar(dimless, 0) ), cosine_(dict.lookupOrDefault("cosineScaling", false)), - fractionalTravelInterval_ + travelInterval_ ( - dict.lookupOrDefault("fractionalTravelInterval", 1) + dict.lookupOrDefault("travelInterval", great) ), executionCount_(0), position0_(-great), @@ -360,8 +360,6 @@ Foam::fvMeshMovers::multiValveEngine::movingObject::movingObject userTime += userDeltaT; } - travel_ = maxTravel - minTravel; - initPatchSets(); } diff --git a/src/fvMeshMovers/multiValveEngine/multiValveEngine.H b/src/fvMeshMovers/multiValveEngine/multiValveEngine.H index 134a9ebe4b..efb96dc23c 100644 --- a/src/fvMeshMovers/multiValveEngine/multiValveEngine.H +++ b/src/fvMeshMovers/multiValveEngine/multiValveEngine.H @@ -84,7 +84,7 @@ Description deformation near the moving object and sustain e.g. boundary layer. (Default no, i.e. linear weighting) - - fractionalTravelInterval: fraction of the stroke travelled after + - travelInterval: part of the stroke travelled after which the cached motion scaling weights are recalculated For valve object only: @@ -163,7 +163,7 @@ Description movingFrozenLayerThickness 0; staticFrozenLayerThickness 0; - fractionalTravelInterval 0.1; + travelInterval 0.1; cosineScaling yes; } @@ -180,7 +180,7 @@ Description movingFrozenLayerThickness 0; staticFrozenLayerThickness 0; - fractionalTravelInterval 0.1; + travelInterval 0.01; cosineScaling yes; @@ -279,9 +279,6 @@ public: //- Piston motion function autoPtr> motion_; - //- Maximum travel of the object - scalar travel_; - //- Object patchSet labelHashSet patchSet_; @@ -313,9 +310,8 @@ public: // for the boundary point motion Switch cosine_; - //- Update the scale_ field when the normalised travel exceeds - // fractionalTravelInterval_ - const scalar fractionalTravelInterval_; + //- Update the scale_ field when the travel exceeds travelInterval + const scalar travelInterval_; //- Count of the scale_ field updates mutable label executionCount_; diff --git a/src/fvMeshMovers/multiValveEngine/piston.C b/src/fvMeshMovers/multiValveEngine/piston.C index 90b59a3bb0..c1e09c4e98 100644 --- a/src/fvMeshMovers/multiValveEngine/piston.C +++ b/src/fvMeshMovers/multiValveEngine/piston.C @@ -140,7 +140,7 @@ Foam::scalar Foam::fvMeshMovers::multiValveEngine::pistonObject::speed() const Foam::scalar Foam::fvMeshMovers::multiValveEngine::pistonObject::clearance() const { - if (mag(position() - position0_)/travel_ > fractionalTravelInterval_) + if (mag(position() - position0_) > travelInterval_) { return clearance_; } @@ -162,7 +162,7 @@ void Foam::fvMeshMovers::multiValveEngine::pistonObject::updatePoints const scalar position = this->position(); // Update a cached scale_ field if needed - if (mag(position - position0_)/travel_ > fractionalTravelInterval_) + if (mag(position - position0_) > travelInterval_) { Info << " Updating scale field" << endl; diff --git a/src/fvMeshMovers/multiValveEngine/valve.C b/src/fvMeshMovers/multiValveEngine/valve.C index 353129071f..62aba3dd71 100644 --- a/src/fvMeshMovers/multiValveEngine/valve.C +++ b/src/fvMeshMovers/multiValveEngine/valve.C @@ -101,7 +101,7 @@ void Foam::fvMeshMovers::multiValveEngine::valveObject::updatePoints const scalar position = this->lift(); // Update a cached scale_ field if needed - if (mag(position - position0_)/travel_ > fractionalTravelInterval_) + if (mag(position - position0_) > travelInterval_) { const pointMesh& pMesh = pointMesh::New(meshMover_.mesh()); const pointField& points(meshMover_.mesh().points()); diff --git a/tutorials/XiFluid/kivaTest/constant/dynamicMeshDict b/tutorials/XiFluid/kivaTest/constant/dynamicMeshDict index 1c94918bb6..c89ce55218 100644 --- a/tutorials/XiFluid/kivaTest/constant/dynamicMeshDict +++ b/tutorials/XiFluid/kivaTest/constant/dynamicMeshDict @@ -44,7 +44,7 @@ mover frozenZones (cylinderHead); // There is no need to update the motion weights - fractionalTravelInterval 1; + // travelInterval 0.01; } } diff --git a/tutorials/fluid/engine2Valve2D/constant/dynamicMeshDict b/tutorials/fluid/engine2Valve2D/constant/dynamicMeshDict index 0cf9cfabe0..d0ad59c3a6 100644 --- a/tutorials/fluid/engine2Valve2D/constant/dynamicMeshDict +++ b/tutorials/fluid/engine2Valve2D/constant/dynamicMeshDict @@ -49,7 +49,7 @@ mover movingFrozenLayerThickness 0; - fractionalTravelInterval 0.1; + travelInterval 0.1; cosineScaling yes; } @@ -63,7 +63,7 @@ mover movingFrozenLayerThickness 0; - fractionalTravelInterval 0.02; + travelInterval 5.8e-3; cosineScaling yes; minLift 0.01;