how to do drivenLinearMotion set in pointDisplacement
Hi everyone,in short can anyone give an example of drivenLinearMotion?
below is its source code .H: public solidBodyMotionFunction { // Private data //- Name of the meshObject to dum CofG velocity word CofGvelocity_; //- Normal plane direction to restrict movement on a plane vector normal_; //- Uniform vector to follow uniformDimensionedVectorField CofGvel_; //- Last displacement mutable vector displacement_; and here is its .C: Foam::septernion Foam::solidBodyMotionFunctions::drivenLinearMotion ::transformation() const { scalar deltaT = time_.deltaT().value(); vector velocity = CofGvel_.value(); // Take out normal component if (mag(normal_) > SMALL) { velocity = CofGvel_.value() - ((CofGvel_.value() & normal_)*normal_); } DebugInFunction << "Vel on plane :" << velocity << endl; // Translation of centre of gravity with constant velocity //const vector displacement = velocity*t; displacement_ += velocity*deltaT; my understanding is CofGvel is the object moving velocity and displacement is calculated each moment by +=velocity*deltaT,but when i set it and use pimpleFoam it report error like this: --> FOAM FATAL ERROR: Continuity error cannot be removed by adjusting the outflow. Please check the velocity boundary conditions and/or run potentialFoam to initialise the outflow. Total flux : 1e-300 Specified mass inflow : 5.60342e-28 Specified mass outflow : 4.12536e-28 Adjustable mass outflow : 0 From bool Foam::adjustPhi(Foam::surfaceScalarField&, const volVectorField&, Foam::volScalarField&) in file cfdTools/general/adjustPhi/adjustPhi.C at line 110. and here‘s my setting of pointdisplacement: cylinder { type solidBodyMotionDisplacement; solidBodyMotionFunction drivenLinearMotion; CofGvelocity haak; normal (0 0 1); CofGvel (this->db().time().value() this->db().time().value() 0); displacement (0 0 0); } my purpose is to make the object move with velocity (t,t,0),can anyone tell how should i set it or please give me an example of it?there’s no such example in tutorial files.Other parts are ok,if i set it like this the whole case run without problem: cylinder { type solidBodyMotionDisplacement; solidBodyMotionFunction linearMotion; velocity (1 2 0); } So anyone help plz..:confused: |
All times are GMT -4. The time now is 06:30. |