PID or alternate scheme for Fan control

699 views
Skip to first unread message

jason....@trentonfire.co.uk

unread,
Oct 11, 2018, 8:43:35 AM10/11/18
to FDS and Smokeview Discussions
Hi all,

I'm new to FDS, but not CFD and had a couple of questions of the control implementation of fans in FDS.

I am attempting to model a fan with variable flow rate depending on a measured pressure difference. For example, I wish to vary the fan flow rate to ensure a pressure difference across a door is maintained to be <50Pa. The reason behind this is to allow people to be able to open a door to enable evacuation but also drive the fan to the max volumetric flow rate permissible (under this pressure) to enable the best smoke extract possible for the system. 

Using a control scheme such as PID requires a controllable parameter (I believe the volume flow rate can time vary in a duct/hvac?), but the setpoint/error would be in Pa so I am assuming a crude relation between (dPa and Flow rate would be needed) as this would be driven by the geometry. This would then need to feed to VOLUME_FLOW as a variable. Is this something that is possible to do in FDS?

Many thanks for any input,

Jason

Salah Benkorichi

unread,
Oct 11, 2018, 9:01:21 AM10/11/18
to FDS and Smokeview Discussions
Check section 12.2.4 Fan Curves 
You can control the volume flow based on the pressure.

--
You received this message because you are subscribed to the Google Groups "FDS and Smokeview Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fds-smv+u...@googlegroups.com.
To post to this group, send email to fds...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fds-smv/1801bdb9-2d8b-4d2e-8d64-83bead2455c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

jason....@trentonfire.co.uk

unread,
Oct 11, 2018, 9:14:23 AM10/11/18
to FDS and Smokeview Discussions
Hi Salah,

Many thanks, how would you determine the relationship between volume flow rate of the fan vs. pressure difference across a geometry without running the simulation?

Regards,

Jason

Ben Ralph

unread,
Oct 11, 2018, 9:15:00 AM10/11/18
to fds...@googlegroups.com
Do you mean a differential pressure measurement in the field domain? Fan curves are characteristic curves of flow-pressure with this pressure being across the fan itself. i.e. at maximum pressure the fan stalls and flow becomes zero, at no pressure the flow is maximum. Sounds like that's not what you need here

Currently you can only turn fans on and off. You can vary a VOLUME_FLOW in a duct with time using a RAMP

Perhaps you could set up a control based upon two devices giving you a pressure differential. Then use this control to turn your fan on and off as required. This would be binary and not variable flow.

jason....@trentonfire.co.uk

unread,
Oct 12, 2018, 6:20:44 AM10/12/18
to FDS and Smokeview Discussions
Hi Ben,

That is correct, it would be a differential pressure measurement within the domain. 

I will have a look into the binary method for flow control,

Thanks

Wojciech Węgrzyński

unread,
Oct 12, 2018, 7:17:34 AM10/12/18
to FDS and Smokeview Discussions
Dear Jason, I don't have a complete solution but would like to comment on your problem.

From the question asked, I assume you would like to mimic the behaviour of a PDS system (EN12101-6) in a building with some very basic controls. The binary method looks promising, but most likely you will not be able to capture the real behaviour of the system. The reason is that such solutions typically employ PID or PLC controllers for controlling the fan capacity. The control device of PDS will distinguish two states of dPa between the measured points - (a) pressure is above 50 Pa and (b) pressure falls below 50 Pa. Now, the state (b) will be easy to model in CFD - some of the doors are open and the fan goes to the maximum capacity, and whatever resulting pressure is obtained it is at is it is. However, state (a) may be caused in multiple different scenarios. The easiest one - all of the doors are closed and fan operates at minimum "leakage" capacity, will also be easy to model without any automation. The hard one (and I guess the one really interesting) is when some doors are open, but dPa > 50 Pa. In this case in a PDS system, the controller will find the capacity to get to pressure point close to 50 Pa, and if state changes, maintain the pressure between a range (typically 40 and 60 Pa). In the simulation, the use of binary control will not allow you to capture this point, as it is an iterative process to find the correct capacity (unless you know the exact value beforehand). Another problem with the simple control is that even if you could somehow force solver to find the correct pressure, this simulation will not reflect real system behaviour, as PDS controllers are programmed to average pressure measurements and delay some control signals, in order to minimize the consequences of an oscillatory behaviour, which you will most likely find in the simulation.

This is why modelling the reaction of active PDS to transient changes (like opening doors) is extremally difficult, and may even be not possible in the current state of FDS development. Maybe a combination of tricks that Ben and Salah gave could allow capturing something similar to PDS performance, but you will still miss all the automation within the PDS control panel used to prevent oscillations. 

Now from my practical experience in modelling PDS systems, the goals of CFD simulation usually were the investigation of the stack effect or finding vol. the flow capacity of the fan required to provide the required pressure difference. In these cases, we did multiple "stationary" scenarios with various doors open/closed, and in different thermal conditions. What I have in mind is separate CFD for all doors closed, all doors open, one door open etc., repeated for winter/summer. This allowed simulating one state of the fan operation at a time. Results of such analyses did answer most questions and let us figure out what was the required fan capacity and the flow field and pressures in the building. For me, the problem of the device being able to limit its vol. capacity, in order to not exceed the 50Pa, was always on the PDS manufacturer side. This particular ability of the PDS system is very thoroughly tested in the laboratory, so we never had a real need to model this. If in your case the PDS system used was not tested for this, I would definitely recommend running laboratory tests instead of CFD - it will be most likely cheaper and definitely more reliable.

Finally, if you pursue the CFD analysis of a complete PDS in the building, that would be a spectacular paper. Let me know if you need some help with validation for your model, in my Institute, we have a large scale PDS testing facility (one of 2 operational facilities for this in Europe) and can possibly help you out.

Best regards
Wojciech Wegrzynski

dr_jfloyd

unread,
Oct 12, 2018, 7:35:32 AM10/12/18
to FDS and Smokeview Discussions
You can assign a RAMP to control the volume flow of the fan. Normally that RAMP uses time but you can reassign that to the be the output of a control function.  You could tune a PID control function that uses the difference from 50 Pa as the error and use the function as the input to the RAMP. You would have to figure out how to tune the function to give you a reasonable rate of fan speed increase or decrease. As part of this you probably also want to model the door opening / closing in a more realistic manner than instantly having it fully open or fully closed.

jason....@trentonfire.co.uk

unread,
Oct 15, 2018, 4:11:29 AM10/15/18
to FDS and Smokeview Discussions
Many thanks for the info Dr Floyd,

I am trying to implement this using a minimum working example, as a basis I was using the 'fan_test' file in the examples folder as this seems to have everything required. For the HVAC fan in the example, I am getting a little confused on how to specify the output from the PID as part of the RAMP function. I was assuming something like this would be sufficient:

&CTRL ID='PID2',FUNCTION_TYPE='PID',INPUT_ID='pres_1',TARGET_VALUE=50., PROPORTIONAL_GAIN=1.0,INTEGRAL_GAIN=0.1,DIFFERENTIAL_GAIN=0.1/
&HVAC TYPE_ID='FAN', ID='1', VOLUME_FLOW=1, LOSS=2., CTRL_ID='PID2'/

Whereby the VOLUME_FLOW would be related to the error on (50 - pres_1). How exactly do you relate the RAMP function to be related to the PID output?

Many thanks,

Jaon

dr_jfloyd

unread,
Oct 15, 2018, 7:37:47 AM10/15/18
to FDS and Smokeview Discussions
See 19.6.1 in the User's Guide

jason....@trentonfire.co.uk

unread,
Oct 15, 2018, 7:46:29 AM10/15/18
to FDS and Smokeview Discussions
&SURF ID='BLOWER', VEL=-2, RAMP_V='BLOWER RAMP' /
&DEVC XYZ=2,3,3, QUANTITY='TEMPERATURE', ID='TEMP DEVC' /
&RAMP ID='BLOWER RAMP', T= 20,F=0.0, DEVC_ID='TEMP DEVC' /
&RAMP ID='BLOWER RAMP', T=100,F=0.5 /
&RAMP ID='BLOWER RAMP', T=200,F=1.0 /


A CTRL_ID can also be specified as long as the control function outputs a numerical value (i.e., is a mathematical function (Section 19.5.6) or a PID function (Section 19.5.7).

All I want is the volumetric flow rate to be as a function of the PID output, so...

&SURF ID='BLOWER', VEL=-2, RAMP_V='BLOWER RAMP' /
&DEVC XYZ=2,3,3, QUANTITY='PRESSURE', ID='pres_1' /
&CTRL ID='PID2',FUNCTION_TYPE='PID',INPUT_ID='pres_1',TARGET_VALUE=50., PROPORTIONAL_GAIN=-1.0,INTEGRAL_GAIN=0.1,DIFFERENTIAL_GAIN=0.1/
&RAMP ID='BLOWER RAMP',  CTRL_ID='PID2' /


??

dr_jfloyd

unread,
Oct 15, 2018, 9:31:17 AM10/15/18
to FDS and Smokeview Discussions
You still need to define a RAMP. If yo want the RAMP output to equal the RAMP input, then define a linear RAMP spanning the range of values where T=F

jason....@trentonfire.co.uk

unread,
Oct 16, 2018, 10:06:37 AM10/16/18
to FDS and Smokeview Discussions
Many thanks Dr Floyd,

I believe this is a minimum working example, based on the fan_test example:


&HEAD CHID='fan_test', TITLE='Test of Fans Control Along a Typical Corridor' /
&MESH IJK=20,10,10, XB=-3.0, 0.0,-1.0, 1.0, 0.0, 2.0 /
&TIME T_END=150.0 /
&DUMP NFRAMES=60., DT_DEVC= 0.1/
&MISC STRATIFICATION=.FALSE.,Y_CO2_INFTY=0.,HUMIDITY=0./
&RADI RADIATION=.FALSE./
&PRES MAX_PRESSURE_ITERATIONS = 100/
&ZONE XB=-3.0, 0.0,-1.0, 1.0, 0.0, 2.0 /  Pressure Zone

&VENT XB=-3,-3,-0.2, 0.2, 0.4, 0.6, COLOR='RED', ID='BLOW LEFT 1',SURF_ID='HVAC',IOR=1/
&VENT XB= 0,0,-0.2, 0.2, 0.4, 0.6, COLOR='BLUE', ID='BLOW RIGHT 1',SURF_ID='HVAC', IOR=-1/
&HVAC ID='LEFT 1',TYPE_ID='NODE',DUCT_ID='LEFT',VENT_ID='BLOW LEFT 1'/
&HVAC ID='LEFT 2',TYPE_ID='NODE',DUCT_ID='LEFT', XYZ=-3.1,0,0, AMBIENT=.TRUE./
&HVAC ID='RIGHT 1',TYPE_ID='NODE',DUCT_ID='RIGHT',VENT_ID='BLOW RIGHT 1'/
&HVAC ID='RIGHT 2',TYPE_ID='NODE',DUCT_ID='RIGHT',XYZ=1.1,0,0, AMBIENT=.TRUE./
&HVAC ID='LEFT',TYPE_ID='DUCT',NODE_ID='LEFT 1','LEFT 2',LENGTH=1,AREA=0.04,FAN_ID='fan_1',LOSS=0,0/
&HVAC ID='RIGHT',TYPE_ID='DUCT',NODE_ID='RIGHT 1','RIGHT 2',LENGTH=1,AREA=0.04,LOSS=10,10/
&DEVC ID='pres', XYZ=-2.9, 0.0, 0.5,  QUANTITY='PRESSURE' /
&DEVC ID='vel', XYZ=-2.9, 0.0, 0.5,  QUANTITY='VELOCITY' /
&DEVC ID='vflow1', DUCT_ID='LEFT', QUANTITY='DUCT VOLUME FLOW' /
&DEVC ID='vflow2', DUCT_ID='RIGHT', QUANTITY='DUCT VOLUME FLOW' /
&CTRL ID='PID_Control_Values',FUNCTION_TYPE='PID',INPUT_ID='vel',TARGET_VALUE=0.06,PROPORTIONAL_GAIN=15.0,INTEGRAL_GAIN=0.8,DIFFERENTIAL_GAIN=0.2/
&DEVC ID='PID_Output',XYZ=-0.1, 0.0, 0.5,QUANTITY='CONTROL VALUE',CTRL_ID = 'PID_Control_Values'/
&HVAC TYPE_ID='FAN',ID='fan_1', RAMP_ID=PID_RAMP/
&RAMP ID='PID_RAMP', T=-100.0,F=-100.0, DEVC_ID='PID_Output' /
&RAMP ID='PID_RAMP', T=100,F=100 /
&SLCF PBY=0.0,QUANTITY='TEMPERATURE',VECTOR=.TRUE. /
&SLCF PBY=0.0,QUANTITY='DENSITY' /
&SLCF PBY=0.0,QUANTITY='PRESSURE' /
&SLCF PBY=0.0,QUANTITY='VELOCITY' /
&TAIL /


The fan achieves the target velocity at a point slightly after the fan (0.06), however, I had a couple of questions. Firstly, why is the pressure negative at the measurement point? and Secondly, is there any way to delay the control output? 

The target setpoint point is right after the location of the fan/duct, however, if this is moved to another location, the physical separation constitutes a lag on the measurement error used in the PID input, is there a way to time average a measurement or delay the output control signal?

Many thanks,

Jason

dr_jfloyd

unread,
Oct 17, 2018, 8:50:08 AM10/17/18
to FDS and Smokeview Discussions
&VENT XB=-3,-3,-0.2, 0.2, 0.4, 0.6, COLOR='RED', ID='BLOW LEFT 1',SURF_ID='HVAC',IOR=1/ 
&HVAC ID='LEFT 1',TYPE_ID='NODE',DUCT_ID='LEFT',VENT_ID='BLOW LEFT 1'/
&HVAC ID='LEFT',TYPE_ID='DUCT',NODE_ID='LEFT 1','LEFT 2',LENGTH=1,AREA=0.04,FAN_ID='fan_1',LOSS=0,0/
&HVAC ID='LEFT 2',TYPE_ID='NODE',DUCT_ID='LEFT', XYZ=-3.1,0,0, AMBIENT=.TRUE./

This fan+duct exhausts air from the compartment.

&VENT XB= 0,0,-0.2, 0.2, 0.4, 0.6, COLOR='BLUE', ID='BLOW RIGHT 1',SURF_ID='HVAC', IOR=-1/
&HVAC ID='RIGHT 1',TYPE_ID='NODE',DUCT_ID='RIGHT',VENT_ID='BLOW RIGHT 1'/
&HVAC ID='RIGHT',TYPE_ID='DUCT',NODE_ID='RIGHT 1','RIGHT 2',LENGTH=1,AREA=0.04,LOSS=10,10/
&HVAC ID='RIGHT 2',TYPE_ID='NODE',DUCT_ID='RIGHT',XYZ=1.1,0,0, AMBIENT=.TRUE./

This duct supplies makeup air to the compartment.

For makeup air to flow from the outside to the inside, the pressure on the inside must be less than the pressure on the outside. The pressure on the outside is the ambient pressure (P=0); therefore, on the inside the pressure must be negative.

I can't think of a way to introduce a delay in the signal. You should be able to correct for the delay by tuning of the PID function.

Robert Holland

unread,
Sep 16, 2021, 12:01:14 AM9/16/21
to FDS and Smokeview Discussions
HI Everyone,

I'm modelling a stairwell pressurisation system, with PID control on the fan. I found this post very helpful in achieving what I needed, so thought I'd post my final code here in case it helps someone else in the future! If you're having trouble tuning the gain values  you can just sit down and do some basic hand calcs and figure out what's going on.
I would have also liked to program in the fan curve but don't believe this is possible..

&SURF ID='Fan1',VOLUME_FLOW=-7.0, RAMP_V='PID_RAMP', COLOR='BLUE'/ 
&VENT XB=14.2,14.2,10.6,11.4,3.4,4.2, SURF_ID='Fan1', /

&RAMP ID='PID_RAMP', T=-100.0,F=0.3, DEVC_ID='PIDout' / when u(t) <0 (PS>80Pa) fan@30%, for 0<u(t)>80 (0Pa<PS<80Pa) ramp fan proportionally to 100%
&RAMP ID='PID_RAMP', T=0,F=0.3 /
&RAMP ID='PID_RAMP', T=80,F=1 /
 
&CTRL ID='PID', FUNCTION_TYPE='PID', INPUT_ID='PS', TARGET_VALUE=80., PROPORTIONAL_GAIN=-1 INTEGRAL_GAIN=-0.001, DIFFERENTIAL_GAIN=0.001/
&DEVC ID='PIDout', QUANTITY='CONTROL VALUE',CTRL_ID='PID', XYZ=14,10,9/ measure u(t) PID output

&DEVC XYZ=14,10.4,9.2 ID='PS', QUANTITY='PRESSURE' / pressure sensor at level 6
&DEVC ID='FanFlow', XB=14.2,14.2,10.6,11.4,3.4,4.2,, QUANTITY='VOLUME FLOW',/

dr_jfloyd

unread,
Sep 16, 2021, 8:20:02 AM9/16/21
to FDS and Smokeview Discussions
In my talk on control functions at Thunderhead Engineering's 2018 FEMTC , one of my examples was using PID to control furnace temperature. Maybe it will give you some ideas on how to do a fan curve:

Robert Holland

unread,
Sep 16, 2021, 11:14:38 PM9/16/21
to fds...@googlegroups.com
Thank you Dr Floyd


From: fds...@googlegroups.com <fds...@googlegroups.com> on behalf of dr_jfloyd <drjf...@gmail.com>
Sent: Friday, September 17, 2021 12:20:02 AM
To: FDS and Smokeview Discussions <fds...@googlegroups.com>
Subject: [fds-smv] Re: PID or alternate scheme for Fan control
 
--
You received this message because you are subscribed to a topic in the Google Groups "FDS and Smokeview Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/fds-smv/ihwRCYl5KYs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to fds-smv+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fds-smv/44869461-0c21-4501-b957-6be789062dd9n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages