Skip to content

Commit

Permalink
Merge pull request #100 from LLNL/GSPH_debugFix
Browse files Browse the repository at this point in the history
GSPH added more tests
  • Loading branch information
jmikeowen authored Oct 19, 2021
2 parents 267877c + c4e65e2 commit bdffee2
Show file tree
Hide file tree
Showing 11 changed files with 699 additions and 371 deletions.
4 changes: 0 additions & 4 deletions src/GSPH/GSPHHydroBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -831,10 +831,6 @@ evaluateDerivatives(const typename Dimension::Scalar time,
const auto Peffj = Pj + Rj;

// Acceleration.
CHECK(rhoi > 0.0);
CHECK(rhoj > 0.0);
CHECK(ci > 0.0);
CHECK(cj > 0.0);
const auto voli = mi/rhoi;
const auto volj = mj/rhoj;

Expand Down
21 changes: 18 additions & 3 deletions tests/Hydro/Noh/Noh-cylindrical-2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#
# GSPH
#
#ATS:gsph0 = test( SELF, "--gsph True --nRadial 100 --cfl 0.25 --nPerh 2.01 --graphics False --restartStep 20 --clearDirectories True --steps 100", label="Noh cylindrical GSPH, nPerh=2.0", np=8)
#ATS:gsph1 = testif(sph0, SELF, "--gsph True --nRadial 100 --cfl 0.25 --nPerh 2.01 --graphics False --restartStep 20 --clearDirectories False --steps 60 --restoreCycle 40 --checkRestart True", label="Noh cylindrical GSPH, nPerh=2.0, restart test", np=8)
#ATS:gsph0 = test( SELF, "--gsph True --nRadial 100 --cfl 0.25 --nPerh 2.01 --graphics False --restartStep 20 --clearDirectories True --steps 100", label="Noh cylindrical GSPH, nPerh=2.0", np=8)
#ATS:gsph1 = testif(gsph0, SELF, "--gsph True --nRadial 100 --cfl 0.25 --nPerh 2.01 --graphics False --restartStep 20 --clearDirectories False --steps 60 --restoreCycle 40 --checkRestart True", label="Noh cylindrical GSPH, nPerh=2.0, restart test", np=8)


#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -65,6 +65,7 @@
svph = False,
crksph = False,
psph = False,
fsisph = False,
gsph = False,
asph = False, # This just chooses the H algorithm -- you can use this with CRKSPH for instance.
boolReduceViscosity = False,
Expand Down Expand Up @@ -137,6 +138,8 @@
)

assert not(boolReduceViscosity and boolCullenViscosity)
assert not(gsph and (boolReduceViscosity or boolCullenViscosity))
assert not(fsisph and not solid)
assert thetaFactor in (0.5, 1.0, 2.0)
theta = thetaFactor * pi

Expand Down Expand Up @@ -327,7 +330,19 @@
HUpdate = HUpdate,
XSPH = XSPH,
ASPH = asph)

elif fsisph:
hydro = FSISPH(dataBase = db,
W = WT,
filter = filter,
cfl = cfl,
interfaceMethod = ModulusInterface,
sumDensityNodeLists=[nodes1],
densityStabilizationCoefficient = 0.00,
useVelocityMagnitudeForDt = useVelocityMagnitudeForDt,
compatibleEnergyEvolution = compatibleEnergy,
evolveTotalEnergy = evolveTotalEnergy,
correctVelocityGradient = correctVelocityGradient,
HUpdate = HUpdate)
elif gsph:
limiter = VanLeerLimiter()
waveSpeed = DavisWaveSpeed()
Expand Down
2 changes: 2 additions & 0 deletions tests/Hydro/Noh/Noh-planar-1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@
)

assert not(boolReduceViscosity and boolCullenViscosity)
assert not(gsph and (boolReduceViscosity or boolCullenViscosity))
assert not(fsisph and not solid)
if smallPressure:
P0 = 1.0e-6
eps1 = P0/((gamma - 1.0)*rho1)
Expand Down
114 changes: 78 additions & 36 deletions tests/Hydro/Noh/Noh-spherical-3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
svph = False,
crksph = False,
psph = False,
fsisph = False,
gsph = False,

asph = False, # This just chooses the H algorithm -- you can use this with CRKSPH for instance.
boolReduceViscosity = False,
HopkinsConductivity = False, # For PSPH
Expand Down Expand Up @@ -120,6 +123,9 @@
)

assert not(boolReduceViscosity and boolCullenViscosity)
assert not(gsph and (boolReduceViscosity and boolCullenViscosity))
assert not(fsisph and not solid)

if smallPressure:
P0 = 1.0e-6
eps0 = P0/((gamma - 1.0)*rho0)
Expand All @@ -130,6 +136,10 @@
hydroname = "CRKSPH"
elif psph:
hydroname = "PSPH"
elif fsisph:
hydroname = "FSISPH"
elif gsph:
hydroname = "GSPH"
else:
hydroname = "SPH"
if asph:
Expand Down Expand Up @@ -216,8 +226,8 @@
SPH = True)

if mpi.procs > 1:
from VoronoiDistributeNodes import distributeNodes3d
#from PeanoHilbertDistributeNodes import distributeNodes3d
#from VoronoiDistributeNodes import distributeNodes3d
from PeanoHilbertDistributeNodes import distributeNodes3d
else:
from DistributeNodes import distributeNodes3d

Expand Down Expand Up @@ -272,6 +282,35 @@
densityUpdate = densityUpdate,
HUpdate = HUpdate,
ASPH = asph)
elif fsisph:
hydro = FSISPH(dataBase = db,
W = WT,
filter = filter,
cfl = cfl,
interfaceMethod = ModulusInterface,
sumDensityNodeLists=[nodes1],
densityStabilizationCoefficient = 0.00,
useVelocityMagnitudeForDt = useVelocityMagnitudeForDt,
compatibleEnergyEvolution = compatibleEnergy,
evolveTotalEnergy = evolveTotalEnergy,
correctVelocityGradient = correctVelocityGradient,
HUpdate = HUpdate)
elif gsph:
limiter = VanLeerLimiter()
waveSpeed = DavisWaveSpeed()
solver = HLLC(limiter,waveSpeed,True,RiemannGradient)
hydro = GSPH(dataBase = db,
riemannSolver = solver,
W = WT,
cfl=cfl,
compatibleEnergyEvolution = compatibleEnergy,
correctVelocityGradient=correctVelocityGradient,
evolveTotalEnergy = evolveTotalEnergy,
XSPH = XSPH,
densityUpdate=densityUpdate,
HUpdate = IdealH,
epsTensile = epsilonTensile,
nTensile = nTensile)
elif psph:
hydro = PSPH(dataBase = db,
W = WT,
Expand Down Expand Up @@ -302,49 +341,52 @@
ASPH = asph)
output("hydro")
output("hydro.kernel")
output("hydro.PiKernel")
output("hydro.cfl")
output("hydro.compatibleEnergyEvolution")
output("hydro.densityUpdate")
output("hydro.HEvolution")
if not (gsph or fsisph):
output("hydro.PiKernel")
if not fsisph:
output("hydro.densityUpdate")

packages = [hydro]

#-------------------------------------------------------------------------------
# Set the artificial viscosity parameters.
#-------------------------------------------------------------------------------
q = hydro.Q
if Cl:
q.Cl = Cl
if Cq:
q.Cq = Cq
if epsilon2:
q.epsilon2 = epsilon2
if Qlimiter:
q.limiter = Qlimiter
if balsaraCorrection:
q.balsaraShearCorrection = balsaraCorrection
output("q")
output("q.Cl")
output("q.Cq")
output("q.epsilon2")
output("q.limiter")
output("q.balsaraShearCorrection")
try:
output("q.linearInExpansion")
output("q.quadraticInExpansion")
except:
pass

#-------------------------------------------------------------------------------
# Construct the MMRV physics object.
#-------------------------------------------------------------------------------
if boolReduceViscosity:
evolveReducingViscosityMultiplier = MorrisMonaghanReducingViscosity(q,nhQ,nhL,aMin,aMax)
packages.append(evolveReducingViscosityMultiplier)
elif boolCullenViscosity:
evolveCullenViscosityMultiplier = CullenDehnenViscosity(q,WT,alphMax,alphMin,betaC,betaD,betaE,fKern,boolHopkinsCorrection)
packages.append(evolveCullenViscosityMultiplier)
if not gsph:
q = hydro.Q
if Cl:
q.Cl = Cl
if Cq:
q.Cq = Cq
if epsilon2:
q.epsilon2 = epsilon2
if Qlimiter:
q.limiter = Qlimiter
if balsaraCorrection:
q.balsaraShearCorrection = balsaraCorrection
output("q")
output("q.Cl")
output("q.Cq")
output("q.epsilon2")
output("q.limiter")
output("q.balsaraShearCorrection")
try:
output("q.linearInExpansion")
output("q.quadraticInExpansion")
except:
pass

#-------------------------------------------------------------------------------
# Construct the MMRV physics object.
#-------------------------------------------------------------------------------
if boolReduceViscosity:
evolveReducingViscosityMultiplier = MorrisMonaghanReducingViscosity(q,nhQ,nhL,aMin,aMax)
packages.append(evolveReducingViscosityMultiplier)
elif boolCullenViscosity:
evolveCullenViscosityMultiplier = CullenDehnenViscosity(q,WT,alphMax,alphMin,betaC,betaD,betaE,fKern,boolHopkinsCorrection)
packages.append(evolveCullenViscosityMultiplier)

#-------------------------------------------------------------------------------
# Create boundary conditions.
Expand Down
Loading

0 comments on commit bdffee2

Please sign in to comment.