Open marcosvanella opened 3 weeks ago
I made some more progress on this issue. The latest commit prevents temperature fluctuations in a multi-species, isothermal flow when an obstruction that abuts a mesh interface is removed. There is a still a small change when an abutting obstruction is created at a mesh boundary.
Running either Presure_Solver/obst_activation_default.fds or Presure_Solver/obst_activation_ulmat.fds we see a divergence and temperature jump when obstacles that have a side in an interpolated boundary appear or disappear.
The culprit is that we change the type of boundary condition before computing mass advective fluxes, and use a different value of normal velocity for external wall cells that have changed from INTERPOLATED to SOLID and viceversa. In DENSITY we have for CORRECTOR:
Here, we ended up at the end of the predictor with velocity US having and interpolated BC, but right after that we call CREATE_OR_REMOVE_OBSTRUCTIONS changing that WALL_CELL to SOLID. Therefore the value of UU we get is US, not the corrected value and mass advection is computed with a different velocity field for the cell next to the EWC.
I think we should use the same boundary condition from the end of previous substep velocity US, in the previous example INTERPOLATED. To corroborate this add this line in type.f90, line 437 (after BOUNDARY_TYPE declaration for WALL_TYPE):
INTEGER :: BOUNDARY_TYPE_PREDICTOR=0 !< Descriptor: SOLID, MIRROR, OPEN, INTERPOLATED, etc
In func.f90 (PACK_WALL) add the following in line 1568, after the EQUATE call for WC%BOUNDARY_TYPE:
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),WC%BOUNDARY_TYPE_PREDICTOR,UNPACK_IT)
In main.f90 add declarations:
at the beginning and the following code in line ~786 (before the CREATE_OR_REMOVE_OBSTRUCTIONS call)
Then in mass.f90 change BOUNDARY_TYPE by BOUNDARY_TYPE_PREDICTOR in line 412, CORRECTOR stage of density:
This is what I see now:
This fix will require adding an integer for every WALL_CELL, there might be a more memory efficient way to deal with this.