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

Change a boundary condition based on simulation result and recompute the simulation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 2, 2016, 05:07
Default Change a boundary condition based on simulation result and recompute the simulation
  #1
Member
 
Robin Kamenicky
Join Date: Mar 2016
Posts: 74
Rep Power: 11
Robin.Kamenicky is on a distinguished road
Hello everyone,

I am dealing with heat transfer in a solid tube (Check attachement).

The thing is, that in tube occures boiling and so also HTC correlaions for computing HTC are changing.

What I want to do is to write following convective boundary condition depending on maximum temperature on the tube wall:
#Twi is initial temperature at tube wall
#Tonb is temperature at Onset of nucleate boiling point
#Tofdb is temperature at Onset of fully developed boiling point

IF Twi <= Tonb
HTC1

ELSE
IF Twi <= Tofdb
HTC2
ELSE
EXIT SIMULTATION "Temperature is too high"
END
END

#When simulation ends
IF abs((maxVal(Temperatue)@TubeWall)-Twi)>Twi/100
Twi=maxVal(Tempreatue)@TubeWall
Do the whole simulation again
ELSE
EXIT "Simulation was successful"
END


I know I can write a funtion with CEL and use if( cond_expr, true_expr, false_expr ) but is there a possibility to use WHILE LOOP and so iterate the simulation based on the simulation result?
Robin.Kamenicky is offline   Reply With Quote

Old   March 7, 2017, 19:35
Default
  #2
New Member
 
Fabio Teixeira
Join Date: May 2016
Posts: 4
Rep Power: 10
Fabio_Teixeira is on a distinguished road
For the variable HTC you can use CEL creating a expression like HTC = if(Twi <= Tonb, HTC1, HTC2). Then you create stop condition on "Interrupt Control Conditions" (check this video https://www.youtube.com/watch?v=KLv-By0PKiM).

Finally, to do the simulation again you can use the expression maxVal(Temperatue)@TubeWall)-Twi as an Post output parameter and create a Workbench script to read the parameter and check the condition with a if statement. (if you don't know how to write a script file you can search on this forum other threads about it and do some test with recording a journal on WB File>Scripting>Record Journal).
Fabio_Teixeira is offline   Reply With Quote

Reply

Tags
cel fortran cfx, fortran code, heat transfer, iterative update, solid body


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



All times are GMT -4. The time now is 18:40.