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

derivative in CEL expressions

Register Blogs Community New Posts Updated Threads Search

Like Tree20Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 24, 2023, 00:18
Default
  #81
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
This thread discusses many ways to do it.

You can use the <Variable>.Time Derivative method - this is preferred if it works for the variable you want.

You can write a user fortran routine to do it. Then you can do anything, but user fortran requires a bit of work to learn to use.

You can use the TRANS_LOOP approach. Most of this thread is on this approach, but note it is unsupported and does not seem to work for soem cases.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   October 24, 2023, 01:53
Default
  #82
New Member
 
zh
Join Date: Oct 2023
Posts: 13
Rep Power: 3
zh&c is on a distinguished road
I followed the method in this literature but the expression for the last time step I don t know how to determine.



https://www.researchgate.net/publica...l_in_ANSYS-CFX
zh&c is offline   Reply With Quote

Old   October 24, 2023, 02:05
Default
  #83
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
Doesn't that paper and lots of posts on this thread explain how to do it?

If you are having problems with getting it to work then you need to tell us what your problem is (like an error message).
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   October 24, 2023, 02:51
Default
  #84
New Member
 
zh
Join Date: Oct 2023
Posts: 13
Rep Power: 3
zh&c is on a distinguished road
There seems to be no problem with the setting, the calculation has converged, but the results are not accurate, I calculated the data of three cardiac cycles.

This is my CEL.





Beta = C*R2/Deta t
Blood Density = 1050[kg/m^3]
C = (1.7529*10^(-10))[m^3/Pa]
Deta t = 0.02[s]
Inlet Flow = Function Inlet Flow 3(t)*Blood Density
Normal V = ((w)-(w.Time Derivative*dtstep))
P = (((R1+R2+R1*Beta)*QN+Beta*Previous Outlet Pressure \
-R1*Beta*Previous Outlet Flow )/(1+Beta))
P0 = 96.2327[mmHg]
PN = areaAve(Pressure )@OUTLET
Previous Flow = abs(areaInt(Normal Velocity )@OUTLET)
Previous Pressure = (areaAve(Pressure )@OUTLET-(Pressure.Time \
Derivative*dtstep))
Q0 = 0.39[l/min]
QN = abs(areaInt(w)@OUTLET)
R1 = (2.4875*10^8)[Pa*s/m^3]
R2 = (1.8697*10^9)[Pa*s/m^3]

ADDITIONAL VARIABLE: Normal Velocity
Option = Definition
Tensor Type = SCALAR
Units = [m/s ]
Update Loop = TRANS_LOOP
Variable Type = Specific
END
ADDITIONAL VARIABLE: Previous Outlet Flow
Option = Definition
Tensor Type = SCALAR
Units = [ml/s]
Update Loop = TRANS_LOOP
Variable Type = Volumetric
END
ADDITIONAL VARIABLE: Previous Outlet Pressure
Option = Definition
Tensor Type = SCALAR
Units = [mmHg ]
Update Loop = TRANS_LOOP
Variable Type = Specific
END
zh&c is offline   Reply With Quote

Old   October 24, 2023, 03:23
Default
  #85
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
There is a LOT more to getting an accurate result than a bit of CCL. Did the calculations of the previous values you included work?
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   October 24, 2023, 03:30
Default
  #86
New Member
 
zh
Join Date: Oct 2023
Posts: 13
Rep Power: 3
zh&c is on a distinguished road
I use the data in the literature, but there is a big gap between my results and the literature, so I think there is still a problem with the expression of my export flow. I use the area score of the normal speed of the export, but this seems to have a certain error with the expression of CFX: massFlow() @OUTLET / Blood Density.
zh&c is offline   Reply With Quote

Old   April 11, 2024, 06:19
Default
  #87
Senior Member
 
Jiri
Join Date: Mar 2014
Posts: 221
Rep Power: 13
Jiricbeng is on a distinguished road
Hello guys,

for some kind of reason, the approach based on creating the expression with .Time Derivative does not work.
I tried Pressure.Time Derivative, Velocity u.Time Derivative, Temperature.Time Derivative... I always get the error message about unrecognised name.
I save each time step. Is there needed any special setting in CFX Pre ?

Do you have any idea please?
Jiricbeng is offline   Reply With Quote

Old   April 11, 2024, 06:46
Default
  #88
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
Can you attach the CCL of your simulation? You can export this from CFX-Pre.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   April 11, 2024, 06:58
Default
  #89
Senior Member
 
Jiri
Join Date: Mar 2014
Posts: 221
Rep Power: 13
Jiricbeng is on a distinguished road
Please, see the attachment..
Attached Files
File Type: txt pokusCCL.txt (16.6 KB, 5 views)
Jiricbeng is offline   Reply With Quote

Old   April 11, 2024, 18:09
Default
  #90
Senior Member
 
Join Date: Jun 2009
Posts: 1,880
Rep Power: 33
Opaque will become famous soon enough
Quote:
Originally Posted by Jiricbeng View Post
Hello guys,

for some kind of reason, the approach based on creating the expression with .Time Derivative does not work.
I tried Pressure.Time Derivative, Velocity u.Time Derivative, Temperature.Time Derivative... I always get the error message about unrecognised name.
I save each time step. Is there needed any special setting in CFX Pre ?

Do you have any idea please?
What release version are you using? I used it all the time, and your syntax is correct.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
Opaque is offline   Reply With Quote

Old   April 12, 2024, 02:53
Default
  #91
Senior Member
 
Join Date: Feb 2011
Posts: 496
Rep Power: 18
Antanas is on a distinguished road
Quote:
Originally Posted by Opaque View Post
What release version are you using? I used it all the time, and your syntax is correct.
According to info in the file this is 2022 R2.
Antanas is offline   Reply With Quote

Old   April 12, 2024, 06:15
Default
  #92
Senior Member
 
Jiri
Join Date: Mar 2014
Posts: 221
Rep Power: 13
Jiricbeng is on a distinguished road
Yes, the version 2022 R2. However, version 2023 R2 does not work either (I opened the results in CFD Post). But I do not think it is matter of version as this did not work to me even a few years ago.
May that be some defaults, e.g. something dug in inside the expert parameters?
Jiricbeng is offline   Reply With Quote

Old   April 12, 2024, 09:00
Default
  #93
Senior Member
 
Join Date: Jun 2009
Posts: 1,880
Rep Power: 33
Opaque will become famous soon enough
Quote:
Originally Posted by Antanas View Post
According to info in the file this is 2022 R2.
That should work; however, the answer is conditional.

.Time Derivative ONLY works in the CFX-Pre/Solver environment. It does NOT work in CFD-Post unless the variable is already written by the solver.

Then, where are you trying to use it? CFX-Pre, or CFD-Post.?
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
Opaque is offline   Reply With Quote

Old   April 15, 2024, 08:53
Default
  #94
Senior Member
 
Jiri
Join Date: Mar 2014
Posts: 221
Rep Power: 13
Jiricbeng is on a distinguished road
I am sorry for the late answer. I did it also in CFD Pre as expression:

Pressure.Time Derivative


But when clicking on this in CFD Post, it says: The following unrecognised name was referenced: Pressure.Time Derivative.

I tried also areaAve(Velocity u.Time Derivative)@rotating in CFX Pre, as the previous case is "variable", but there is still the same error in CFD Post.
Jiricbeng is offline   Reply With Quote

Old   April 15, 2024, 13:26
Default
  #95
Senior Member
 
Join Date: Jun 2009
Posts: 1,880
Rep Power: 33
Opaque will become famous soon enough
Quote:
Originally Posted by Jiricbeng View Post
I am sorry for the late answer. I did it also in CFD Pre as expression:

Pressure.Time Derivative


But when clicking on this in CFD Post, it says: The following unrecognised name was referenced: Pressure.Time Derivative.

I tried also areaAve(Velocity u.Time Derivative)@rotating in CFX Pre, as the previous case is "variable", but there is still the same error in CFD Post.
If the variable XXX.Time Derivative is not already in the results file, CFD-Post will show that error message -> The variable does not exist, and it is NOT able to compute it.

It seems you were able to finish the simulation using XXx.Time Derivative in your expressions, correct?
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
Opaque is offline   Reply With Quote

Old   April 15, 2024, 15:00
Default
  #96
Senior Member
 
Jiri
Join Date: Mar 2014
Posts: 221
Rep Power: 13
Jiricbeng is on a distinguished road
Quote:
Originally Posted by Opaque View Post
It seems you were able to finish the simulation using XXx.Time Derivative in your expressions, correct?
Yes, I defined the expression in CFX Pre, computation ran without problems and finished. And this message appears in CFD Post.
Jiricbeng is offline   Reply With Quote

Old   April 17, 2024, 12:49
Default
  #97
Senior Member
 
Jiri
Join Date: Mar 2014
Posts: 221
Rep Power: 13
Jiricbeng is on a distinguished road
Any ideas please? May I share the file with you to test it? Or vice versa, if some of you could share the cfx file where it works...
Jiricbeng is offline   Reply With Quote

Old   April 17, 2024, 14:05
Default
  #98
Senior Member
 
Join Date: Jun 2009
Posts: 1,880
Rep Power: 33
Opaque will become famous soon enough
Quote:
Originally Posted by Jiricbeng View Post
Any ideas please? May I share the file with you to test it? Or vice versa, if some of you could share the cfx file where it works...
CFD-Post does not support those variables, XXX.Time Derivative UNLESS they ARE already in the results file.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
Opaque is offline   Reply With Quote

Old   April 18, 2024, 05:02
Default
  #99
Senior Member
 
Jiri
Join Date: Mar 2014
Posts: 221
Rep Power: 13
Jiricbeng is on a distinguished road
Opaque, thank you for clarifying.
So, to sum it up again, how shall I understand it - I defined the variable "Pressure.Time Derivative" in Pre, then ran the solver and opened the result file in CFD Post. But for some reason this variable does not work in CFD Post.
I understood that situation to be strange and that it should work. Or, please, did I miss some step in between?
Jiricbeng is offline   Reply With Quote

Old   April 18, 2024, 06:49
Default
  #100
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
Have you tried going to the CFX-Pre output tab and putting [variable].Time Derivative in the results file? It looks like by default they are not included in the results file.
Opaque likes this.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks 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
Cel expressions RAMAN6089 CFX 13 December 1, 2009 00:17
junction box routine and CEL function bornspur CFX 2 February 3, 2009 03:24
Cel expressions for trasient problem Jervds CFX 0 March 4, 2008 11:03
Cel expressions Time dependent Juan Maria Campos CFX 8 December 27, 2007 19:16
CEL Expressions Nick CFX 3 September 25, 2007 15:54


All times are GMT -4. The time now is 02:58.