
[Sponsors] 
October 8, 2010, 10:41 
USER_FORTRAN call variable at past timestep

#1 
New Member
Filippo Pellacani
Join Date: Jul 2010
Location: München
Posts: 13
Rep Power: 7 
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 = ´TSTEP1´ Call the actual timestep value in the point using the getvar with where option = `latest´ Is it ok? Thank you in advance, Filippo 

October 8, 2010, 13:09 

#2 
Senior Member
Join Date: Mar 2009
Location: Europe
Posts: 168
Rep Power: 8 
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 TIME1 and in some cases to TIME2.


October 11, 2010, 04:36 

#3 
New Member
Filippo Pellacani
Join Date: Jul 2010
Location: München
Posts: 13
Rep Power: 7 
dear joey2007,
user_getvar with where option = ´Time1´ should be used to call the values at the previous timestep. Is this what you mean in your reply? 

October 13, 2010, 13:50 

#4 
Senior Member
Join Date: Mar 2009
Location: Europe
Posts: 168
Rep Power: 8 
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. 

October 14, 2010, 02:59 
The problem of inner iteration when calling the subroutine

#5 
New Member
Join Date: Oct 2010
Posts: 6
Rep Power: 6 
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 

October 14, 2010, 06:23 

#6 
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 10,826
Rep Power: 85 
Can you explain what you are doing?


October 14, 2010, 11:19 

#7 
New Member
Join Date: Oct 2010
Posts: 6
Rep Power: 6 
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! 

October 14, 2010, 15:31 

#8 
Senior Member
Join Date: Mar 2009
Location: Europe
Posts: 168
Rep Power: 8 
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?


October 14, 2010, 21:23 

#9 
Senior Member
Michael P. Owen
Join Date: Mar 2009
Posts: 195
Rep Power: 8 
Also, unless there's something more complex, there's no reason to use fortran for this.


October 14, 2010, 22:24 

#10  
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 10,826
Rep Power: 85 
Quote:


May 20, 2011, 05:33 

#11 
New Member
Filippo Pellacani
Join Date: Jul 2010
Location: München
Posts: 13
Rep Power: 7 
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. 

June 14, 2012, 09:52 

#12 
New Member
Benjamin B.
Join Date: Nov 2009
Posts: 4
Rep Power: 7 
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 fieldvalues.
Many thanks in advance for you. Ben 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
error in COMSOL:'ERROR:6164 Duplicate Variable'  bhushas  Main CFD Forum  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 05:27 
Replace periodic by inletoutlet pair  lego  CFX  3  November 5, 2002 21:09 
2D CFD code using SIMPLE algorithm  bfan  Main CFD Forum  3  June 22, 2002 22:01 