From afae25a29289f42fa10cec2ed12a50119d297977 Mon Sep 17 00:00:00 2001 From: Matt Rolchigo <40367841+MattRolchigo@users.noreply.github.com> Date: Fri, 12 May 2023 14:22:11 -0400 Subject: [PATCH] Avoid edge case where liquid cells remain and time steps are skipped (#191) * Avoid edge case where liquid cells remain and time steps are skipped * Added comments clarifying new variable/future update --- src/CAupdate.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/CAupdate.cpp b/src/CAupdate.cpp index 6b6ae6b3..1a42a702 100644 --- a/src/CAupdate.cpp +++ b/src/CAupdate.cpp @@ -138,7 +138,9 @@ void FillSteeringVector_Remelt(int cycle, int LocalActiveDomainSize, int nx, int bool atMeltTime = (cycle == MeltTimeStep(GlobalD3D1ConvPosition)); bool pastCritTime = (cycle > CritTimeStep(GlobalD3D1ConvPosition)); if ((atMeltTime) && ((cellType == TempSolid) || (cellType == Active))) { - // This cell should be a liquid cell + // FIXME: Active cells that didn't finish their previous solidification event should have that + // solidification event skipped instead of having both this one and the previous one complete This cell + // should be a liquid cell CellType(GlobalD3D1ConvPosition) = Liquid; // Reset current undercooling to zero UndercoolingCurrent(GlobalD3D1ConvPosition) = 0.0; @@ -749,10 +751,12 @@ void IntermediateOutputAndCheck_Remelt( XSwitch = 1; } MPI_Bcast(&XSwitch, 1, MPI_INT, 0, MPI_COMM_WORLD); + // Cells of interest are those currently undergoing a melting-solidification cycle + unsigned long int RemainingCellsOfInterest = GlobalActiveCells + GlobalSuperheatedCells + GlobalUndercooledCells; if ((XSwitch == 0) && ((TemperatureDataType == "R") || (TemperatureDataType == "S"))) - JumpTimeStep(cycle, GlobalActiveCells, LocalTempSolidCells, MeltTimeStep, LocalActiveDomainSize, MyYSlices, - ZBound_Low, true, CellType, LayerID, id, layernumber, np, nx, ny, nz, MyYOffset, GrainID, - CritTimeStep, GrainUnitVector, UndercoolingChange, UndercoolingCurrent, OutputFile, + JumpTimeStep(cycle, RemainingCellsOfInterest, LocalTempSolidCells, MeltTimeStep, LocalActiveDomainSize, + MyYSlices, ZBound_Low, true, CellType, LayerID, id, layernumber, np, nx, ny, nz, MyYOffset, + GrainID, CritTimeStep, GrainUnitVector, UndercoolingChange, UndercoolingCurrent, OutputFile, NGrainOrientations, PathToOutput, IntermediateFileCounter, nzActive, deltax, XMin, YMin, ZMin, NumberOfLayers, XSwitch, TemperatureDataType, PrintIdleMovieFrames, MovieFrameInc, PrintBinary); }