CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   CFX, using a controller (https://www.cfd-online.com/Forums/cfx/158807-cfx-using-controller.html)

mrob302 September 4, 2015 01:56

CFX, using a controller
 
Hi

I am reasonably new to ANSYS, i am using workbench 13 i think. I have set up a room in 2D with air flow in and out and walls, with a heat flux at the bottom. I want to be able to pick points (probes?) and when the temperature at any of those points reaches a certain level the heat flux will decrease to a lower discret value. Once the heat flux has decreased if the temperature at another (or the same probe) goes below below a different set temp the heat flux will rise again. The idea is that the controller will keep the room at a stable temperature. I have written this code in MATLAB and simulink but im not sure if i can or how to implement into my CFX model. Am i able to do this? Any help would be greatly appreciated.

Thanks

singer1812 September 4, 2015 09:58

Without regards to the worthyness of your type of controller and without having actually tested this myself, I can suggest:

Read up help on CEL and Monitor Points. Place a monitor point at the locations that interest you.

Then, for your controller create an CEL expression such as (this is a 2 point probes and doesnt include logic if Ts are probes act in ways not intended):

step(T-probe(T)@Monitor Point 1)*Heat1+step(T-probe(T)@Monitor Point 2)*Heat2

Use the expression in your heatflux input.

This gives you the general idea. You will have to get fancier with the CEL to get your controller to work as you intend. Word of advice-Controllers such as this could be prone to runaway conditions.....

mrob302 September 6, 2015 17:42

Quote:

Originally Posted by singer1812 (Post 562482)
Without regards to the worthyness of your type of controller and without having actually tested this myself, I can suggest:

Read up help on CEL and Monitor Points. Place a monitor point at the locations that interest you.

Then, for your controller create an CEL expression such as (this is a 2 point probes and doesnt include logic if Ts are probes act in ways not intended):

step(T-probe(T)@Monitor Point 1)*Heat1+step(T-probe(T)@Monitor Point 2)*Heat2

Use the expression in your heatflux input.

This gives you the general idea. You will have to get fancier with the CEL to get your controller to work as you intend. Word of advice-Controllers such as this could be prone to runaway conditions.....

Hi, thank you for the reply. I have had an attempt with CEL, i have created the monitor points and the understand how to use the step function (i think?). How do i implement the logic of IF statements etc. Also when "T-probe" is used, is that just a name or what does that part of the equation represent?

ghorrocks September 6, 2015 19:17

You can use the step function like Edmund suggests or if statements. Look in the reference manual for the syntax of these expressions.

mrob302 September 7, 2015 00:47

So if i want to implement a PI controller, is this possible? Also when looking at the results am i able to see the temperature contours at different times (iterations) or is it just the final iteration?

mrob302 September 7, 2015 01:08

Also am i able to plot the heater flux with time, to see when and how it is switching with the temperature changing? Im abit lost, but thanks for your help

ghorrocks September 7, 2015 01:18

A PI controller is much harder to implement as it requires historical data and this is tricky in CFX. I would not recommend this for beginners. Also it introduces all sorts of controller stability problems on top of the existing numerical stability problems as Edmund stated.

You can view any variable at any saved time step in the post processor.

Yes, you can view heat flux versus time. Make the heat flux a CEL variable and then set a monitor point equal to that variable. You will then have access to the value in the solver manager.

mrob302 September 7, 2015 01:27

Quote:

Originally Posted by ghorrocks (Post 562687)
A PI controller is much harder to implement as it requires historical data and this is tricky in CFX. I would not recommend this for beginners. Also it introduces all sorts of controller stability problems on top of the existing numerical stability problems as Edmund stated.

You can view any variable at any saved time step in the post processor.

Yes, you can view heat flux versus time. Make the heat flux a CEL variable and then set a monitor point equal to that variable. You will then have access to the value in the solver manager.

Okay i understand how to do it. Yeah i was starting to see the PI controller would be hard to implement. Unfortunately i might have to abandon the idea however i was wonder if you would know where i could see an example of it working for someone on CFX. Just to test the waters

ghorrocks September 7, 2015 01:36

Search the forum. There have been so many questions asked on the forum before that it is bound to have been asked before.


All times are GMT -4. The time now is 05:36.