firemodels / fds

Fire Dynamics Simulator
https://pages.nist.gov/fds-smv/
Other
625 stars 610 forks source link

stoichiometry balance #2688

Closed calvinkaf closed 8 years ago

calvinkaf commented 8 years ago

I am new user in FDS, and I have currently come across a problem in one of the examples and hope if someone can help.

I look into the example ‘couch.fds’ of the ‘Examples’ folder. I could get this example ran fine. However, it gave error when I changed the ‘ REAC fuel’. The original fuel used in the example (couch.fds) is propane, and actually the fuel I used is also propane but just the syntax to insert in the fds text file is different.

I used the propane description from the FDS6; page 143-144 to replace the single REAC line of the original file. When I ran the case, an error (as below) ‘on the element N’ turned up.

ERROR: Problem with REAC 1. Unbalanced stoichiometry. The following elements are unbalanced: Element Atom Error N -0.123E-02

I could not understand where went wrong of the reaction fuel. I hope someone could kindly help me to solve this problem, many thanks.

mcgratta commented 8 years ago

I cannot diagnose the problem without the input file. Create a very simple version of the input file that demonstrates the problem.

rmcdermo commented 8 years ago

I recreated the problem. Calvin is right, the example in the user guide needs to be fixed. I should be able to get to this today.

rmcdermo commented 8 years ago

Actually, I probably won't get this completely sorted out today. I want to do this right and put together a writeup because this sort of thing keeps coming up.

calvinkaf commented 8 years ago

Hi McGratta, I was sorry that I forgot to give more detail of the problem yesterday. In the example 'couch.fds' under /Examples/Fires, the REAC line is shown as below:

&HEAD CHID='couch', TITLE='Single Couch Test Case, SVN $Revision: 18022 $' / &MESH IJK=24,10,24, XB=1.1,3.5,3.6,4.6,0.0,2.4 / &TIME T_END=900. / &DUMP DT_RESTART=100. / SURF ID='BURNER', HRRPUA=1000. / &REAC SOOT_YIELD=0.01,FUEL='PROPANE'/ : :

For my case, I changed only the 'REAC' into a longer version as given in the User Guide v6 page 143-144; like this

&SPEC ID='PROPANE', / &SPEC ID='OXYGEN', LUMPED_COMPONENT_ONLY=.TRUE. / &SPEC ID='NITROGEN', LUMPED_COMPONENT_ONLY=.TRUE. / &SPEC ID='WATER VAPOR', LUMPED_COMPONENT_ONLY=.TRUE. / &SPEC ID='CARBON DIOXIDE', LUMPED_COMPONENT_ONLY=.TRUE. / &SPEC ID='SOOT', AEROSOL=.TRUE. / &SPEC ID = 'AIR', SPEC_ID ='NITROGEN','OXYGEN', VOLUME_FRACTION = 3.7619,1., BACKGROUND = .TRUE. / &SPEC ID = 'PRODUCTS', SPEC_ID ='NITROGEN','CARBON DIOXIDE','WATER VAPOR', VOLUME_FRACTION = 18.1182,2.8164,4. / &REAC FUEL='PROPANE', HEAT_OF_COMBUSTION=44715., SPEC_ID_NU='PROPANE','AIR','PRODUCTS','SOOT', NU=-1.,-4.8164,1,0.1836 /

I ran this modified case and received error as: ERROR: Problem with REAC 1. Unbalanced stoichiometry. The following elements are unbalanced: Element Atom Error N -0.123E-02

I cannot figure out what is the cause, Could you please help? Many thanks.

rmcdermo commented 8 years ago

I am working on it.

On Fri, Sep 4, 2015 at 11:19 PM, calvinkaf notifications@github.com wrote:

Hi McGratta, I was sorry that I forgot to give more detail of the problem yesterday. In the example 'couch.fds' under /Examples/Fires, the REAC line is shown as below:

&HEAD CHID='couch', TITLE='Single Couch Test Case, SVN $Revision: 18022 $' / &MESH IJK=24,10,24, XB=1.1,3.5,3.6,4.6,0.0,2.4 / &TIME T_END=900. / &DUMP DT_RESTART=100. / SURF ID='BURNER', HRRPUA=1000. / &REAC SOOT_YIELD=0.01,FUEL='PROPANE'/ : :

For my case, I changed only the 'REAC' into a longer version as given in the User Guide v6 page 143-144; like this

&SPEC ID='PROPANE', / &SPEC ID='OXYGEN', LUMPED_COMPONENT_ONLY=.TRUE. / &SPEC ID='NITROGEN', LUMPED_COMPONENT_ONLY=.TRUE. / &SPEC ID='WATER VAPOR', LUMPED_COMPONENT_ONLY=.TRUE. / &SPEC ID='CARBON DIOXIDE', LUMPED_COMPONENT_ONLY=.TRUE. / &SPEC ID='SOOT', AEROSOL=.TRUE. / &SPEC ID = 'AIR', SPEC_ID ='NITROGEN','OXYGEN', VOLUME_FRACTION = 3.7619,1., BACKGROUND = .TRUE. / &SPEC ID = 'PRODUCTS', SPEC_ID ='NITROGEN','CARBON DIOXIDE','WATER VAPOR', VOLUME_FRACTION = 18.1182,2.8164,4. / &REAC FUEL='PROPANE', HEAT_OF_COMBUSTION=44715., SPEC_ID_NU='PROPANE','AIR','PRODUCTS','SOOT', NU=-1.,-4.8164,1,0.1836 /

I ran this modified case and received error as: ERROR: Problem with REAC 1. Unbalanced stoichiometry. The following elements are unbalanced: Element Atom Error N -0.123E-02

I cannot figure out what is the cause, Could you please help? Many thanks.

— Reply to this email directly or view it on GitHub https://github.com/firemodels/fds-smv/issues/2688#issuecomment-137897197 .

rmcdermo commented 8 years ago

Jason, How does one set the SOOT_H_FRACTION if we are tracking soot? For simple chemistry it looks to me like we set the default to 0.1. But if you put a

&SPEC SOOT, AEROSOL=.TRUE. /

then it looks to me like SOOT_H_FRACTION = 0. I think this is inconsistent. I see you discuss this in the user guide, but I think the FORMULA = 'C0.9H0.1' ought to be the default for a SOOT species if that is our default for simple chemistry.

Also, I have to infer this by doing my own stoichiometry (I agree with FDS if I set SHF=0, but get an atom balance error if I use 0.1 in my calcs). I think we should go ahead and write the .out file with the computed information (unbalanced) before we shutdown so that the user can see what assumptions are being made.

rmcdermo commented 8 years ago

So ignore my first question...

drjfloyd commented 8 years ago

We can change the default formula for SOOT to C0.9H0.1. If the user wants to change it, it would be done via FORMULA on SPEC rather than SOOT_H_FRACTION on REAC (I'd prefer avoiding adding more to the rats nest of logic that translates REAC inputs to SPEC inputs). We will have to update a number of input file (NIST_NRC plus some others).

rmcdermo commented 8 years ago

Option B would be to set the default simple chem to be pure carbon. I just don't think we want these defaults to be different. But I'll leave which default you want up to you.

Good news is that stoichiometry works! I'll push up the fix for Calvin shortly.

On Thu, Sep 10, 2015 at 11:05 AM, Jason Floyd notifications@github.com wrote:

We can change the default formula for SOOT to C0.9H0.1. If the user wants to change it, it would be done via FORMULA on SPEC rather than SOOT_H_FRACTION on REAC (I'd prefer avoiding adding more to the rats nest of logic that translates REAC inputs to SPEC inputs). We will have to update a number of input file (NIST_NRC plus some others).

— Reply to this email directly or view it on GitHub https://github.com/firemodels/fds-smv/issues/2688#issuecomment-139273879 .

rmcdermo commented 8 years ago

Calvin, Try the stoich coefficients given in this example. Let us know if this does not work. https://github.com/firemodels/fds-smv/blob/development/Verification/Species/lumped_stoich_soot.fds

rmcdermo commented 8 years ago

Amazingly, the problem came down to one digit begin off in the example in the FDS User Guide. https://github.com/firemodels/fds-smv/pull/2718/files I got curious because the propane_flame_deposition.fds case actually works. Somehow there was a copy/paste error in the guide.

drjfloyd commented 8 years ago

Randy, I am in the process of changing SOOT to be consistent with simple chemistry. The screen shot below shows a new output debug showing how FDS parsed the reaction and what the atom balance calculation did. Is this a helpful diagnostic to write out?

clipboard01

rmcdermo commented 8 years ago

This is much better! Go with it.

Ultimately, it would be great if we could tell the user what we suspect the problem is. How would you go about fixing this problem with your spreadsheet? At what point has the user over-constrained the problem?

I wonder if it is worth converting your spreadsheet into a little command-line tool with user prompts that walks them through setting up the chemistry? Well, this can wait, but something to think about.

On Fri, Sep 11, 2015 at 11:29 AM, Jason Floyd notifications@github.com wrote:

Randy, I am in the process of changing SOOT to be consistent with simple chemistry. The screen shot below shows a new output debug showing how FDS parsed the reaction and what the atom balance calculation did. Is this a helpful diagnostic to write out?

[image: clipboard01] https://cloud.githubusercontent.com/assets/12799217/9818790/3f909b64-5878-11e5-92b9-467672db63d8.png

— Reply to this email directly or view it on GitHub https://github.com/firemodels/fds-smv/issues/2688#issuecomment-139576313 .

drjfloyd commented 8 years ago

I am not sure we could easily identify the problem for anything other than predefined hydrocarbon species. Say the user defined a custom fuel (e.g. use FORMULA on SPEC) and is using lumped species for air and products. I am not sure we would be able to positively identify if the error is a typo in the FORMULA, an error in a lumped species definition, or both.

We may want to go the route of a wiki page that describes how to balance a generic reaction along with a tool that does it for CHON fuels.

rmcdermo commented 8 years ago

The koverholt and PyroSim tools are available. But I don't think koverholt is clear on how to handle things beyond simple chem. I have hot played with PyroSim's stuff, but I suspect it must be more of less the same was what you have in a spreadsheet. The trouble with all these things is that they only make sense to the people who wrote them. I am thinking we really need to hold someone's hand through setting up the chemistry. I think this could be done with a simple Q&A type fortran program that we could bundle with our release.

On Fri, Sep 11, 2015 at 11:55 AM, Jason Floyd notifications@github.com wrote:

I am not sure we could easily identify the problem for anything other than predefined hydrocarbon species. Say the user defined a custom fuel (e.g. use FORMULA on SPEC) and is using lumped species for air and products. I am not sure we would be able to positively identify if the error is a typo in the FORMULA, an error in a lumped species definition, or both.

We may want to go the route of a wiki page that describes how to balance a generic reaction along with a tool that does it for CHON fuels.

— Reply to this email directly or view it on GitHub https://github.com/firemodels/fds-smv/issues/2688#issuecomment-139583413 .

drjfloyd commented 8 years ago

I am not sure I completely agree. Providing a simple tool for basic CHON chemistry is one thing. But if the user goes beyond that to other species and elements, then I see we could have one hell of a development project for a tool to handle any arbitrary chemical reaction (say 15 reactants and 4 products). We should explain how it is done (e.g. run a null-transient case with no reactions so you get the correct molecular weights for everything and can get the air species if they are using that).

rmcdermo commented 8 years ago

I hear you. But the dilemma in my mind is that I think we already do a pretty good job of explaining the basics and it is still really hard to sort out problems if they occur. I am sympathetic to the poor user who has to sort this stuff out on their own. I have a reasonably good handle on how all this works and it still took me a long time to get to the bottom of the error in this case. Maybe it should not have. And probably would not have if I were dealing with this stuff everyday. But when I look at it once every few months, I can tell you the re-learning curve is steep (or steeper than it could be).

calvinkaf commented 8 years ago

Hi rmcdermo, Many thanks for your help. I had tried your lumped_stoich_soot.fds and it did not work with error as; ERROR: Problem with REAC 1. Unbalanced stoichiometry. The following elements are unbalanced: Element Atom Error H -0.409E-02 C 0.409E-02

I did the stoich balance again and put all the coefficients into your stoich_soot.fds and run, it is working with no error. I am not sure whether it is wrong or not but it has no error message. I guess the problem is from the syntax apart from the correct coefficient . I put my syntax below for your perusal.

&HEAD CHID='lumped_stoich_soot' / &MESH IJK=4,4,4, XB=0,1,0,1,0,1 / &TIME T_END=5./ &SPEC ID = 'PROPANE', FORMULA='C3H8' / &SPEC ID = 'OXYGEN', LUMPED_COMPONENT_ONLY=.TRUE./ &SPEC ID = 'NITROGEN', LUMPED_COMPONENT_ONLY=.TRUE./ &SPEC ID = 'WATER VAPOR', LUMPED_COMPONENT_ONLY=.TRUE./ &SPEC ID = 'CARBON DIOXIDE', LUMPED_COMPONENT_ONLY=.TRUE./ &SPEC ID = 'SOOT', AEROSOL = .TRUE. /

&SPEC ID='AIR', BACKGROUND=.TRUE., SPEC_ID(1)='OXYGEN', VOLUME_FRACTION(1)=0.21, SPEC_ID(2)='NITROGEN', VOLUME_FRACTION(2)=0.79 /

&SPEC ID='PRODUCTS', SPEC_ID(1)='CARBON DIOXIDE', VOLUME_FRACTION(1)=1.36, SPEC_ID(2)='WATER VAPOR', VOLUME_FRACTION(2)=4.00, SPEC_ID(3)='NITROGEN', VOLUME_FRACTION(3)=12.64, /

&REAC FUEL = 'PROPANE', HEAT_OF_COMBUSTION=2044, SPEC_ID_NU = 'PROPANE','AIR','PRODUCTS','SOOT', NU=-1,-16,1,1.64 /

&TAIL/

rmcdermo commented 8 years ago

The lumped_stoich_soot.fds case works with the latest code.

On Mon, Sep 14, 2015 at 2:55 AM, calvinkaf notifications@github.com wrote:

Hi rmcdermo, Many thanks for your help. I had tried your lumped_stoich_soot.fds and it did not work with error as; ERROR: Problem with REAC 1. Unbalanced stoichiometry. The following elements are unbalanced: Element Atom Error H -0.409E-02 C 0.409E-02

I did the stoich balance again and put all the coefficients into your stoich_soot.fds and run, it is working with no error. I am not sure whether it is wrong or not but it has no error message. I guess the problem is from the syntax apart from the correct coefficient . I put my syntax below for your perusal.

&HEAD CHID='lumped_stoich_soot' / &MESH IJK=4,4,4, XB=0,1,0,1,0,1 / &TIME T_END=5./ &SPEC ID = 'PROPANE', FORMULA='C3H8' / &SPEC ID = 'OXYGEN', LUMPED_COMPONENT_ONLY=.TRUE./ &SPEC ID = 'NITROGEN', LUMPED_COMPONENT_ONLY=.TRUE./ &SPEC ID = 'WATER VAPOR', LUMPED_COMPONENT_ONLY=.TRUE./ &SPEC ID = 'CARBON DIOXIDE', LUMPED_COMPONENT_ONLY=.TRUE./ &SPEC ID = 'SOOT', AEROSOL = .TRUE. /

&SPEC ID='AIR', BACKGROUND=.TRUE., SPEC_ID(1)='OXYGEN', VOLUME_FRACTION(1)=0.21, SPEC_ID(2)='NITROGEN', VOLUME_FRACTION(2)=0.79 /

&SPEC ID='PRODUCTS', SPEC_ID(1)='CARBON DIOXIDE', VOLUME_FRACTION(1)=1.36, SPEC_ID(2)='WATER VAPOR', VOLUME_FRACTION(2)=4.00, SPEC_ID(3)='NITROGEN', VOLUME_FRACTION(3)=12.64, /

&REAC FUEL = 'PROPANE', HEAT_OF_COMBUSTION=2044, SPEC_ID_NU = 'PROPANE','AIR','PRODUCTS','SOOT', NU=-1,-16,1,1.64 /

&TAIL/

— Reply to this email directly or view it on GitHub https://github.com/firemodels/fds-smv/issues/2688#issuecomment-139979516 .

calvinkaf commented 8 years ago

Hi rmcdermo,

We actually want to check in the &REAC line, whether the 'soot_yield' must specified or not. In most of the examples, in the &REAC either soot or HRRPUA is specified and thus we have combustion.

Now, what if we just use the chemical alone (say pmma) placing in a room and surrounding is only air (i.e. oxygen and nitrogen), and the pmma is ignited by an ignitor. In such case, do you think it is possible that the pmma will burn (with air) itself without the soot-yield or HRRPUA specified?

We appreciate your help very much.

drjfloyd commented 8 years ago

There are two basic approaches on REAC for defining the stoichiometry for a chemical reaction. What we call simple chemistry where you specify C,H,O,N (or use a predefined fuel) and what we call complex chemistry where you must provide the NU values for the reaction. SOOT_YIELD is an optional input that is only used with the simple chemistry method.

If you are using simple chemistry and do not provide a SOOT_YIELD, you can still have a fire but it will not produce any soot.

HRRPUA is not an input on REAC. That is an input on SURF. If you are asking if you can have a fire without a SURF that has HRRPUA, then the answer is yes as long as some other input results in the fuel gas being introduced into the domain (e.g. a SURF with MLRPUA, MASS_FLUX, a pyrolysis model, etc.).

calvinkaf commented 8 years ago

Dear drjfloyd,

Thank you very much for the information and help.

What we actually want to do is that we want to make a soot deposition in fire scenario with PMMA and air (air considered having oxygen and nitrogen, and PMMA is placed in front of a wall). We have done the stoichiometry balance etc.

We do not want to make the fire by specifying soot-yield in SURF or HRRPUA in REAC because we think this already designates a fire started. But we want to have the fire starts burning itself (say few seconds delay after the run starts) and the fire is burning itself with air (naturally) if you understand what I am trying to say. I do not know if it is possible to reproduce this scenario and I cannot find any example in FDS about this.

I am a beginner to FDS and I cannot find anyone in my area can help me. I hope if you could help me through this. Thank you for all your assistance.

bwklein commented 8 years ago

Randy and Jason, if you have a suggestion for a Wizard tool that guides a user through the process of building a reaction, we would be glad to do something like this in PyroSim. This kind of thing is exactly what a tool like PyroSim is designed for. Please send the suggestion to support@thunderheadeng.com and we will make a feature request and start working on it. We have also made some spreadsheets to help with these things that should probably become part of the software UI, but we wanted to test it out in something easier to build as a rough draft.

rmcdermo commented 8 years ago

Thanks, Bryan. If we get any firm ideas we'll let you know.

On Wed, Sep 16, 2015 at 10:16 AM, Bryan Klein notifications@github.com wrote:

Randy and Jason, if you have a suggestion for a Wizard tool that guides a user through the process of building a reaction, we would be glad to do something like this in PyroSim. This kind of thing is exactly what a tool like PyroSim is designed for. Please send the suggestion to support@thunderheadeng.com and we will make a feature request and start working on it. We have also made some spreadsheets to help with these things that should probably become part of the software UI, but we wanted to test it out in something easier to build as a rough draft.

— Reply to this email directly or view it on GitHub https://github.com/firemodels/fds-smv/issues/2688#issuecomment-140754223 .

drjfloyd commented 8 years ago

Calvin,

If you do not want to specify the fuel mass flux (HRRPUA, MLRPUA, etc.) on a SURF input, then you need to use one of the pyrolysis models tied to the heat conduction calculation. There are many examples of these models in the User's Guide, the Verification Guide, and the Validation Guide. At this point since you no longer have a bug report, this discussion should be moved to the discussion forum. It should be noted that pyrolysis modeling and soot deposition is an advanced use of FDS and you should take the time to make sure you understand how the models work, how you will obtain the data needed to use the models, how you will verify that validity of that data, etc.

calvinkaf commented 8 years ago

Dear drjfloyd,

I really appreciate your help in resolving the problem. Many thanks.