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

Expression in CFX

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By ghorrocks
  • 1 Post By anon_f
  • 1 Post By PeMo

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 12, 2014, 00:11
Default Expression in CFX
  #1
Disabled
 
Join Date: Feb 2013
Posts: 16
Rep Power: 13
anon_f is on a distinguished road
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
anon_f is offline   Reply With Quote

Old   June 12, 2014, 03:56
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
ghorrocks is offline   Reply With Quote

Old   June 12, 2014, 17:36
Default
  #3
Disabled
 
Join Date: Feb 2013
Posts: 16
Rep Power: 13
anon_f is on a distinguished road
Is it possible to learn to do this from a tutorial?
anon_f is offline   Reply With Quote

Old   June 12, 2014, 19:40
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
Saeef likes this.
ghorrocks is offline   Reply With Quote

Old   August 9, 2014, 13:52
Default Junction box Routine
  #5
Disabled
 
Join Date: Feb 2013
Posts: 16
Rep Power: 13
anon_f is on a distinguished road
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.
anon_f is offline   Reply With Quote

Old   August 10, 2014, 06:44
Default
  #6
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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?
ghorrocks is offline   Reply With Quote

Old   August 10, 2014, 14:39
Default
  #7
Disabled
 
Join Date: Feb 2013
Posts: 16
Rep Power: 13
anon_f is on a distinguished road
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?
Saeef likes this.

Last edited by anon_f; August 11, 2014 at 21:39.
anon_f is offline   Reply With Quote

Old   August 10, 2014, 19:36
Default
  #8
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
ghorrocks is offline   Reply With Quote

Old   August 10, 2014, 20:02
Default
  #9
Disabled
 
Join Date: Feb 2013
Posts: 16
Rep Power: 13
anon_f is on a distinguished road
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.
anon_f is offline   Reply With Quote

Old   August 10, 2014, 21:43
Default
  #10
Disabled
 
Join Date: Feb 2013
Posts: 16
Rep Power: 13
anon_f is on a distinguished road
can you show me how to use fortran routine please ?

Last edited by anon_f; August 11, 2014 at 21:39.
anon_f is offline   Reply With Quote

Old   August 11, 2014, 05:32
Default
  #11
Member
 
Peter
Join Date: Sep 2011
Location: Germany
Posts: 39
Rep Power: 15
PeMo is on a distinguished road
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
Saeef likes this.
PeMo is offline   Reply With Quote

Reply


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
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


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