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

Rotating motion

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By danny123

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 29, 2015, 08:51
Default Rotating motion
  #1
kcn
Member
 
Join Date: May 2014
Posts: 31
Rep Power: 11
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: 148
Rep Power: 14
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
kiski likes this.
danny123 is offline   Reply With Quote

Old   July 1, 2015, 03:15
Default
  #3
kcn
Member
 
Join Date: May 2014
Posts: 31
Rep Power: 11
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: 148
Rep Power: 14
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
Member
 
Join Date: May 2014
Posts: 31
Rep Power: 11
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
Member
 
Join Date: May 2014
Posts: 31
Rep Power: 11
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: 148
Rep Power: 14
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

Old   August 1, 2016, 17:28
Default
  #8
Member
 
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13
pechwang is on a distinguished road
Can anyone successfully implement the wind induced velocity change?
pechwang is offline   Reply With Quote

Old   September 27, 2017, 15:53
Default Time variation in the rotation
  #9
Senior Member
 
Jon Elvar Wallevik
Join Date: Nov 2010
Location: Reykjavik, ICELAND
Posts: 103
Rep Power: 19
JonW will become famous soon enough
I dont know if this helps, but to allow for a time variation in the rotation, I have
done the following in OF 2.3.1. (should be similar with other versions)


cd $HOME/OpenFOAM/OpenFOAM-2.3.1/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/

cd rotatingMotion

gedit rotatingMotion.C

in the function (line 73)
Foam::septernion
Foam::solidBodyMotionFunctions::rotatingMotion::tr ansformation() const
you can do your stuff

I added ...

const scalar PI = constant::mathematical:i;

// scalar angle = omega_->integrate(0, t);
scalar angle = Foam::sin(1.0*PI*t)*omega_->integrate(0, t);

Now you have sinus type of rotation. You can add other functions, like atan if you want a steady increase and then steady state rotation.
---------------------------------------------------------------------------

In ./constant/dynamicMeshDict

dynamicFvMesh solidBodyMotionFvMesh;

solidBodyMotionFvMeshCoeffs
{
cellZone none; // none => the whole mesh rotates.
// if you want only part of it to rotate, you have to define
// that region. see examples in openfoam wiki
solidBodyMotionFunction rotatingMotion;

rotatingMotionCoeffs
{
origin ( 0 0 0 );
axis ( 0 0 1 );
omega 1.4451; // rad/s // omega = 2*pi*(0.23 rps)
}
}
JonW is offline   Reply With Quote

Old   March 13, 2018, 00:23
Post
  #10
Member
 
Jung da yoon
Join Date: Nov 2017
Posts: 53
Rep Power: 8
kane is on a distinguished road
It was a old thread.
But I want to ask something.

why the term(1.0/constant::mathematical:i*omega_) is added???
kane is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rotating motion Richy STAR-CCM+ 0 February 11, 2013 03: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 16: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 23:55.