firemodels / fds

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

EQUILIBRIUM_MODEL uses alot of CPU time #3788

Closed mcgratta closed 8 years ago

mcgratta commented 8 years ago

I know you're still working on this, but I found that EQUILIBRIUM_MODEL uses alot of CPU time, especially as the number of droplets increases. I've been running this case as the base case of a strong scaling test:

&HEAD CHID='strong_scaling_part_0001', TITLE='Strong scaling test with particles' /

&MESH IJK=144,96,64, XB=0.0,7.0,0.0,5.0,0.0,3.0, MULT_ID='mesh' /
&MULT ID='mesh', DX=7.0, DY=5.0, DZ=3.0, I_UPPER=0, J_UPPER=0, K_UPPER=0 /

&TIME T_BEGIN=-2., T_END=5. /

&MISC EQUILIBRIUM_MODEL=.TRUE. /

&DUMP NFRAMES=200, SIG_FIGS=3, SIG_FIGS_EXP=2,  DT_DEVC=5., DT_HRR=5. /

&ZONE LEAK_AREA(0)=0.05 /

&SPEC ID='WATER VAPOR' /

&REAC FUEL       = 'N-HEPTANE'
      FYI        = 'Heptane, C_7 H_16'
      CO_YIELD   = 0.006
      SOOT_YIELD = 0.015, CRITICAL_FLAME_TEMPERATURE=1560. /

&OBST XB=2.00,5.00,0.75,1.75,0.00,1.50 /  Port Engine
&OBST XB=2.00,5.00,3.25,4.25,0.00,1.50 /  Starboard Engine
&OBST XB=2.00,5.00,1.75,2.75,1.50,1.50 /  Horizontal Obstruction Plate

&PART ID='heptane droplets', INITIAL_TEMPERATURE=95., SPEC_ID='N-HEPTANE', DIAMETER=200., HEAT_OF_COMBUSTION=45000. /
&PART ID='water droplets', SAMPLING_FACTOR=100, SPEC_ID='WATER VAPOR', DIAMETER=175. /

&PROP ID='Bete P40', PART_ID='heptane droplets', FLOW_RATE=1.143, PARTICLE_VELOCITY=8., SPRAY_ANGLE=0.,15. /
&PROP ID='Navy', PART_ID='water droplets', K_FACTOR=1.35, OPERATING_PRESSURE=70., PARTICLE_VELOCITY=75., SPRAY_ANGLE=0.,60. /

&SLCF PBY=2.5,QUANTITY='TEMPERATURE',VECTOR=.TRUE. /

&MATL ID            = 'STEEL'
      FYI           = 'Quintiere, Fire Behavior'
      SPECIFIC_HEAT = 0.46
      CONDUCTIVITY  = 45.8
      DENSITY       = 7850. /

&SURF ID        = 'STEEL SHEET', DEFAULT=.TRUE.
      MATL_ID   = 'STEEL'
      COLOR     = 'GRAY 80'
      THICKNESS = 0.005 /

Spray Nozzles

&DEVC XYZ=3.60,1.80,1.00, PROP_ID='Bete P40', QUANTITY='TIME', SETPOINT=-60., ORIENTATION=0.,1.,0., ID='fuel_nozzle' /

&DEVC XYZ=1.00,1.30,2.90, PROP_ID='Navy', QUANTITY='TIME', SETPOINT=0., ID='mist_nozzle' /
&DEVC XYZ=3.60,1.30,2.90, PROP_ID='Navy', QUANTITY='TIME', SETPOINT=0., ID='mist_nozzle' /
&DEVC XYZ=6.00,1.30,2.90, PROP_ID='Navy', QUANTITY='TIME', SETPOINT=0., ID='mist_nozzle' /
&DEVC XYZ=1.00,3.80,2.90, PROP_ID='Navy', QUANTITY='TIME', SETPOINT=0., ID='mist_nozzle' /
&DEVC XYZ=3.60,3.80,2.90, PROP_ID='Navy', QUANTITY='TIME', SETPOINT=0., ID='mist_nozzle' /
&DEVC XYZ=6.00,3.80,2.90, PROP_ID='Navy', QUANTITY='TIME', SETPOINT=0., ID='mist_nozzle' /

&TAIL /

For EQUILIBRIUM_MODEL=.FALSE., the CPU time is:

MAIN    DIVG    MASS    VELO    PRES    WALL    DUMP    PART    RADI    FIRE    COMM    EVAC    HVAC    Total T_USED (s)                                                                         
1.36E+02    7.94E+03    3.91E+03    4.06E+03    4.74E+03    5.27E+02    2.34E+02    8.86E+02    2.93E+03    5.03E+02    1.53E-01    0.00E+00    0.00E+00    2.59E+04

For EQUILIBRIUM_MODEL=.TRUE., the CPU time is:

MAIN    DIVG    MASS    VELO    PRES    WALL    DUMP    PART    RADI    FIRE    COMM    EVAC    HVAC    Total T_USED (s)                                                                         
1.34E+02    7.99E+03    3.91E+03    4.13E+03    5.26E+03    5.32E+02    2.36E+02    8.99E+04    2.96E+03    5.15E+02    1.43E-01    0.00E+00    0.00E+00    1.16E+05

I did not see anything in the new droplet routine that would lead to such a huge increase in CPU. Maybe you're looping over something twice?

drjfloyd commented 8 years ago

The function for computing the equilibrium condition is not very cheap. That is probably a good part of it. It is also likely I am not as efficient as I could be in the routine. As I continue to work on it, I'll look to see where I can get rid of unneeded loops.

rmcdermo commented 8 years ago

I don't see how the GET_EQ function should depend on the number of particles. It works at the cell level, no?

On Thu, Apr 14, 2016 at 5:21 PM, Jason Floyd notifications@github.com wrote:

The function for computing the equilibrium condition is not very cheap. That is probably a good part of it. It is also likely I am not as efficient as I could be in the routine. As I continue to work on it, I'll look to see where I can get rid of unneeded loops.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/firemodels/fds-smv/issues/3788#issuecomment-210153124

drjfloyd commented 8 years ago

Indirectly there could be a dependence. GET_EQ operates on all cells with evaporating particles. If the increase in the number of particles for this case also has more cells with particles, then the cost of GET_EQ will go up.

drjfloyd commented 8 years ago

I am closing this issue since a new approach for droplets has been implemented.