CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Different results with custom 6dof solver in pitch with newmark scheme (https://www.cfd-online.com/Forums/openfoam-programming-development/242486-different-results-custom-6dof-solver-pitch-newmark-scheme.html)

quarkz April 23, 2022 21:31

Different results with custom 6dof solver in pitch with newmark scheme
 
Hi,

I am trying to write my own custom 6dof (only in pitch) solver under the solidBodyMotionFunction class, using the newmark scheme. Reason is that my body undergoes large pitching rotation and if I use the org sixDoFRigidBodyMotion, the mesh deformation will be severe. However, if I run it under the solidBodyMotionFunction class, the whole body will pitch as a whole with no deformation.

I start off with modifing the rotatingmotion code since that's the nearest to what I want. So instead of prescribed rotation, the angle will be determined by the 6dof solver.

I followed the newmark scheme as given in the newmmark.C under the sixDoFRigidBodyMotion:

Code:

//newmark scheme
                angular_acc_z = accelerationRelaxation_*(moment_z/momentOfInertia_[2]);
               
                angular_vel_z = angular_vel_z_old + accelerationDamping_*delta_time*(gamma_*angular_acc_z + (1. - gamma_)*angular_acc_z_old);
               
                //angle = angle_old + angular_vel_z_old*delta_time + accelerationDamping_*delta_time*delta_time*(beta_*angular_acc_z + (0.5 - beta_)*angular_acc_z_old);
               
                angle = angular_vel_z_old*delta_time + accelerationDamping_*delta_time*delta_time*(beta_*angular_acc_z + (0.5 - beta_)*angular_acc_z_old);

As I do not know how to obtain the total forces / moments from OF directly, I had to read in the data file from the postprocessing dir (if anyone knows how to call directly, pls let me know!).

I then compared my case with the wingMotion2D from the tutorial. I modified a bit to make it just simple pitch rotation in 1dof .

The results I obtained are similar for t = 0.1 and 0.2 but then the results start to diverge and for my case, the pitch angle keeps increasing. However, for the org tutorial, the pitch angle starts to reverse after ~ t = 0.4.

I wonder why. Is there anything which I missed out? Is using a custom 6dof solver under the solidBodyMotionFunction class sufficient to get the correct ans?

Hope someone can help or give some suggestions.

Thanks.

quarkz May 1, 2022 21:08

Anyone can help?

I'm still struggling with the error. After t ~ 0.2s, the difference between my result and OF's gets bigger and bigger.

My understanding of 6dof, simplified for my problem is as follows:

For simple pitch only 1dof z axis

mz = external pitch force
izz = moment of inertia in z axis
center of rotation = center of mass
angular acceleration acc = mz/izz

v = u + acc*t, where v, u and t = new velocity, old velocity, delta time

new final displacement theta = theta_old + u*t + 0.5*acc*t^2

That's the simplest way. However, for better accuracy and stability, we can use the newmark scheme whereby:

acc = accelerationRelaxation_*(mz/izz);

v = u + accelerationDamping_*t*(gamma_*acc + (1. - gamma_)*acc_old);

theta = theta_old + u*t + accelerationDamping_*t^2*(beta_*acc + (0.5 - beta_)*acc_old);

Is there anything wrong with the above formulas?


All times are GMT -4. The time now is 09:59.