|
[Sponsors] |
October 8, 2010, 11:41 |
USER_FORTRAN call variable at past timestep
|
#1 |
New Member
Filippo Pellacani
Join Date: Jul 2010
Location: München
Posts: 13
Rep Power: 16 |
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 |
|
October 8, 2010, 14:09 |
|
#2 |
Senior Member
Join Date: Mar 2009
Location: Europe
Posts: 169
Rep Power: 17 |
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.
|
|
October 11, 2010, 05:36 |
|
#3 |
New Member
Filippo Pellacani
Join Date: Jul 2010
Location: München
Posts: 13
Rep Power: 16 |
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? |
|
October 13, 2010, 14:50 |
|
#4 |
Senior Member
Join Date: Mar 2009
Location: Europe
Posts: 169
Rep Power: 17 |
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, 03:59 |
The problem of inner iteration when calling the subroutine
|
#5 |
New Member
Join Date: Oct 2010
Posts: 6
Rep Power: 16 |
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, 07:23 |
|
#6 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
Can you explain what you are doing?
|
|
October 14, 2010, 12:19 |
|
#7 |
New Member
Join Date: Oct 2010
Posts: 6
Rep Power: 16 |
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, 16:31 |
|
#8 |
Senior Member
Join Date: Mar 2009
Location: Europe
Posts: 169
Rep Power: 17 |
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, 22:23 |
|
#9 |
Senior Member
Michael P. Owen
Join Date: Mar 2009
Posts: 196
Rep Power: 17 |
Also, unless there's something more complex, there's no reason to use fortran for this.
|
|
October 14, 2010, 23:24 |
|
#10 | |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
Quote:
|
||
May 20, 2011, 06:33 |
|
#11 |
New Member
Filippo Pellacani
Join Date: Jul 2010
Location: München
Posts: 13
Rep Power: 16 |
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, 10:52 |
|
#12 |
New Member
Benjamin B.
Join Date: Nov 2009
Posts: 4
Rep Power: 17 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
error in COMSOL:'ERROR:6164 Duplicate Variable' | bhushas | COMSOL | 1 | May 30, 2008 05:35 |
Plot variable vs timestep | Sans | CFX | 3 | May 29, 2008 19:55 |
Env variable not set | gruber2 | OpenFOAM Installation | 5 | December 30, 2005 05:27 |
Replace periodic by inlet-outlet pair | lego | CFX | 3 | November 5, 2002 21:09 |
2D CFD code using SIMPLE algorithm | bfan | Main CFD Forum | 3 | June 22, 2002 23:01 |