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

Write an Expression by using a user Location

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 23, 2024, 01:52
Default Write an Expression by using a user Location
  #1
Member
 
Mey
Join Date: Dec 2019
Posts: 99
Rep Power: 6
MNMK is on a distinguished road
Hello,

I would like to adjust my heat flux according to the wall temperature during my simulation. This means that when the temperature @ user location reaches ( Y ), the heat flux should be ( Z ). Therefore, I first write an expression for the location temperature (e.g., probe(Temperature)@user Location). Then I use this in the second expression as I mentioned above.

However, I encountered an error: “The following unrecognized name was referenced: user location.”


Can anyone guide me please?

wishes,
MNMK is offline   Reply With Quote

Old   August 23, 2024, 04:53
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,819
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
The CFX reference manual says the <Location> for the @probe function should be a point object, giving examples of a source point of a cartesian monitor point. Did you define your point as a source point or a cartesian monitor point?
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   August 23, 2024, 07:30
Default
  #3
Member
 
Mey
Join Date: Dec 2019
Posts: 99
Rep Power: 6
MNMK is on a distinguished road
Hi Glenn,

I would like to be able to change my heat source (W) by changing the temperature of my user location, e.g., ´TL=Probe(Temperature)@user Location`, which is a point.

As I mentioned, I have written two expressions: the first for TL, the temperature of the user point, and the second for the heat source, e.g., if(TL1<130, HS1+HS2,if(TL1<=130,HS1+15%*Hs2, HS1 )).
I have tried to define TL as an additional variable, which I then use in the second expression; however, it did not work.

The TL was referenced as an unrecognized name.

what could be the problem?

bests,
MNMK is offline   Reply With Quote

Old   August 23, 2024, 08:02
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,819
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
You need to define a monitor point called "user Location", or a point source term called "user Location".
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   August 26, 2024, 02:23
Default
  #5
Member
 
Mey
Join Date: Dec 2019
Posts: 99
Rep Power: 6
MNMK is on a distinguished road
Hi,

I did not understand your meaning. My aim is not to monitor the values. I would like to change my heat source by changing the temperature at a specific location. As you mentioned, I defined a monitor point in Cartesian coordinates: Location x y z, with the output variable Temperature, and I named it Monuser. I also used it in my first expression: TL1 = avg(Temperature)@Monuser. Then, I used it in the second expression to change my heat source value: if(TL1 < 130[C], HS1 + HS2, if(TL1 <= 130[C], HS1 + 15% * HS2, HS1)).

I received the following error:

ERROR
Attempt to evaluate the CEL callback function 'ave'.
Although it is valid to create an expression that
uses such a function, the preprocessor does not support
its evaluation.


????????????

when I am completely wrong on the way please say to me how should I write for my aim a proper one.

bests,
MNMK is offline   Reply With Quote

Old   August 26, 2024, 04:49
Default
  #6
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,819
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
"Monuser" is a point. You cannot take the average of a point, that is why you got the error. You use the TL = probe(T)@Monuser function to get the temperature value at the point and put it in CEL variable TL. You can then use it in any CEL expression.
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

Old   August 26, 2024, 07:38
Default
  #7
Member
 
Mey
Join Date: Dec 2019
Posts: 99
Rep Power: 6
MNMK is on a distinguished road
The problem is that whether I use an average on a surface or a probe at a point in an expression and then use it in another expression, the error will be the same. (see Attachment)

ERROR
Attempt to evaluate the CEL callback function 'probe'.
Although it is valid to create an expression that
uses such a function, the preprocessor does not support
its evaluation.


?????

wishes
Attached Images
File Type: png Monitor Point.PNG (7.8 KB, 8 views)
File Type: png TL1 Expression.PNG (2.4 KB, 7 views)
File Type: png Heat source Expression.PNG (1.8 KB, 6 views)
MNMK is offline   Reply With Quote

Old   August 26, 2024, 10:18
Default
  #8
Senior Member
 
Gert-Jan
Join Date: Oct 2012
Location: Europe
Posts: 1,887
Rep Power: 27
Gert-Jan will become famous soon enough
Looks like the probe for a point doesn't work in the solver. I think it is exclusively meant for CFD-Post.

I know from experience that it is possible to use an inlet temperature that is equal to a certain outlet temperature: Tinlet=areaAve(T)@Outlet. I think you should therefore make a named surface or a control volume in your geometry, mesh it and create the appropriate expressions.
Gert-Jan is offline   Reply With Quote

Old   August 26, 2024, 11:39
Default
  #9
Senior Member
 
Join Date: Jun 2009
Posts: 1,851
Rep Power: 33
Opaque will become famous soon enough
probe(<Variable>)@<Point Locator> works as followed:

1 - Validated for point locators ONLY. Such points include Source Point and other Monitor Points
2 - Re-validated, and executed during the simulation by the Ansys CFX Solver
3 - executed in CFD-Post if it is part of the EXPRESSIONs section created in the Ansys CFX Pre.

Please post the full set of expressions used.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
Opaque is offline   Reply With Quote

Old   August 27, 2024, 05:13
Default
  #10
Member
 
Mey
Join Date: Dec 2019
Posts: 99
Rep Power: 6
MNMK is on a distinguished road
Monitor Point: Monuser

FLOW: Flow Analysis 1
OUTPUT CONTROL:
MONITOR OBJECTS:
&replace MONITOR POINT: Monuser
Cartesian Coordinates = 0.077 [m], 0 [m], 0 [m]
Coord Frame = Coord 0
Option = Cartesian Coordinates
Output Variables List = Temperature
MONITOR LOCATION CONTROL:
Interpolation Type = Nearest Vertex
END
POSITION UPDATE FREQUENCY:
Option = Initial Mesh Only
END
END
END
END
END




TL1 Expression:

probe(Temperature)@Monuser

HZ1 Expression:
areaAve(Temperature)@REGION:HZ1

HZ2 Expression:
areaAve(Temperature)@REGION:HZ2

percent Expression:
0.0050*aitern/100

Heat Source Expression:

if(TL1<130[C], HZ1+1*HZ1,if(TL1>=130[C],HZ1+percent*HZ1, HZ1 ))

ERROR
Attempt to evaluate the CEL callback function 'probe'.
Although it is valid to create an expression that
uses such a function, the preprocessor does not support
its evaluation.
MNMK is offline   Reply With Quote

Old   August 27, 2024, 05:21
Default
  #11
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,819
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
When does this error come up? Are you trying to evaluate the expression in CFX-Pre? Or in the solver?
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   August 27, 2024, 05:23
Default
  #12
Member
 
Mey
Join Date: Dec 2019
Posts: 99
Rep Power: 6
MNMK is on a distinguished road
in cfx-Pre when I try to plot the heat source expression
MNMK is offline   Reply With Quote

Old   August 27, 2024, 05:27
Default
  #13
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,819
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Of course the probe function does not work in CFX-Pre. It is just the pre-processor, so all the variable arrays have not been set up yet. The probe function takes the value of the array at a defined point, so will only work in the solver or post-processor after those variable arrays are set up in the solver.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   August 27, 2024, 05:30
Default
  #14
Member
 
Mey
Join Date: Dec 2019
Posts: 99
Rep Power: 6
MNMK is on a distinguished road
Can you suggest me a Solution?

If it is possible with other function?
MNMK is offline   Reply With Quote

Old   August 27, 2024, 05:31
Default
  #15
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,819
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Isn't it obvious? You have to run the solver.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   August 27, 2024, 06:04
Default
  #16
Member
 
Mey
Join Date: Dec 2019
Posts: 99
Rep Power: 6
MNMK is on a distinguished road
Thank you.

However, it would be better if it were possible to plot the expression before running it.

wishes
MNMK is offline   Reply With Quote

Old   August 27, 2024, 06:19
Default
  #17
Senior Member
 
Gert-Jan
Join Date: Oct 2012
Location: Europe
Posts: 1,887
Rep Power: 27
Gert-Jan will become famous soon enough
Then define a fluctuating temperature (sinusoidal?) and use that as an example probe. If that works, then probably your control expression will work as well. Provided your example probe is representative for the deviations you expect in your simulation.

BTW, I don't see the variable "time", but "aitern". So you are running steady state?
Gert-Jan is offline   Reply With Quote

Old   August 27, 2024, 06:36
Default
  #18
Member
 
Mey
Join Date: Dec 2019
Posts: 99
Rep Power: 6
MNMK is on a distinguished road
Thank you both.

Due to the size of my model, I want to calculate it in steady state first. However, as you have realized, the case should be considered in transien.

I manually calculate how the values change during the calculation process. it look well.


reagrds,
MNMK is offline   Reply With Quote

Old   August 27, 2024, 06:52
Default
  #19
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,819
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
And have a careful think about whether this setup is really steady state at all. How can it be steady state if the source term keeps changing?
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   August 27, 2024, 07:12
Default
  #20
Member
 
Mey
Join Date: Dec 2019
Posts: 99
Rep Power: 6
MNMK is on a distinguished road
I just want to check the influence of my heat source changing on my outlet temperature.
MNMK 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
Can I write temperature dependent UFD code in ansys fluent expression? GreyMat FLUENT 0 August 9, 2022 10:53
Ansys Fluent Expression ISO Surface not appearing in Location button ebrahem Fluent UDF and Scheme Programming 2 January 12, 2022 06:43
can user define a location dependent density in Define_property udf macro? Pmaroul Fluent UDF and Scheme Programming 2 January 21, 2019 15:34
Evaluating expression at a specific location in CFX Pre gotang CFX 4 August 17, 2017 10:33
Need help to write scripts in User Fortran Casper_07 CFD Freelancers 1 April 12, 2016 12:59


All times are GMT -4. The time now is 16:28.