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

how to use velocity of current time step in next time step to update it

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 24, 2013, 09:24
Default how to use velocity of previous time step in current time step to update it
  #1
aks
New Member
 
ajay ks
Join Date: Aug 2012
Posts: 13
Rep Power: 4
aks is on a distinguished road
Hi,
I am trying to use simple formula: v =u + at,
Well i am doing transient channel flow case in CFX. I want to update the velocity of a moving object using the velocity of this body at the previous time step.
I know the value of acceleration (a), i know the time step(t), well i tried finding (u) using expression: ave(Velocity)@object but it is giving wrong results.
So, I need to know the velocity of the object(moving wall) at the previous time step to get the updated velocity at the current time step.

How can i get the velocity of the moving object at the current time step in CFX using expressions or something else?

Last edited by aks; September 24, 2013 at 11:15.
aks is offline   Reply With Quote

Old   September 24, 2013, 10:29
Default
  #2
aks
New Member
 
ajay ks
Join Date: Aug 2012
Posts: 13
Rep Power: 4
aks is on a distinguished road
i tried using (a) minVal(Velocity u)@object
(b) maxVal(Velocity u)@object
(c) ave(Velocity u)@object
(d) probe(tried at different point on the moving wall ) and each result of the probe is also a different value. ??
(e) areaAve(Velocity u)@object


These five expressions are giving totally different values (although it is a rigid moving wall)??
So, what should be the correct expression that gives the correct velocity of the rigid moving wall in x-direction at the current time step?

Last edited by aks; September 24, 2013 at 13:20.
aks is offline   Reply With Quote

Old   September 24, 2013, 16:23
Default
  #3
Senior Member
 
Erik
Join Date: Feb 2011
Location: Earth (Land portion)
Posts: 486
Rep Power: 9
evcelica is on a distinguished road
Pulling out velocity values would give you the conservative velocity values for the adjacent fluid, not the wall itself.
What does your geometry look like? It's hard to imagine exactly what you are trying to do.
evcelica is offline   Reply With Quote

Old   September 24, 2013, 22:35
Default
  #4
aks
New Member
 
ajay ks
Join Date: Aug 2012
Posts: 13
Rep Power: 4
aks is on a distinguished road
i am just trying a simple case of a rectangular channel with upper wall moving but with variable velocity. and iam trying to find the velocity of the upper wall . i know the force acting on the wall, mass of the wall is known,
so acceleration = force/mass
and velocity of next time step should be:
vnew=vold + acc.*dt

where vold is the velocity at the current time step
and vnew is the velocity at the next time step

i am using moving wall option in boundary conditions for the upper wall of the channel. and using an expression for it i.e. vnew instead of a fixed velocity
aks is offline   Reply With Quote

Old   September 27, 2013, 00:11
Default
  #5
Senior Member
 
Erik
Join Date: Feb 2011
Location: Earth (Land portion)
Posts: 486
Rep Power: 9
evcelica is on a distinguished road
OK I see what you are trying to do.
Since you know WallVelocity = WallVelocity + Force*dt/mass.
I'm not sure if this would work but you could write an expression just like this that redefined WallVelocity each time step. You would have to initialize WallVelocity to zero using a step of if statement WallVelocity*(step(t/1[s]-0.0000001))+Force*dt/mass.
Again I'm not sure if it will overwrite the variable each time step as expected.

Another way to do this would be to run multiple steady state runs using input/output parameters, and develop a function for force vs. wall velocity, then solve your function yourself to find the transient velocity of the wall.
evcelica is offline   Reply With Quote

Old   September 27, 2013, 23:42
Default
  #6
aks
New Member
 
ajay ks
Join Date: Aug 2012
Posts: 13
Rep Power: 4
aks is on a distinguished road
Quote:
Originally Posted by evcelica View Post
Again I'm not sure if it will overwrite the variable each time step as expected.
I ran a transient simulation by using expression for the upper moving wall velocity but the acceleration and velocity variation with time are somewhat unexpected as acceleration is negative but the velocity is still increasing???
i am attaching the images , please take a look, it does not seem to be correct???
can you tell what can be the reason for this?

oldvel=areaAve(Velocity u)@movingwall

newvel=oldvel+(acc*dt)

I thinks as you said it is giving only conservative velocity values for the adjacent fluid and not of the moving wall itself...
So is there any way of getting the velocity of the moving wall itself?
Attached Images
File Type: png velocity.png (9.8 KB, 9 views)
File Type: png acceleration.png (12.3 KB, 7 views)

Last edited by aks; September 30, 2013 at 10:50.
aks is offline   Reply With Quote

Old   September 28, 2013, 13:03
Default
  #7
aks
New Member
 
ajay ks
Join Date: Aug 2012
Posts: 13
Rep Power: 4
aks is on a distinguished road
Hi Erik,
i also tried using "Update Loop = TRANS_LOOP" and created a new AV by the name oldvel. and then initialized it by giving it a zero value, and
used expression newvel in the B.C. for moving wall where

newvel=areaAve(oldvel)@movingwall + (acceleration*dt)

and tried running the simulation

but it is giving error that oldvel is not available for B.C. of the movingwall
Error processing expression 'global frame vector associated with Wall U'.
The expression is invalid because:
oldvel is not available for use in this term

Error processing expression(s):
Wall U = velnew
Wall V = 0 [m s^-1]
Wall W = 0 [m s^-1]

Hope anyone got some solution for my problem!
aks is offline   Reply With Quote

Old   September 30, 2013, 10:03
Default
  #8
Senior Member
 
Erik
Join Date: Feb 2011
Location: Earth (Land portion)
Posts: 486
Rep Power: 9
evcelica is on a distinguished road
Those functions you use for oldVel with expressions will give you the fluid velocity adjacent to the wall, not the velocity of the moving wall. Read my posts over again, I don't think you tried what I suggested.
evcelica is offline   Reply With Quote

Old   September 30, 2013, 11:03
Default
  #9
aks
New Member
 
ajay ks
Join Date: Aug 2012
Posts: 13
Rep Power: 4
aks is on a distinguished road
i need to run a transient case as i need the transient data for analysis. So, i cannot try the steady state cases but i will try the other option you suggested to use if statement and hope it works. I will let you know as soon as i am done with it. Thanks for your suggestion..
aks is offline   Reply With Quote

Old   October 2, 2013, 01:07
Default
  #10
aks
New Member
 
ajay ks
Join Date: Aug 2012
Posts: 13
Rep Power: 4
aks is on a distinguished road
Quote:
Originally Posted by evcelica View Post
OK I see what you are trying to do.
Since you know WallVelocity = WallVelocity + Force*dt/mass.
But i get an error regarding cyclic usage ie. usage of Wallvelocity on both sides of the equation.?
aks is offline   Reply With Quote

Old   October 2, 2013, 09:53
Default
  #11
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 494
Rep Power: 10
singer1812 is on a distinguished road
Why do you need to do this? You are prescribing a wall velocity with a known acceleration and equation.

This is fully prescribed using a single CEL equation that doesnt need to keep track of old values.


You just need to put in the initial velocity (v0) and let time do its thing

Uwall=v0+a*t

Nothing magic needed for this.
singer1812 is offline   Reply With Quote

Old   October 2, 2013, 09:56
Default
  #12
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 494
Rep Power: 10
singer1812 is on a distinguished road
Ahh, i see. Acceleration is not constant. Please ignore last post.
singer1812 is offline   Reply With Quote

Old   October 2, 2013, 09:59
Default
  #13
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 494
Rep Power: 10
singer1812 is on a distinguished road
How are you initializing the variable with the Tranloop set?

Typically you have to run a fake 1 iteration run without the logic that calls the transloop variable and then use that run to initialize your real run.
singer1812 is offline   Reply With Quote

Old   October 2, 2013, 10:58
Default
  #14
aks
New Member
 
ajay ks
Join Date: Aug 2012
Posts: 13
Rep Power: 4
aks is on a distinguished road
Quote:
Originally Posted by singer1812 View Post
How are you initializing the variable with the Tranloop set?

Typically you have to run a fake 1 iteration run without the logic that calls the transloop variable and then use that run to initialize your real run.
Hi Edmund,
i ran 1 fake iteration by setting zero velocity in the additional variable but then i also had to set the velocity of the movingwall equal to some fixed value to run it and then took the result file as the initial conditions and changed the value of the wall velocity to variable 'newvel' and also set AV by expression 'oldvel' but again the error comes:

Error processing expression 'global frame vector associated with Wall U'.
The expression is invalid because:
oldvel is not available for use in this term

Error processing expression(s):
Wall U = velnew
Wall V = 0 [m s^-1]
Wall W = 0 [m s^-1]
aks is offline   Reply With Quote

Old   October 2, 2013, 11:04
Default
  #15
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 494
Rep Power: 10
singer1812 is on a distinguished road
is your acceleration a function of the flow solution, or is it just the curve you show in the graph (i.e. known apriori).

If it is known a priori, I go back to my post a few posts before, and say, just put in the Vwall curve. No need to have CFX calcuate that out for you. Do it off line.
singer1812 is offline   Reply With Quote

Old   October 2, 2013, 11:09
Default
  #16
aks
New Member
 
ajay ks
Join Date: Aug 2012
Posts: 13
Rep Power: 4
aks is on a distinguished road
acceleration is a function of the flow solution and so it is being updated every time step

Last edited by aks; October 6, 2013 at 01:47.
aks is offline   Reply With Quote

Old   October 16, 2013, 07:14
Default
  #17
Member
 
Max
Join Date: May 2011
Location: old europe
Posts: 71
Rep Power: 6
murx is on a distinguished road
I am facing the same problem. Is there really no way to fix this?

I believe that a while ago, I found a document that said something about an expert parameter that allows CFX to use the hybrid values in functions like areaAve(...).

Also, in another thread I read that there is the possibility to change the "dependency lists" for the additional variable which could possibly fix the error quoted by aks. Can anyone give me some advice on that?

Thanks!
Max
murx 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
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
plot over time fferroni OpenFOAM Post-Processing 7 June 8, 2012 07:56
calculation diverge after continue to run zhajingjing OpenFOAM 0 April 28, 2010 04:35
DPM UDF particle position using the macro P_POS(p)[i] dm2747 FLUENT 0 April 17, 2009 01:29
Transient simulation not converging skabilan OpenFOAM Running, Solving & CFD 12 September 17, 2007 17:48


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