|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Join Date: Oct 2015
Posts: 17
Rep Power: 11 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,933
Rep Power: 145 ![]() ![]() ![]() ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Join Date: Oct 2015
Posts: 17
Rep Power: 11 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,933
Rep Power: 145 ![]() ![]() ![]() ![]() |
Have a look at the CFX tutorial examples and the reference manual.
|
|
![]() |
![]() |
![]() |
![]() |
#5 |
New Member
Join Date: Oct 2015
Posts: 17
Rep Power: 11 ![]() |
Thankyou Glenn
|
|
![]() |
![]() |
![]() |
![]() |
#6 |
New Member
Join Date: Oct 2015
Posts: 17
Rep Power: 11 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#7 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,933
Rep Power: 145 ![]() ![]() ![]() ![]() |
The if() statement can simplify some expressions. The mod() function is good for repeating functions. You can also use 1D interpolation functions as well.
|
|
![]() |
![]() |
![]() |
Tags |
c-program, cel, transient |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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 |