How to apply an external forces on a moving body in interDyMFoam?
Hi, is is possible to apply an explicit point force to a moving object in interDyMFoam? I imagine this could be useful when modelling a marine craft with small wings/flaps attach. If the lift force of the appendege is known, one could just apply the force without explicitly mesh and model the details.
I cannot figure out how to specify this force or if it is even possible? Does anyone have an idea? Regards Lars |
Hi Lars,
not possible at the moment. You must somehow change the sixDoFRigidBodyMotion library. One possibility would may be to modify the memberfunction "solve()" in sixDoFRigidBodyMotionSolver.C, where motion_.updateAcceleration(...) is called, similar how the mass forces are accounted for. Good luck! Jan |
Hi Jan, thank you for clarifying this and thanks for you suggestions.
Have a nice day! Lars |
Hi Lars, hi Jan
I'm very interested in this argument, did you find a way to add an external force in interDyMFoam solver? any suggestion? Best regards Federica |
Hi Frederica,
I think the easiest way is to create your own restraint. Have a look at the existing restraints, e.g. the linearSpring. There a force porportional to the velocity is computed and applied to the sixDoF Body. Copy an existing, rename and modify should be straight forward. Best regards, Jan |
Hi Jan, thank you very much for your answer :)
Federica |
Quote:
I'm stuck on this problem, because I'm new in programming in openFOAM. I took a look at the .H and .c files of linearSpring restraint and I need to modify the restraintForce term with a time varying force composed like this: (Fx,0,Fx*tan(alpha)). void Foam::sixDoFRigidBodyMotionRestraints::linearSprin g::restrain ( const sixDoFRigidBodyMotion& motion, vector& restraintPosition, vector& restraintForce, vector& restraintMoment ) const { restraintPosition = motion.transform(refAttachmentPt_); vector r = restraintPosition - anchor_; scalar magR = mag(r); r /= (magR + VSMALL); vector v = motion.velocity(restraintPosition); restraintForce = restraintMoment = vector::zero; if (motion.report()) { Info<< " attachmentPt - anchor " << r*magR << " spring length " << magR << " force " << restraintForce << endl; } } Fx is the sum of Fx pressure and Fx viscous and it needs to be extract each time step from the forces.dat file. alpha is the angle between the initial position of the x-axis of the system and the new position, I think it can be extract from the motion.orientation() tensor each time step. The problem is that I don't know how to extract these data to put them into the linearSpring library. Do you know how can I do that? Your help would be very appreciated. Regards Federica |
Quote:
Dear Federica, Did you get success in adding the external force in linearSpring.C file ? I need a similar modification in linearSpring.C file, but I am still wondering how to do it. If you have already managed to do, it will be great if you could share the idea. Apparently, in OpenFOAM 4 release, they have made a provision to add external forces, in rigid body Dynamics/rigidBodyMeshMotion http://openfoam.org/release/4-0/ However, I don't know how to use it. Thanks and regards, Sachin |
Quote:
I compiled without errors this customized linearSpring, but I haven't tried it yet because I'm still stuck on the convergence of 0DoF cases. However here is my solution variableLinearSpring.C Code:
/*---------------------------------------------------------------------------*\ Code:
/*---------------------------------------------------------------------------*\ Best regards Federica |
Dear Federica,
Thank you very much for your modified file! I had a look at it. It is interesting. I will try if I could do some Changes according to my need. Actually, in my case, I want to modify the restraintForce equation by adding the external force term in the following way. restraintForce = -stiffness_*(magR - restLength_)*r - damping_*(r & v)*r + F; where, F = F0*sin(Omega*time) I want to put in the "time" there, which I couldn't when I tried. Do you think, it can be done easily? Best regards, Sachin |
Quote:
I understand your issue, I'm not good at programming in OpenFOAM but I found in the forum this post http://www.cfd-online.com/Forums/ope...vity-time.html where Alberto suggests to use runTime.timeName() as time variable, check it out! Best regards Federica |
Dear Federica,
Thank you very much for this input! It certainly gave me some room to think about time implementation in linearSpring.C. I actually, tried the runTime.timeName() and also, runTime.value(), but it didn't work in my case. :( It seems, I need to find some other way:confused: Best, Sachin |
Same Issue Here
Actually runTime.value() worked very well in OF 2. But the same code is giving problems in OF 4. Did you figure it out?:confused:
|
explicit point force
Quote:
hi Lars Has your problem been solved? Do you solve your problem by using new version V1706 ? I have a question ask you ,Whether this external force can make an object in the water along a uniform linear motion? Do not use this LingeSpring, you know what better way or simple method achieve a sphere in the water uniform linear motion it? thanks |
Quote:
Hi Federica, I tried modifying the linearSpring based on your variableLinearSpring.C and .H files. It does not show any error during compilation. But when I test it, the force shows 0 value at every timestep. Have you tried it yourself and does it work? Regards, Mohamad |
All times are GMT -4. The time now is 06:38. |