|
[Sponsors] |
Change a boundary condition based on simulation result and recompute the simulation |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 2, 2016, 05:07 |
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 |
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? |
|
March 7, 2017, 19:35 |
|
#2 |
New Member
Fabio Teixeira
Join Date: May 2016
Posts: 4
Rep Power: 10 |
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). |
|
Tags |
cel fortran cfx, fortran code, heat transfer, iterative update, solid body |
|
|