CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Rotating motion

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   June 29, 2015, 08:51
Default Rotating motion
  #1
kcn
New Member
 
Join Date: May 2014
Posts: 25
Rep Power: 3
kcn is on a distinguished road
Hello,

Can someone please tell me how I can modify rotating Motion sub class in Solid Body Motion Functions, in order to use a calculated rotational speed instead of a constant rotational speed?

I am simulating a wind driven turbine. So rotation should be wind induced rather than predefined. I indent to do this as follows.

  1. Using initial position of the turbine, run the flow solver to obtain pressure field on turbine blade.
  2. Then using this pressure field, torque can be calculated.
  3. Using this torque value and moment of inertia of turbine angular velocity can be calculated.
  4. Modify Rigid body rotation class so that it can take the calculated angular velocity to define mesh rotation.

Can some one tell me how to use calculated values from a solver as inputs to a solid body motion function.

Thanks
kcn
kcn is offline   Reply With Quote

Old   June 30, 2015, 11:31
Default
  #2
Senior Member
 
Daniel Witte
Join Date: Nov 2011
Posts: 109
Rep Power: 5
danny123 is on a distinguished road
Hello,

I have programmed a speed ramp of an impeller in the past. You will propably find in one of those posts. OpenFoam uses the time to determine the current rotation angle. At contant angle speed this is a linear function, but this can be changed in the dynamic mesh class you have to build. The mesh movement then is simply called by the mesh.update.

However, for your purpose, you will need the angle acceleration too, as well as delta T.
So, I would follow the definition of time (duration) in the dynamic mesh class and define the new entities that you need.

Regards,

Daniel
danny123 is offline   Reply With Quote

Old   July 1, 2015, 03:15
Default
  #3
kcn
New Member
 
Join Date: May 2014
Posts: 25
Rep Power: 3
kcn is on a distinguished road
Dear Daniels,

Thanks a lot for your reply, I looked at your earlier post. Once the acceleration is obtained I can use a similar way to incorporate variable rotation speed.

However in my case acceleration is flow induced in following way.

Acceleration = flow induced torque/Moment of inertia

I made a new class based on SolidBodyMotionFvMesh which I named windMotionFvMesh.

Torque is calculated by the solver during run time. My problem is, how can I communicate this torque value to windMotionFvMesh?

I tried updating the dynamicMeshDict during rum time. So that during each iteration torque can be read from there. But it didn't work. It seems solidBodyMotionFvMesh do not read dynamicMeshDict during each iteration.

Is there any way I can directly communicate torque value to windMotionFvMesh?
kcn is offline   Reply With Quote

Old   July 1, 2015, 04:09
Default
  #4
Senior Member
 
Daniel Witte
Join Date: Nov 2011
Posts: 109
Rep Power: 5
danny123 is on a distinguished road
Hello kcn,

The moment of inertia should be a constant unless the geometry of your impeller changes, agreed?

Then, what you need is instead of angle of rotation = f(t) (as it is implemented in OpenFoam now):

angle of rotation new = angle of rotation old + rotation speed old x deltaT + deltaT^2 x Torque/(Moment of Inertia).

So, instead of time you propably have to pass the angle directly to your new dynamic mesh class. So, I would suggest you to look where the current class gets the time value from and add another variable to pass (which then is the angle).

You could also "missuse" the time variable by setting it to the angle value, do a mesh update and setting it back. But this is "dirty" programming trick and I would not recommend it.

Regards,

Daniel
danny123 is offline   Reply With Quote

Old   July 1, 2015, 05:14
Default
  #5
kcn
New Member
 
Join Date: May 2014
Posts: 25
Rep Power: 3
kcn is on a distinguished road
Dear Daniel,

Time is directly passed as runTime. I tried following code that others have used to access field values (p & U) form boundary condition classes. This was also used in post processing class "forces" to access velocity fields.

const volTypeField& X = db().objectRegistry::lookupObject<volTypeField>("X ");

How ever I get the following error

" ‘db’ was not declared in this scope"

Thanks,
kcn
kcn is offline   Reply With Quote

Old   July 1, 2015, 09:46
Default
  #6
kcn
New Member
 
Join Date: May 2014
Posts: 25
Rep Power: 3
kcn is on a distinguished road
Hello,

It compiled when I replaced the RHS with

time_.lookupObject<volTypeField>("X")
kcn is offline   Reply With Quote

Old   July 2, 2015, 08:53
Default
  #7
Senior Member
 
Daniel Witte
Join Date: Nov 2011
Posts: 109
Rep Power: 5
danny123 is on a distinguished road
The runTime objects are defined in time.C and time.H. You can define a new entity called e.g. "angle" similar to deltaT. This angle then can be changed by a set procedure (similar to setdeltaT).

You then need to define an object that can be called within the dynamic mesh object. In this example, it should be similar to runTime.deltaTValue().

The angle then can be set using the torque balance in your application solver. After the mesh.update() it should then appear in your dynamic mesh object.

I do not know how to get the forces on the shaft, since I always only see the result table only. Maybe somebody else can help you on that one.

Regards,

Daniel
danny123 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rotating motion Richy STAR-CCM+ 0 February 11, 2013 04:51
How to simulate problems with rotating motion feiqunali OpenFOAM 10 August 12, 2011 14:55
Difference between domain motion and rotating wall 100tinela CFX 6 January 31, 2011 17:53
Rotating domain motion in cfx post pankaj CFX 6 September 5, 2007 14:28
Motion of solids in rotating fluids Fredrik Kuivinen Main CFD Forum 2 July 6, 2000 12:40


All times are GMT -4. The time now is 15:55.