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

Writing an Expression

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

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 24, 2025, 04:10
Default Writing an Expression
  #1
Senior Member
 
Mey
Join Date: Dec 2019
Posts: 121
Rep Power: 7
MNMK is on a distinguished road
Hi,

I would like to simulate warm air distribution in a car. I have a heat source that needs to be variable by changing the inside car temperature. This means that when I reach my target temperature in the car, the heat power should decrease. My problem is that I cannot write an expression at the point where my sensor is located. In fact, the expression I write has an error.

Can you tell me how I should write a proper expression for this condition?

condition:
if Ttarget- Tsensor >0.5 K then Heat source power 10 kW
if not Heat source power 5 kW .

Variable --> Ttarget=21, Tsensor= Expression, Heat Source= Expression
Attached Images
File Type: jpg 1.jpg (21.7 KB, 7 views)
MNMK is offline   Reply With Quote

Old   January 24, 2025, 06:27
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,901
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
It is a few simple CEL expressions:

Ttarget = 21[C]
Tsensor = probe(T)@Location
HeatSourcePower = if(Ttarget- Tsensor >0.5 C,10[kW],5[kW])

And set the heat source to HeatSourcePower

Note that this expression cannot be used for a steady state run as it has no steady solution. It can only be used for transient runs.
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   January 24, 2025, 07:18
Default
  #3
Senior Member
 
Mey
Join Date: Dec 2019
Posts: 121
Rep Power: 7
MNMK is on a distinguished road
Dear Glenn,

I hope you are fine. As you said, this model or case is not for steady-state conditions. However, the expression Tsensor = probe(T)@Location does not work. I defined a small volume and then, instead of a point, used the volume (Domain) and wrote the expression like minVal(Temperature)@SensorDomain. Then it worked without an expression error.

When I have a misunderstanding or make a mistake somewhere, please let me know.

best,
MNMK is offline   Reply With Quote

Old   January 24, 2025, 22:58
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,901
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
If you want to debug the probe approach please post your CEL and/or output file. Also include any error it is reporting.
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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
SU2 7.0.7 Built on CentOS 7, parallel computation pyscript mpi exit error? EternalSeekerX SU2 3 October 9, 2020 19:28
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 06:38
Outlet boundary condition in interFoam Andrea_85 OpenFOAM Running, Solving & CFD 51 July 20, 2017 14:31
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 19:57
[snappyHexMesh] crash sHM H25E OpenFOAM Meshing & Mesh Conversion 11 November 10, 2014 12:27


All times are GMT -4. The time now is 01:13.