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

USER_FORTRAN call variable at past timestep

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

Like Tree1Likes
  • 1 Post By fipellac

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 8, 2010, 10:41
Default USER_FORTRAN call variable at past timestep
  #1
New Member
 
Filippo Pellacani
Join Date: Jul 2010
Location: München
Posts: 13
Rep Power: 15
fipellac is on a distinguished road
Hi,

I implemented already an Additional Variable under the form of a Transport equation. I didn´t get good results and I would like to have full control on the implemented transport equation.
The problem is essentially the presence of the diffusive term in the equation provided by Ansys CFX (I don´t need it) and the presence of the volume fraction in the formulation of each term.

For this reason I decided to implement a new variable linked to User_CEL. Inside the routine then, linearize the system and solve it iteratively.

I would like to receive some information regarding the following aspect:

1) Transient term: d(variable)/dt

Call the previous timestep value in the point using the getvar with where option = ´TSTEP-1´
Call the actual timestep value in the point using the getvar with where option = `latest´
Is it ok?

Thank you in advance,

Filippo
fipellac is offline   Reply With Quote

Old   October 8, 2010, 13:09
Default
  #2
Senior Member
 
Join Date: Mar 2009
Location: Europe
Posts: 169
Rep Power: 17
joey2007 is on a distinguished road
Getvar is internal and undocumented. I attended an extensive user fortran training some years ago. The trainer commented it only on one slide. Getvar requires more arguments than user_getvar (which is reduced version of getvar). There is a when argument, which can be set to TIME-1 and in some cases to TIME-2.
joey2007 is offline   Reply With Quote

Old   October 11, 2010, 04:36
Talking
  #3
New Member
 
Filippo Pellacani
Join Date: Jul 2010
Location: München
Posts: 13
Rep Power: 15
fipellac is on a distinguished road
dear joey2007,

user_getvar with where option = ´Time-1´ should be used to call the values at the previous timestep. Is this what you mean in your reply?
fipellac is offline   Reply With Quote

Old   October 13, 2010, 13:50
Default
  #4
Senior Member
 
Join Date: Mar 2009
Location: Europe
Posts: 169
Rep Power: 17
joey2007 is on a distinguished road
It is not user_getvar. Please read exactly what I wrote above. I do not have more info. As I stated it was some years ago that I was in Harwell. I guess you have to ask the service.

On the other hand I do not understand why it should not be possible to implement the transport equation via add. var.???? May be you post the transport equation that we can discuss.
joey2007 is offline   Reply With Quote

Old   October 14, 2010, 02:59
Default The problem of inner iteration when calling the subroutine
  #5
New Member
 
Join Date: Oct 2010
Posts: 6
Rep Power: 15
guoxj is on a distinguished road
Hello every.I now encountered a difficult problem.
I want to Calculate for a transient simulation in cfx, and there is a angular velocity need to be defined in the rotational domain.The problem is that angular velocity omega need to be updated every timestep. The defined omega expression is in the form of function which can be called in cfx. The question is that the iteration of omega can not proceed correctly.My aim is to update the omega only once every timestep,but in actual calculation, the omega function is just called dozens per inner iteration.I eager to konw how to achieve my goal of updating omega correctly.
Thanks in advance.
guoxj
guoxj is offline   Reply With Quote

Old   October 14, 2010, 06:23
Default
  #6
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,697
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Can you explain what you are doing?
ghorrocks is online now   Reply With Quote

Old   October 14, 2010, 11:19
Default
  #7
New Member
 
Join Date: Oct 2010
Posts: 6
Rep Power: 15
guoxj is on a distinguished road
Ok! I am simulating the starting behavior of a domain including Impeller, using a Fortran subroutine.The subroutine is used to update the angular velocity of the domain.And I calculate the angular velocity taking into account the torque generated by the blade parts and the inertia of the impeller, and this value is used by the cfx solver to set the angular velocity of the blade. The subroutine is used to calculate angular velocity of the rotational domain in the timestep n by using the value of previous time step.The problem is, when the calculation is proceeding,although the cycle is set to update angular velocity at the start of a new timestep, the subroutine is called many times per inner iteration,not once every timestep. That is angular velocity has been updated dozens of times within each iteration. I want to what is the reason of it? And how to solve this problem?

Looking forward to your reply!
guoxj is offline   Reply With Quote

Old   October 14, 2010, 15:31
Default
  #8
Senior Member
 
Join Date: Mar 2009
Location: Europe
Posts: 169
Rep Power: 17
joey2007 is on a distinguished road
Guess it should be easy to capture this by some if´s in the user fortran routine. BTW: Do not know what the admins say, however isn´t it preferable to open a new thread for new question?
joey2007 is offline   Reply With Quote

Old   October 14, 2010, 21:23
Default
  #9
Senior Member
 
Michael P. Owen
Join Date: Mar 2009
Posts: 196
Rep Power: 17
michael_owen is on a distinguished road
Also, unless there's something more complex, there's no reason to use fortran for this.
michael_owen is offline   Reply With Quote

Old   October 14, 2010, 22:24
Default
  #10
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,697
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Quote:
isn´t it preferable to open a new thread for new question?
Yes, this question should be a new thread. Nobody likes their thread being hijacked. But I have given up trying to enforce it as it happens so much. So generally I only bother taking action when asked or it has some other problem with it (spam, insulting, duplicate, inappropriate etc).
ghorrocks is online now   Reply With Quote

Old   May 20, 2011, 05:33
Default
  #11
New Member
 
Filippo Pellacani
Join Date: Jul 2010
Location: München
Posts: 13
Rep Power: 15
fipellac is on a distinguished road
i got the answer from the customer support for a simple use of user cels.

within USER_CEL Routines you can ask for the time derivative with the Utility routine USER_GETVAR, if you define the operator 'Time Derivative'. See documentation about USER_GETVAR On CFX Expression Level you could use Variable.Time Derivative.
lostking18 likes this.
fipellac is offline   Reply With Quote

Old   June 14, 2012, 09:52
Default
  #12
New Member
 
Benjamin B.
Join Date: Nov 2009
Posts: 4
Rep Power: 16
astray is on a distinguished road
So is it possible to get the actual angular velocity of a domain by a USER_GETVAR CALL? Do you have these two lines for me? In my case in doesn't work. Error message says it would only work for field-values.

Many thanks in advance for you.

Ben
astray is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
error in COMSOL:'ERROR:6164 Duplicate Variable' bhushas COMSOL 1 May 30, 2008 04:35
Plot variable vs timestep Sans CFX 3 May 29, 2008 18:55
Env variable not set gruber2 OpenFOAM Installation 5 December 30, 2005 04:27
Replace periodic by inlet-outlet pair lego CFX 3 November 5, 2002 20:09
2D CFD code using SIMPLE algorithm bfan Main CFD Forum 3 June 22, 2002 22:01


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