Skip to content

Commit

Permalink
Minor cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhild1836 authored Dec 13, 2024
1 parent b39f252 commit 9a6d0af
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
8 changes: 4 additions & 4 deletions CardSharpTests/CardSharpApp_Bremms.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def bremmsModel(modelFolder, modelFilename, binSize=0.001): # 1 keV default
"""
Don't mix auto numbering with manual numbering, unless you know what you are
doing. Use separate ranges for manual and auto and manage the cellNumList
for the final Universe cell generation.
for the final world cell generation.
"""
cd = cs.CardDeck()
cd.setParticlesList(modeParticles)
Expand All @@ -78,7 +78,7 @@ def bremmsModel(modelFolder, modelFilename, binSize=0.001): # 1 keV default
# csmat.reloadMatsDict()
#===========MATERIALS END==============================

universeRadius = 70
worldRadius = 70
srcToOrigin = 5
detToOrigin = 40
#--------------------------------------------------
Expand Down Expand Up @@ -119,8 +119,8 @@ def bremmsModel(modelFolder, modelFilename, binSize=0.001): # 1 keV default
matName='W', density=0,
shift=(-0.5,0.5,-0.5), rotMatrix=None)

# universe-----------------------------------------------------------
sn, cellList = cd.insertWorldMacroAndCell(pos=(0,0,0), radius=universeRadius,
# World-----------------------------------------------------------
sn, cellList = cd.insertWorldMacroAndCell(pos=(0,0,0), radius=worldRadius,
worldMat='Void', worldDensity=0, worldSurfaceNum=worldSurfaceNum)

#===========GEOMETRY END==============================
Expand Down
18 changes: 10 additions & 8 deletions CardSharpTests/CardSharpApp_Imaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
# Local Windows MCNP path
mcnpCodePath="C:/MY_MCNP/MCNP_CODE/bin/"
mcnpDataPath="C:/MY_MCNP/MCNP_DATA/"
numTasks = 4
numTasks = 12
###############################################################################
def main():
""" """
Expand Down Expand Up @@ -138,11 +138,10 @@ def imagingApp(modelFolder, modelFilename):
# matName='Aluminum', density=0,
# shift=(0,0,0))

# universe-----------------------------------------------------------
#uniMacroNum, cellList = cd.insertWorldMacroAndCell(pos=(0,0,0), radius=150, uniMat='Void')
# World-----------------------------------------------------------
worldSurfaceNum, cellList = cd.insertWorldMacroAndCell(pos=(0,0,0), radius=150, worldMat='Void')

# srcString = cd.insertSource_PointIsotropicWithEnergyDistrib(pos=[-srcToOrigin,0,0], eList=[0, .2, .21], relFq=[0, .5, .5], distrib='Discrete')
# srcString = cd.insertSource_PointIsotropicWithEnergyDistrib(pos=[-srcToOrigin,0,0], eList=[0, .2, .21], relFq=[0, .5, .5], ergDistrib='Discrete')
# trNum = cd.insertTRString(shift=(0,0,0), rotMatrix=None)
srcString = cd.insertSource_SphereWithAngularAndEnergyDistrib(pos=[-srcToOrigin,0,0],
radius=.2, vec=[1,0,0], coneHalfAngleDeg=5,
Expand Down Expand Up @@ -267,12 +266,15 @@ def imagingAppUsingManualStrings(modelFolder, modelFilename):
#############################################################################
def doPlots(modelFolder, tallyFile):
""" """
t_or_d = 0 # total
totalTallyArray, totalRelerr = cstal.getRadiographyTallyFromMctal(modelFolder+tallyFile, tallyNumWtype=5, t_or_d=t_or_d)

t_or_d = 1 # direct
directTallyArray, directRelerr = cstal.getRadiographyTallyFromMctal(modelFolder+tallyFile, tallyNumWtype=5, t_or_d=t_or_d) # total
directTallyArray, directRelerr = cstal.getRadiographyTallyFromMctal(modelFolder+tallyFile, tallyNumWtype=5, t_or_d=t_or_d)

plt.imshow(directTallyArray)
plt.title('Direct')
plt.show()
plt.imshow(totalTallyArray); plt.title('Tally'); plt.show()
plt.imshow(totalRelerr); plt.title('RelErr'); plt.show()
print(np.max(totalRelerr))
#############################################################################
if __name__ == '__main__':
main()
2 changes: 1 addition & 1 deletion CardSharpTests/CardSharpGeometryTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def testGeomSNCN():
#cnTest = cd.insertCellString(name='Test', surfaceList=[-cs.SN('1.1'), -cs.SN('1.2'),-snCyl])
cnTest = cd.insertCellString(name='Test', surfaceList=[-snRpp.facets['Xmax'],
-snRpp.facets['Xmin'], -snCyl], cellNum='1')
# Universe macro number and all cells within are returned
# World macro number and all cells within are returned
worldMacroNum, cellList = cd.insertWorldMacroAndCell(pos=(0,0,0), radius=25, worldMat='Void')

cd.insertMaterialStrings(['Aluminum'])
Expand Down

0 comments on commit 9a6d0af

Please sign in to comment.