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

 September 24, 2013, 09:24 how to use velocity of previous time step in current time step to update it #1 New Member   ajay ks Join Date: Aug 2012 Posts: 13 Rep Power: 7 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.

 September 24, 2013, 10:29 #2 New Member   ajay ks Join Date: Aug 2012 Posts: 13 Rep Power: 7 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.

 September 24, 2013, 16:23 #3 Senior Member   Erik Join Date: Feb 2011 Location: Earth (Land portion) Posts: 694 Rep Power: 13 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.

 September 24, 2013, 22:35 #4 New Member   ajay ks Join Date: Aug 2012 Posts: 13 Rep Power: 7 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

 September 27, 2013, 00:11 #5 Senior Member   Erik Join Date: Feb 2011 Location: Earth (Land portion) Posts: 694 Rep Power: 13 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.

September 27, 2013, 23:42
#6
New Member

ajay ks
Join Date: Aug 2012
Posts: 13
Rep Power: 7
Quote:
 Originally Posted by evcelica 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
 velocity.png (9.8 KB, 14 views) acceleration.png (12.3 KB, 8 views)

Last edited by aks; September 30, 2013 at 10:50.

 September 28, 2013, 13:03 #7 New Member   ajay ks Join Date: Aug 2012 Posts: 13 Rep Power: 7 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!

 September 30, 2013, 10:03 #8 Senior Member   Erik Join Date: Feb 2011 Location: Earth (Land portion) Posts: 694 Rep Power: 13 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.

 September 30, 2013, 11:03 #9 New Member   ajay ks Join Date: Aug 2012 Posts: 13 Rep Power: 7 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..

October 2, 2013, 01:07
#10
New Member

ajay ks
Join Date: Aug 2012
Posts: 13
Rep Power: 7
Quote:
 Originally Posted by evcelica 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.?

 October 2, 2013, 09:53 #11 Senior Member   Edmund Singer P.E. Join Date: Aug 2010 Location: Minneapolis, MN Posts: 512 Rep Power: 14 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.

 October 2, 2013, 09:56 #12 Senior Member   Edmund Singer P.E. Join Date: Aug 2010 Location: Minneapolis, MN Posts: 512 Rep Power: 14 Ahh, i see. Acceleration is not constant. Please ignore last post.

 October 2, 2013, 09:59 #13 Senior Member   Edmund Singer P.E. Join Date: Aug 2010 Location: Minneapolis, MN Posts: 512 Rep Power: 14 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.

October 2, 2013, 10:58
#14
New Member

ajay ks
Join Date: Aug 2012
Posts: 13
Rep Power: 7
Quote:
 Originally Posted by singer1812 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]

 October 2, 2013, 11:04 #15 Senior Member   Edmund Singer P.E. Join Date: Aug 2010 Location: Minneapolis, MN Posts: 512 Rep Power: 14 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.

 October 2, 2013, 11:09 #16 New Member   ajay ks Join Date: Aug 2012 Posts: 13 Rep Power: 7 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.

 October 16, 2013, 07:14 #17 Member   Max Join Date: May 2011 Location: old europe Posts: 88 Rep Power: 8 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

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20 fferroni OpenFOAM Post-Processing 7 June 8, 2012 07:56 zhajingjing OpenFOAM 0 April 28, 2010 04:35 dm2747 FLUENT 0 April 17, 2009 01:29 skabilan OpenFOAM Running, Solving & CFD 12 September 17, 2007 17:48

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