CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

CEL Code for Sinusoidal Movement of Piston

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 19, 2015, 07:17
Default
  #21
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
I have no idea what you are modelling so I cannot say whether it is correct. You also have not shown how you implemented anything.

The equations you describe are the Bingham model, but as I said I would try to use the existing built in Bingham model if possible - but if you want to make yield stress a function of something I suspect you may have to define the model yourself.
ghorrocks is offline   Reply With Quote

Old   March 19, 2015, 07:29
Default
  #22
Member
 
Dr Gurubasavaraju
Join Date: Dec 2014
Location: Bengaluru India
Posts: 78
Rep Power: 12
gbrajtm is on a distinguished road
I can mail you my simulation if you provide the email id.

I am trying simulate a magneto rheological fluid damper to study the performance by obtaining Force developed in the damper.

The small thin gap is the annular gap of the piston where the fluid get magnetised under motion with certain velocity.
gbrajtm is offline   Reply With Quote

Old   March 19, 2015, 17:36
Default
  #23
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
I do not have time to go through your simulation in detail.

The forum works best when you identify a specific problem you are having and post a question about that problem. Make sure you include enough information so we can understand what you are talking about and its context.
ghorrocks is offline   Reply With Quote

Old   March 31, 2015, 06:50
Default
  #24
Member
 
Dr Gurubasavaraju
Join Date: Dec 2014
Location: Bengaluru India
Posts: 78
Rep Power: 12
gbrajtm is on a distinguished road
Hi Glenn Horrocks,

Greetings,Hope you doing well.

I have added viscosity model as function of magnetic flux density using CEL, But i have not considered the piston location while calculating the Dynamic viscosity.
This the Expression i have used.

if(Shear Strain Rate >= 15[s^-1], (5000[kg m^-1 s^-2]/Shear Strain Rate)+0.11[kg m^-1 s^-1], 55[kg m^-1 s^-1])

I am finding difficulties in considering the Piston location as it moves up and down.

Do you have any solution for this.


Kind Regards
Guru
Attached Images
File Type: jpg Capture.jpg (25.1 KB, 32 views)
gbrajtm is offline   Reply With Quote

Old   March 31, 2015, 08:00
Default
  #25
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
I would expect convergence difficulties with a viscosity function like that. It has a big step in viscosity at SSR=15[s^-1]. Are you sure it is realistic?

Looking back on this thread you state that you are defining the piston motion. So why can't you simply use the variable you defined for the piston motion as an input to this equation as well?
ghorrocks is offline   Reply With Quote

Old   March 31, 2015, 08:14
Default
  #26
Member
 
Dr Gurubasavaraju
Join Date: Dec 2014
Location: Bengaluru India
Posts: 78
Rep Power: 12
gbrajtm is on a distinguished road
yes, the value provided are not realistic. The values are different, for just your ference i have added.

How to add the piston motion equation as the input to the Viscosity expression.
gbrajtm is offline   Reply With Quote

Old   March 31, 2015, 18:23
Default
  #27
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
You just include the x, y or z displacement of the piston in the CEL expression - it is not that hard. You just need to be careful about getting the units right.
ghorrocks is offline   Reply With Quote

Old   April 1, 2015, 03:30
Default
  #28
Member
 
Dr Gurubasavaraju
Join Date: Dec 2014
Location: Bengaluru India
Posts: 78
Rep Power: 12
gbrajtm is on a distinguished road
Sorry for troubling you. I didn't get how to add.

My displacement expression for Piston motion in X direction is: 0.0425[m]*sin(t/1 [s])

And dynamic viscosity is

if(Shear Strain Rate >= 15[s^-1], (5000[kg m^-1 s^-2]/Shear Strain Rate)+0.11[kg m^-1 s^-1], 55[kg m^-1 s^-1])
gbrajtm is offline   Reply With Quote

Old   April 1, 2015, 08:03
Default
  #29
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
How about this:

PistonX = 0.0425[m]*sin(t/1 [s])
Tolerance = 0.1 [m]
CloseToPiston = if(abs(x-PistonX)<Tolerance,1,0)
Viscosity = if(Shear Strain Rate >= 15[s^-1], (5000[kg m^-1 s^-2]/Shear Strain Rate)+0.11[kg m^-1 s^-1]+CloseToPiston*10[Pa s], 55[kg m^-1 s^-1] + CloseToPiston*10[Pa s])

You might need to fix the units up but hopefully you get the idea.

This function adds 10 Pa.s to the viscosity when you are within 0.1 metres of the current piston location.
ghorrocks is offline   Reply With Quote

Old   April 1, 2015, 08:46
Default
  #30
Member
 
Dr Gurubasavaraju
Join Date: Dec 2014
Location: Bengaluru India
Posts: 78
Rep Power: 12
gbrajtm is on a distinguished road
Thank you very much i will simulate and let you.

Thanks
gbrajtm is offline   Reply With Quote

Old   April 11, 2015, 05:39
Default
  #31
Member
 
Dr Gurubasavaraju
Join Date: Dec 2014
Location: Bengaluru India
Posts: 78
Rep Power: 12
gbrajtm is on a distinguished road
Hi,
Glenn Horrocks,
The expression below are used in the simulation.

St = 10000*tanh(Shear Strain Rate/0.001[s^-1])
pistonx = 0.0425[m]*cos(1.33*t/1 [s])
Vel = 0.06[m/s]*sin(1.33*t/1 [s])
Tolerance = 0.01 [m]
CloseToPiston = if(abs(x-PistonX)<Tolerance,1,0)
Visco = if(Shear Strain Rate >= 0.001[s^-1], (St[kg m^-1 s^-2]/Shear Strain Rate)+0.11[kg m^-1 s^-1]+CloseToPiston*10[Pa s], 100[kg m^-1 s^-1] + CloseToPiston*10[Pa s])

I am getting error(shows as Overflow and negative volume element) in solver if i use total time 0.5s and time step 0.01s. if i change it 0.1s and 0.005 time steps, simulation goes fine. any suggestions on this.

Please find the attachment for details of my simulation

Second is can you please elaborate. CloseToPiston = if(abs(x-PistonX)<Tolerance,1,0)

Thanks in advance.
Attached Images
File Type: jpg Capture.jpg (24.3 KB, 24 views)
gbrajtm is offline   Reply With Quote

Old   April 12, 2015, 08:52
Default
  #32
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Fix the negative volume element issue first. It might the cause of the overflow error as well.

Rerun the simulation generating transient results files on every time step, or at least the time steps just before it crashes. Make sure you include the mesh in the transient results files. Then use the post processor to look at the mesh and work out where the mesh is turning in side out. Then you know what you need to fix.
ghorrocks is offline   Reply With Quote

Old   April 20, 2015, 08:09
Default
  #33
Member
 
Dr Gurubasavaraju
Join Date: Dec 2014
Location: Bengaluru India
Posts: 78
Rep Power: 12
gbrajtm is on a distinguished road
If want to consider the piston location along with other two co-ordinate, what changes i have to make to this expression.
CloseToPiston = if(abs(x-PistonX)<Tolerance,1,0)
gbrajtm is offline   Reply With Quote

Old   April 20, 2015, 08:40
Default
  #34
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Isn't that high school level maths? - http://www.purplemath.com/modules/distform.htm
ghorrocks is offline   Reply With Quote

Old   April 23, 2015, 03:16
Default
  #35
Member
 
Dr Gurubasavaraju
Join Date: Dec 2014
Location: Bengaluru India
Posts: 78
Rep Power: 12
gbrajtm is on a distinguished road
Yes , I know the expressions, But didn't know how to make it compatible with ANSYS CEL.

My intention is the thin region should behave like Non newtonian as per the expression given, but rest region is should be newtonian.
Presently i have used Inside()@location for specifying the region.

if(Shear Strain Rate >= 0.001[s^-1], (40000[kg m^-1 s^-2]/Shear Strain Rate)+0.11[kg m^-1 s^-1], 55[kg m^-1 s^-1])*inside()@piston

is this correct?

But the simulation gives error for all turbulence models and runs without error for Laminar model.
gbrajtm is offline   Reply With Quote

Old   April 23, 2015, 06:53
Default
  #36
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Your function returns 0 if you are outside the region. You cannot set the viscosity to be zero.
ghorrocks is offline   Reply With Quote

Old   April 23, 2015, 07:13
Default
  #37
Member
 
Dr Gurubasavaraju
Join Date: Dec 2014
Location: Bengaluru India
Posts: 78
Rep Power: 12
gbrajtm is on a distinguished road
thanks,
now I got it, so results are as not expected.
Closetopiston expression used also not service the goal.
is there any other method? where i can write expression depending on time in the same domain, while moving the piston in the domain, with specified CCL expression whether node is active region or not.
gbrajtm is offline   Reply With Quote

Old   April 23, 2015, 08:18
Default
  #38
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
To make your latest CEL expression work you simply need to make it return a non-zero value when outside the region. A simple if statement will do that:

a = if(Shear Strain Rate >= 0.001[s^-1], (40000[kg m^-1 s^-2]/Shear Strain Rate)+0.11[kg m^-1 s^-1], 55[kg m^-1 s^-1])*inside()@piston
viscosity = if(inside@piston == 1,a, 1 [kg m^-1 s^-1])

Or something like that.
ghorrocks is offline   Reply With Quote

Old   May 6, 2015, 05:00
Default
  #39
Member
 
Dr Gurubasavaraju
Join Date: Dec 2014
Location: Bengaluru India
Posts: 78
Rep Power: 12
gbrajtm is on a distinguished road
Hi Glenn Horrocks,
This equations works fine, even i am getting some results. Then i noticed that the @piston is 2D location as shown in the fig. But i am not sure whether " Inside" function take only the surface into account or the region below it along.
I was trying to add the 3D region as marked in the red. but it does not happening. There is no option for getting cells location which are in the thin region.
gbrajtm is offline   Reply With Quote

Old   May 6, 2015, 20:14
Default
  #40
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
For a 3D region you need to define it in your mesh. So you will need to set this up in the meshing software.
ghorrocks 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
Movement of piston in a cylinder with fluent? Whitworth ANSYS 5 March 4, 2015 00:50
Piston Simulation helloworld922 Autodesk Simulation CFD 1 September 9, 2012 23:54
State of the art in CFD technology Juan Carlos GARCIA SALAS Main CFD Forum 39 November 1, 1999 15:34
public CFD Code development Heinz Wilkening Main CFD Forum 38 March 5, 1999 12:44
What kind of Cmmercial CFD code you feel well? Lans Main CFD Forum 13 October 27, 1998 11:20


All times are GMT -4. The time now is 16:45.