# derivative in CEL expressions

 Register Blogs Members List Search Today's Posts Mark Forums Read

 October 23, 2023, 23:18 #81 Super Moderator   Glenn Horrocks Join Date: Mar 2009 Location: Sydney, Australia Posts: 17,729 Rep Power: 143 This thread discusses many ways to do it. You can use the .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.

 October 24, 2023, 00:53 #82 New Member   zh Join Date: Oct 2023 Posts: 13 Rep Power: 2 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

 October 24, 2023, 01:05 #83 Super Moderator   Glenn Horrocks Join Date: Mar 2009 Location: Sydney, Australia Posts: 17,729 Rep Power: 143 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.

 October 24, 2023, 01:51 #84 New Member   zh Join Date: Oct 2023 Posts: 13 Rep Power: 2 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

 October 24, 2023, 02:23 #85 Super Moderator   Glenn Horrocks Join Date: Mar 2009 Location: Sydney, Australia Posts: 17,729 Rep Power: 143 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.

 October 24, 2023, 02:30 #86 New Member   zh Join Date: Oct 2023 Posts: 13 Rep Power: 2 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.

 April 11, 2024, 05:19 #87 Senior Member   Jiri Join Date: Mar 2014 Posts: 218 Rep Power: 13 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?

 April 11, 2024, 05:46 #88 Super Moderator   Glenn Horrocks Join Date: Mar 2009 Location: Sydney, Australia Posts: 17,729 Rep Power: 143 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.

April 11, 2024, 05:58
#89
Senior Member

Jiri
Join Date: Mar 2014
Posts: 218
Rep Power: 13
Attached Files
 pokusCCL.txt (16.6 KB, 5 views)

April 11, 2024, 17:09
#90
Senior Member

Join Date: Jun 2009
Posts: 1,815
Rep Power: 32
Quote:
 Originally Posted by Jiricbeng 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.

April 12, 2024, 01:53
#91
Senior Member

Join Date: Feb 2011
Posts: 496
Rep Power: 18
Quote:
 Originally Posted by Opaque 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.

 April 12, 2024, 05:15 #92 Senior Member   Jiri Join Date: Mar 2014 Posts: 218 Rep Power: 13 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?

April 12, 2024, 08:00
#93
Senior Member

Join Date: Jun 2009
Posts: 1,815
Rep Power: 32
Quote:
 Originally Posted by Antanas 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.

 April 15, 2024, 07:53 #94 Senior Member   Jiri Join Date: Mar 2014 Posts: 218 Rep Power: 13 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.

April 15, 2024, 12:26
#95
Senior Member

Join Date: Jun 2009
Posts: 1,815
Rep Power: 32
Quote:
 Originally Posted by Jiricbeng 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.

April 15, 2024, 14:00
#96
Senior Member

Jiri
Join Date: Mar 2014
Posts: 218
Rep Power: 13
Quote:
 Originally Posted by Opaque 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.

 April 17, 2024, 11:49 #97 Senior Member   Jiri Join Date: Mar 2014 Posts: 218 Rep Power: 13 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...

April 17, 2024, 13:05
#98
Senior Member

Join Date: Jun 2009
Posts: 1,815
Rep Power: 32
Quote:
 Originally Posted by Jiricbeng 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.

 April 18, 2024, 04:02 #99 Senior Member   Jiri Join Date: Mar 2014 Posts: 218 Rep Power: 13 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?

 April 18, 2024, 05:49 #100 Super Moderator   Glenn Horrocks Join Date: Mar 2009 Location: Sydney, Australia Posts: 17,729 Rep Power: 143 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.