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

Can CEL read a C-Program

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By ghorrocks
  • 1 Post By ghorrocks

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 11, 2015, 05:06
Post Can CEL read a C-Program
  #1
AK5
New Member
 
Join Date: Oct 2015
Posts: 17
Rep Power: 10
AK5 is on a distinguished road
Hi Guys,
I am trying to write a expression for a transient study.
The temperature of the body increases 10[c] for every 10[s] till it reaches a temperature of some 120[c]. (llike a step to the top).
so can CEL read a c-program that contains i++, for, if ,else...etc?

Thankyou
Best Regards
AK5 is offline   Reply With Quote

Old   December 11, 2015, 06:42
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
No, CEL cannot read a C++ file.

You can write a fortran file which can return values you can refer to as a CEL variable.

But the function you describe can be written directly in CEL. No need for fortran or C++ for a simple function like that.
AK5 likes this.
ghorrocks is offline   Reply With Quote

Old   December 11, 2015, 08:34
Default
  #3
AK5
New Member
 
Join Date: Oct 2015
Posts: 17
Rep Power: 10
AK5 is on a distinguished road
Thankyou for replying

I am kind of new to writing CEL expressions.. so i wanted to try something which i knew.

can you recommend me some link or study material so that i can learn how to write this step function in CEL.

Thankyou in Advance
AK5 is offline   Reply With Quote

Old   December 11, 2015, 17:38
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Have a look at the CFX tutorial examples and the reference manual.
ghorrocks is offline   Reply With Quote

Old   December 12, 2015, 05:48
Default
  #5
AK5
New Member
 
Join Date: Oct 2015
Posts: 17
Rep Power: 10
AK5 is on a distinguished road
Thankyou Glenn
AK5 is offline   Reply With Quote

Old   December 18, 2015, 01:49
Default
  #6
AK5
New Member
 
Join Date: Oct 2015
Posts: 17
Rep Power: 10
AK5 is on a distinguished road
I have written this expression for the above said problem


step((t-10[s])/1[s])*10[c]+ step((t-20[s])/1[s])*10[c]+ ....
+ step((t-120[s])/1[s])*10[c]

Is there any way i can reduce the size of the expression ?

Thankyou in Advance
AK5 is offline   Reply With Quote

Old   December 18, 2015, 05:30
Default
  #7
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
The if() statement can simplify some expressions. The mod() function is good for repeating functions. You can also use 1D interpolation functions as well.
AK5 likes this.
ghorrocks is offline   Reply With Quote

Reply

Tags
c-program, cel, transient


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
how to calculate mass flow rate on patches and summation of that during the run? immortality OpenFOAM Post-Processing 104 February 16, 2021 08:46
Read Mesh peterwy OpenFOAM Programming & Development 0 April 15, 2010 05:14
Update boundary conditions calculated by an external program CedricVH OpenFOAM 2 January 15, 2010 11:55
problem when converting mesh (made by ICEM) using fluentMeshToFoam Forrest_Lei OpenFOAM 11 October 16, 2009 06:28
Error Fluents TDL FLUENT 6 April 26, 2005 06:02


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