Tuesday, November 6, 2012

HVAC



As part of our continuing series on topics in the FDS 6 release notes, this blog post will focus on HVAC features in FDS 6. 

Through version 5.5.2, you could only specify pre-defined boundary conditions for inlet and outlet flows (i.e. temperature, species, and velocity/mass flow were explicitly defined in the input file).  There are a number of situations where these standard FDS inputs were not sufficient to model the behavior of a building: smoke can move through ducts to remote compartments and reduce their visibility, heating and cooling systems will turn on and off as temperatures change which will impact the movement and temperature of smoke, facilities that must maintain negative pressures can lose that ability as filters clog with soot, and in a multicompartment ventilation system the pressurization of a compartment due to a fire will change the flow rates in the system.  In addition to limitations in the current inputs, the FDS leakage model had stability issues with large leakage areas or complicated arrangements of leakage paths.

To address these limitations and to generally improve the ability of FDS to model buildings, an HVAC submodel was developed.  The first version of the model was released in FDS 5.5.3.  This model was limited in its functionality and did not work with MPI versions of FDS.  Development has since continued, and FDS 6 contains an improved HVAC model with additional functionality including being compatible with the MPI versions of FDS.

With a CFD code there are a couple of approaches one could take to model HVAC systems.  One could model a system by modeling each duct using the CFD solver.  This approach would be very costly given the number of grid cells that would be required to correctly resolve the flows and pressure drops in an HVAC system. Additionally, one would have to undergo the time consuming process of verifying that one was obtaining the correct pressure drops throughout the system.  A second approach is to use a specialized HVAC solver that treats the HVAC system in a simplified manner and couples it to the CFD solver.  This second approach was used.

The HVAC model in FDS 6 is a network HVAC model based on the solver found in MELCOR (a United States Nuclear Regulatory Commission code for analyzing containment buildings).  In brief, this model treats an HVAC system as a collection of nodes and junctions.  A junction would represent a duct, and a node would represent where two or more ducts connect or where a duct is connected to the remainder of  the FDS domain.  The model solves equations for the conservation of mass, energy, and momentum of the HVAC system.  For each junction, a velocity is predicted and for each node a pressure, temperature, and set of species mass fractions is predicted.  The particular solution method currently used does not account for transport delays in a duct.  That is, whatever mass and energy enters the system during a time step, also leaves the system in that same time step.  Multiple HVAC systems can be defined in one input file and the solver will attempt to identify independent systems (e.g. systems that do not have inlets or outlets in the same pressure zone) in order to reduce the computational cost.

The HVAC solver is not directly coupled to the FDS solvers for pressure and species transport.  Rather the HVAC solver uses the prior time step conditions to determine the boundary conditions at each inlet and outlet to the HVAC system and the solver returns a new set of boundary conditions that FDS then uses when computing the next time step.  For simulations with pressure zones, the HVAC solver uses the prior time step rate of zone pressure change to estimate the new end of time step pressure. Provided that the FDS solution does not vary greatly between time steps (so the HVAC solver estimated pressure is close to the actual pressure determined by FDS), this coupling approach is stable.  In general this is the case, FDS time steps are typically small enough that the pressure rise between time steps is small.

With the HVAC model one can define the follow components:
  • Ducts with forward and reverse flow losses (ASHRAE and other handbooks contain tables of flow loss data for various types of ducts)
  • Nodes  (e.g. tees, inlet and outlet vents, plenums, etc.) with flow direction dependent losses (as with ducts, values can be found in various handbooks).
  • Fans with three fan models: constant flow, quadratic, and user defined.  The quadratic and user defined models will change the fan flow rate based on the inlet and outlet pressure of the fan.  This would allow, for example, FDS to reduce the flow into a compartment where a growing fire causes a pressure rise that a fan would have to work harder at to overcome.
  • Dampers (currently only fully open or fully closed)
  • Filters with the ability to define different removal efficiencies for different species as well as the impact of filter loading on the pressure drop across the filter
  • Heating / cooling coils with either a fixed amount of heat exchange or an amount computed with a simple heat exchanger efficiency model
The HVAC model has resulted in changes to two other features of FDS:
  1. The POROUS surface input has been removed.  This input was used to allow one to specify a fan in the computational domain that transferred species across it.  This is now handled by the HVAC model.  See the jet_fan.fds example case in the Flowfields subfolder in the FDS 6 Examples folder.
  2. Leakage is now handled by the HVAC model.  A leak is merely some small gap, hole, etc. that allows flow from one room to another.  From a model point of view, this can be considered as a tiny duct that connects two compartments.  By using the HVAC model rather than the prior leakage model, instabilities due to large leakage areas or complex leakage paths are avoided.  Additionally, the prior leakage model could only transfer species if the compartments were separated by a POROUS surface otherwise ambient air was moved by the leakage.  By using the HVAC model, this limitation no longer exists as the HVAC model will compute the species mass transfer.  See the leak_test.fds example case in the HVAC subfolder in the FDS 6 Examples folder.
It is recommended that if you are using the HVAC model that you review the various examples in the FDS User's and Verification Guide; the inputs for which can be found in the HVAC subfolder of the Examples folder where FDS 6 is installed.

Monday, November 5, 2012

Hydrodynamics and Turbulence


Following the announcement of the v6 beta release, we thought it might be helpful expand a little bit on some of the topics in the release notes.  Our aim here is to explain why certain changes were necessary or why certain choices were made in a way that might provide more insight than can be gleaned from just reading the formal documentation (though reading the guides is still highly encouraged!).

The focus in this article will be hydrodynamics and turbulence.  Hydrodynamics is the foundation of any CFD code, especially a reacting flow code like FDS.  Chemical species cannot react until they have mixed, and (in a diffusion flame) they cannot mix until they have been transported.  The velocity field, therefore, plays a critical role in fire dynamics.  In a model like FDS, other things being equal, the model for the turbulent viscosity determines the behavior of the velocity field and hence to a large extent the dynamics of the fire.

In v5, the turbulent viscosity was modeled by constant coefficient Smagorinsky (1963) (csmag), which has the drawback being overly dissipative (have you ever seen a 10-foot fire look like a candle flame?).  Thus, finer grid resolution was required to achieve accurate results.  But even highly resolved flames did not look qualitatively correct.  The reason: csmag is not convergent.  That is, the modeled term does not go away (as it should) when the grid is refined to the level of a DNS.

The original candidate to replace csmag was the dynamic Smagorinsky model (dsmag).  While this model added about 20% to the cost of computing the velocity field, in theory this cost could be recovered by achieving more accurate results (statistically) with coarser grid resolution.  So, dsmag was implemented and run through a battery of verification and validation tests with more or less satisfactory results.  On the plus side, we were getting very realistic-looking flames at moderate grid resolution.  But on the minus side, if the resolution was too coarse (often inevitable in engineering calculations), the flames were erratic---instead of a 10-foot flame looking like a candle, dsmag might produce an unstable ball of fire.

The solution to this dilemma came in the form of Deardorff’s model (1972), with a twist.  In the model Deardorff originally proposed, he solved a transport equation for the subgrid kinetic energy (sgs ke).  This strategy is expensive, but it allows for the inclusion of complex subgrid physics, like unresolved buoyancy production.  To avoid this cost, we employ a simple algebraic model for the sgs ke based on the scale similarity model of Bardina (1986).  The result is a model that is cheap and performs reasonably well at both coarse and fine resolution.  As an added benefit, the framework is now in place to utilize a transported sgs ke, a topic that might be worth exploring as FDS gets pushed to model large-scale outdoor flows in both wildfire and wind engineering applications.

While the new turbulence model is certainly significant, the change that really defines v6 is the new scalar transport scheme.  The ripple effects of this modification were not fully appreciated until a couple of years after the initial implementation.  What follows is the “saga of removing spurious temperature wiggles.”

Take FDS 5 and simulate a simple fire plume with open boundaries and 20 C ambient air temperature.  Now look closely at the temperature field near the corner of the burner.  You will see unphysical excursions of the local temperature to well below ambient, near 0 C.  Clearly this is undesirable.  What is not as obvious is that there are also unphysical excursions well above ambient, within the fire.  Of course, 1020 C versus 1000 C is not as dramatic a problem.

So why does this happen?  The root cause is central differencing in the solution of the density equation.  Purely centered schemes are notorious for generating dispersion errors---wiggles.  To combat this problem, v5 uses a boundedness correction which tries to prevent the scalar fields (density and species concentration) from going above or below defined limits.  With mass fractions the limits are easy to set (0 and 1).  With density there is only one hard limit (0).

In v6, we have decided to try another approach: total variation diminishing (TVD) scalar transport.  This is a fancy way of saying “we use just the right amount of upwinding.”  Pure upwind schemes are too dissipative (translation: inaccurate).  But TVD schemes are specially designed to track scalar discontinuities with minimal dispersion error and minimal dissipation.  This effectively solved the temperature wiggles problem.

Several TVD schemes are implemented in v6.  The default for LES is Superbee (Roe, 1986), so chosen because this scheme does the best job preserving the scalar variance in highly turbulent flows with coarse grid resolution.  The default scheme for DNS is Charm (Zhou, 1996) because the gradient steepening used in Superbee forces a stair step pattern at high resolution, while Charm is convergent.   A few other schemes (including Godunov and central differencing) are included for completeness; more details can be found in the Tech Guide.

These modifications were completed by the summer of 2009 (yes, you are reading that right).  It seemed at this point that we were very close to a v6 release.  Then… the wheels came off the bus.  In what we thought would be a routine pass through the verification suite, we hit a snag: our energy budget cases were off, by about 10%.  In addition, several of the validation cases now showed low upper layer temperatures---yep, by about 10%.

Hmmm.  A lot of head scratching ensued---two years, in fact, until Jason Floyd finally developed a test case that pinpointed the problem.  Imagine a T-mixer in which equal mass fluxes of a hot gas with a low cp (heat capcity) and a cold gas with a high cp mix and exit together.  The critical aspect of this case is that the flow paths are one cell thick and we artificially set the diffusivity and conductivity to zero.  Thus, any mixing is purely numerical.  What we found was that the outlet stream temperature was mass weighted instead of enthalpy weighted---there was no accounting for the variation in cp.  The pieces of the puzzle finally started to come together because another relatively recent development (actually in v5) was the inclusion of variable temperature specific heats.

The aftermath of this discovery was a torturous dissection of the energy equation (see appendix of the Tech Guide) illustrating that basic assumptions of the low-Mach number approximation can hide the effects of the numerical mixing from TVD transport schemes.  The bright side of the story is that through this analysis we were able to derive corrections for numerical mixing that force FDS to satisfy the discrete, conservative form of the sensible enthalpy equation, ultimately solving the temperature issues.

The benefit of the delayed release is that many other parts of the code were improved in the mean time.  So stay tuned for our next installment.

Sunday, November 4, 2012

FDS-SMV 6 Beta Testing

It has been over two years since our last official release of version 5 of FDS and Smokeview, and we are ready to start beta testing FDS-SMV 6. Downloads are available at the home page fire.nist.gov/fds. Scroll down to the bottom of the page for the appropriate links.

Our primary interest in beta testing the new release is to determine if there is sufficient documentation to convert FDS 5 input files into FDS 6 input files. In general, the major parameters are the same, and the basic syntax of the input file is the same. However, some of the sub-models are significantly different, and there is no easy way to maintain perfect backward compatibility in FDS (Smokeview, in general, is backward compatible). By issuing error statements at start up, we want to alert you to important changes, which is why we prefer to stop the program with an error statement rather than accepting an outdated parameter or construct.

For those interested in helping with the beta testing, download the latest FDS 6 "release candidate" and try to run one of your old cases. Chances are that you will receive an error message. Chapter 1 of the new FDS User's Guide has a table that lists all of the parameters that have changed from FDS 5 to 6. We would like you to tell us how easy or difficult you find the conversion process, and whether or not the changes are well-documented. If you would like to be listed as a beta tester, send us via an email your name and affiliation, and we will compile a list in the new FDS User's Guide.

You can report your findings directly to us via email, or you can also start an Issue Tracker or Discussion Group thread. The latter two are preferable so that we can all learn about the changes in FDS and Smokeview. This will also provide us with the opportunity to describe in more detail the changes that have been made. Many of these changes are "under the hood," so to speak; that is, there have been changes to core algorithms that may not be apparent at first glance. But we can discuss these improvements as we look at your cases.

Monday, February 21, 2011

Progress on FDS 6

Every once in a while, early on a saturday morning, I decide that I'm going to fix that leak under the bathroom sink, or repair the squeaky door hinge on the kitchen cabinet, once and for all. Nine times out of ten I find other things wrong, like rotten wood behind the sink, or a loose screw holding the cabinet to the wall. One thing leads to another and before long I've torn the whole room apart, and my wife is on the phone with the plumber or handyman. Which is why, by the way, monday morning is the busiest time for plumbers and handmen.

This is a good analogy for our development of FDS 6. We've been working many issues for quite some time, and making great progress, but we've thrown up alot of dust in the process. One thing just leads to another. We get asked often "when will FDS 6 be ready?" and our answer is "when it is better than FDS 5." What does "better" mean? Better physics, better numerics, better documentation -- better everything, and that's a tall order because FDS 5.5.3 has been working fairly well, or at least we have not seen too many serious bugs reported in the last few months.

But if FDS 5.5.3 is working well, why change it? Because there are long term goals for the program that simply cannot be achieved within the current framework. Things like Adaptive Mesh Refinement (dynamically adapting the local mesh to local conditions), non-rectilinear obstructions that are not tied to the grid, really big calculations running on hundreds or thousands of processors, and streamlined designation of material properties. All this without degrading the current ability of the model to track smoke and heat from specified fires, a very common design application.

One of the most challenging aspects of the current overhaul is that the new algorithms work well at fairly good grid resolution, and we're happy with the improvement in grid-independence as the mesh is refined. But we're still not completely satisfied with the results on very coarse grids. Some would ask why we should expect good results on bad grids. Two reasons -- first, most fire simulations start with a very small fire that is not well-resolved initially. Second, most simulations involve fairly large spaces. It's hardly worth developing a fire model that can only simulate fires that are just as easily re-created in a test laboratory. With relatively small fires in relatively big volumes, it is not possible to capture every detail of the fire behavior at all scales. We definitely want to push the limits and increase what we call the "dynamic range," but we know that even with multiple meshes, and eventually AMR, it's not always going to be possible to capture everything in a practical simulation. So we want to ensure that the results of the calculation are reasonable at a variety of grid resolutions.

We'll follow up this post with more details on different aspects of FDS 6 development, written by the various team members working the issues. In the next few months, we're going to ask for volunteers to run beta tests of the new version -- in particular to run cases with FDS 5 and 6 to see if there are serious problems. For those of you who are students working with FDS, consider trying out the new version (available via the GoogleCode SVN check-out) and reporting your findings to us. It may be a bit frustrating working with a moving target, but we think it's a more valuable educational experience to be working along side us developing new techniques for simulating fire rather than just running existing code.

Wednesday, September 8, 2010

Release of FDS 5.5.2

A maintenance version of FDS has been posted to the Downloads page. This is version 5.5.2. Unless there are serious bugs to fix, this might be our last release of FDS 5. We are working on FDS 6, and those of you who participate in the group discussions will have already heard alot of chatter about FDS 6. One thing to keep in mind is that the transition from FDS 5 to 6 will be relatively transparent to most users. We are not planning on major changes to the input parameter names or file structure. The reason for changing from 5 to 6 is that there are going to be changes to the basic algorithm that warrent a change in major release number.

As always, for those of you who have submitted bug reports for FDS 5.5.1, please check that the new version fixes the problem if we have claimed to have fixed it. This is a very important part of our quality control, but unfortunately only about 1 in 10 users follow up on bug reports and actually verify that the fix has worked. Even worse, we often find out, months after fixing something, that the original submitter of the bug report continues to use the work-around that was suggested when the report was first submitted. That's not a good way to make progress.