|
[Sponsors] |
June 12, 2014, 00:11 |
Expression in CFX
|
#1 |
Disabled
Join Date: Feb 2013
Posts: 16
Rep Power: 13 |
hello,
I need help please. I want to add a nonlinear expression in CFX of the form: X=1-(1/((1-X)^-a+B*exp(-C/(D*E))*F*n))^a the simulation is transient, I have to give initial value X0 to start the calculation, and each timestem it should take the new value of X like initial value. Is it possible to do that with CFX? if so, can someone help me please. thanks |
|
June 12, 2014, 03:56 |
|
#2 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
You cannot have implicit expressions like this in CEL.
You can access the time derivative of variables using the .dt operator (see reference manual, CEL functions) - but this is for field variables, not CEL variables. So you could send your CEL variable to a field variable if you like. You can also use the TRANS_LOOP trick. See this thread: http://www.cfd-online.com/Forums/cfx...pressions.html - But note this applies to field variables and not CEL as well. |
|
June 12, 2014, 17:36 |
|
#3 |
Disabled
Join Date: Feb 2013
Posts: 16
Rep Power: 13 |
Is it possible to learn to do this from a tutorial?
|
|
June 12, 2014, 19:40 |
|
#4 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
If you are looking for a tutorial on implicit expressions then you will not find one as it cannot be done.
There is no tutorial on the dt operator either - but just read the documentation on CFX expressions and give it a try. It is not that hard. There is no tutorial on the TRANS_LOOP thing either as that is an undocumented feature and not officially supported. |
|
August 9, 2014, 13:52 |
Junction box Routine
|
#5 |
Disabled
Join Date: Feb 2013
Posts: 16
Rep Power: 13 |
I am trying to export temperature profile for each time step from a transient simulation. In the *.doc file I am shoing the steps I followed to do this.
After runing the program I am getting one empty file. Can anyone please show me how I can call temperature for eache time step. Thank you in advece Last edited by anon_f; August 11, 2014 at 21:39. |
|
August 10, 2014, 06:44 |
|
#6 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
Are you trying to implement the equation you describe in post #1? You should be able to do this in the fortran routine. So why do you want to save a temperature profile every time step?
|
|
August 10, 2014, 14:39 |
|
#7 |
Disabled
Join Date: Feb 2013
Posts: 16
Rep Power: 13 |
Yes I am still trying to implement that equation.
In FORTRAN, I can do it, in this way: Xold(1)=1.e-8 do i=2,n T(i)=-0.0005*(i*dt)**3+0.1007*(i*dt)**2+2.0603*(i*dt)+35 .134 X(i)=1-exp(-E/R/T(i))*dt*(n-1)+(1-Xold(i-1))**n)**(n) Xold(i)=X(i) enddo Here the temperature profile I am giving it in fortran, but in the real case I am calculating it in CFX in a domain with specific boundary conditions. I want to save temperature for each Time Step to use it in the equation. This is why I am trying to know how to import Temperature. Is it the good way to use Fortran Routine, or have you any simple method to advise me? Last edited by anon_f; August 11, 2014 at 21:39. |
|
August 10, 2014, 19:36 |
|
#8 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
Yes, you can export data during simulations using fortran. This method is very slow and inefficient so you should consider implementing it all in CFX or using the FSI coupling to ANSYS if possible. But none of that can be done then you just have to put up with a slow method I guess.
|
|
August 10, 2014, 20:02 |
|
#9 |
Disabled
Join Date: Feb 2013
Posts: 16
Rep Power: 13 |
How to use FORTRAN routine? Can you please give me more details?
Did you see the steps I detailed in the doc file ? in your opinion, what should I do to link the cfx model to Fortran routine and do calculations? Thank you for your help Last edited by anon_f; August 11, 2014 at 21:39. |
|
August 10, 2014, 21:43 |
|
#10 |
Disabled
Join Date: Feb 2013
Posts: 16
Rep Power: 13 |
can you show me how to use fortran routine please ?
Last edited by anon_f; August 11, 2014 at 21:39. |
|
August 11, 2014, 05:32 |
|
#11 |
Member
Peter
Join Date: Sep 2011
Location: Germany
Posts: 39
Rep Power: 15 |
Have a look at the modeling guide (chapter 18.8) on how to use junction boxes.
To access time variables you need the command "USER_GET_TRANS_INFO" As far as i understand your problem the command "CALL USER_GETGVAR" will give you an averaged Temperature field at a boundary. Then solve your expression and return the new value. All explained in the documentation |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Evaluate expression in CFX pro | Sara | CFX | 0 | January 7, 2009 13:34 |
Relief Plots in CFX | Michael | CFX | 15 | June 30, 2006 09:01 |
CFX Expression Statement | Ivan | CFX | 3 | June 5, 2006 12:42 |
cfx expression variables | Manoj Kumar | CFX | 2 | February 16, 2006 11:03 |
CFX 4.4 installation problem | Pandu Sattvika | CFX | 1 | December 1, 2001 05:07 |