Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/CRKSPH/CRKSPHHydros.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ def CRKSPH(dataBase,

# If we're using area-weighted RZ, we need to reflect from the axis
if GeometryRegistrar.coords() == CoordinateType.RZ:
result.zaxisBC = AxisBoundaryRZ(etaMinAxis)
result.appendBoundary(result.zaxisBC)
result.etaMinAxis = etaMinAxis

return result

Expand Down
8 changes: 2 additions & 6 deletions src/SPH/SPHHydros.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,14 @@ def SPH(W,
result.appendSubPackage(smoothingScaleMethod)

# In spherical coordatinates, preserve our locally constructed spherical kernels
# and add the origin enforcement boundary
if GeometryRegistrar.coords() == CoordinateType.Spherical:
result.originBC = SphericalOriginBoundary()
result.appendBoundary(result.originBC)
result._W3S1 = W
result._WPi3S1 = WPi
result._WGrad3S1 = WGrad

# If we're using area-weighted RZ, we need to reflect from the axis
# If we're using area-weighted RZ, store etaMinAxis
if GeometryRegistrar.coords() == CoordinateType.RZ:
result.zaxisBC = AxisBoundaryRZ(etaMinAxis)
result.appendBoundary(result.zaxisBC)
result.etaMinAxis = etaMinAxis

return result

Expand Down
21 changes: 21 additions & 0 deletions src/SimulationControl/SpheralController.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ def __init__(self, integrator,
self.vizGhosts = vizGhosts
self.vizDerivs = vizDerivs

# If this is in spherical or cylindrical coordinates, add axis boundary
self.insertAxisBoundary(integrator.physicsPackages())

# Organize the physics packages as appropriate
self.organizePhysicsPackages(self.kernel, volumeType, facetedBoundaries)

Expand Down Expand Up @@ -755,6 +758,24 @@ def organizePhysicsPackages(self, W, volumeType, facetedBoundaries):

return

#--------------------------------------------------------------------------
# Create an axis boundary if needed
#--------------------------------------------------------------------------
def insertAxisBoundary(self, physicsPackages):
if GeometryRegistrar.coords() == CoordinateType.Spherical:
self.axisBC = SphericalOriginBoundary()
elif GeometryRegistrar.coords() == CoordinateType.RZ:
etaMinAxis = 0.1
for package in physicsPackages:
etaMinAxis = getattr(package, "etaMinAxis", etaMinAxis)
self.axisBC = AxisBoundaryRZ(etaMinAxis)
else:
self.axisBC = None
if self.axisBC is not None:
for package in physicsPackages:
package.prependBoundary(self.axisBC)
return

#--------------------------------------------------------------------------
# If necessary create and add a distributed boundary condition to each
# physics package
Expand Down