firemodels / fds

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

Unnecessary call to WALL_MODEL? #13235

Closed mcgratta closed 2 months ago

mcgratta commented 3 months ago

I need to clean up the use of T_IGN and in the process I ran into this call in velo.f90 around line 385

         CALL WALL_MODEL(SLIP_COEF,B2%U_TAU,B2%Y_PLUS,MU_DNS(IIG,JJG,KKG)/RHO(IIG,JJG,KKG),SF%ROUGHNESS,&
                         0.5_EB/B1%RDN,VEL_GAS-VEL_T)

Is this call necessary given that we also call the WALL_MODEL in VELOCITY_BC. It seems that its only purpose is to provide values for B2%U_TAU and B2%Y_PLUS which raises two questions:

  1. Are these parameters needed in all simulations? They seem to only be used in very special circumstances.
  2. Could these parameters be calculated in the call to WALL_MODEL in VELOCITY_BC?
rmcdermo commented 3 months ago

Yes, I suspect this is there to provide U_TAU and Y_PLUS. And I suspect it was put there because something else broke because it was not there, but I can't recall what. We would probably just have to remove it and see what firebot complains about.

drjfloyd commented 3 months ago

Looking at the log for velo.f90, it looks like this call was added on 4/02/2012 in dd91f6d7 add Van Driest damping to near wall turbulent viscosity.

mcgratta commented 3 months ago

Could we have our cake and eat it too by adding B2% to the U_TAU and Y_PLUS in the call we have to make to WALL_MODEL?

CALL WALL_MODEL(SLIP_COEF,U_TAU,Y_PLUS,MU_WALL/RHO_WALL,SF%ROUGHNESS,0.5_EB*DXX(ICD),VEL_GAS-VEL_T)
mcgratta commented 3 months ago

I moved the call to WALL_MODEL into WALL_BC where it will only be called when needed by condensation, deposition or whatever.

Marcos -- see me about doing the same for GEOM.

marcosvanella commented 3 months ago

Ok, I'll look into this. Thanks,

marcosvanella commented 2 months ago

Kevin, looks like after this change slices of VISCOUS WALL UNITS and FRICTION VELOCITY are not working correctly. This is the test case test.fds:

&HEAD CHID='test', TITLE='Test.' /
&MESH IJK=144,36,36, XB=-3.0,9.0,-1.5,1.5,-1.5,1.5 /
# Time:
&TIME T_END=20.0 /
# BCs:
&SURF ID='INLET',VEL=-1. /
&VENT PBX=-3., SURF_ID='INLET'/
&VENT PBX= 9., SURF_ID='OPEN' /
&VENT PBY=-1.5, SURF_ID='MIRROR' /
&VENT PBY= 1.5, SURF_ID='MIRROR' /
&VENT PBZ= 1.5, SURF_ID='MIRROR' /
# Slices
&SLCF PBY=0, QUANTITY='VELOCITY', VECTOR=.TRUE. /
&BNDF QUANTITY='FRICTION VELOCITY' /
&BNDF QUANTITY='VISCOUS WALL UNITS' /
&TAIL /

Here is the friction velocity before: Screenshot 2024-08-13 at 11 01 50 AM

This is after: Screenshot 2024-08-13 at 10 52 24 AM

I run the case with the changes and commenting the deposition clause in line 114 of wall.f90:

IF (WC%BOUNDARY_TYPE==SOLID_BOUNDARY) THEN ! .AND. (ANY(SPECIES_MIXTURE%CONDENSATION_SMIX_INDEX>0).OR.DEPOSITION)) THEN
      CALL WALL_MODEL(SLIP_COEF,B2%U_TAU,B2%Y_PLUS,MU_DNS(BC%IIG,BC%JJG,BC%KKG)/RHO(BC%IIG,BC%JJG,BC%KKG),SF%ROUGHNESS,&
                      0.5_EB/B1%RDN,B1%U_TANG)
ENDIF

and the problem is still there.

mcgratta commented 2 months ago

OK, I think that this is just a printout thing. That is, we were making this call to WALL_MODEL just to support the printout. I'll fix.

marcosvanella commented 2 months ago

My bad, looks like this works in wall.f90:

IF (WC%BOUNDARY_TYPE==SOLID_BOUNDARY) THEN 
      CALL WALL_MODEL(SLIP_COEF,B2%U_TAU,B2%Y_PLUS,MU_DNS(BC%IIG,BC%JJG,BC%KKG)/RHO(BC%IIG,BC%JJG,BC%KKG),SF%ROUGHNESS,&
                      0.5_EB/B1%RDN,B1%U_TANG)
ENDIF
mcgratta commented 2 months ago

Try it now.

marcosvanella commented 2 months ago

Completed.