Skip to content

Commit

Permalink
modify them to output conductivity instead of the conductivity format…
Browse files Browse the repository at this point in the history
…ion factor
  • Loading branch information
yoshiya-usui committed Sep 11, 2024
1 parent 32d8343 commit fcf4ffb
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 20 deletions.
11 changes: 7 additions & 4 deletions Calc_kappa.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ def integrationSigmaX(k):
def f(k, ans):
return integrationSigmaX(k)/integrationSigmaZ(k) - ans

ans = 17.53667954
sigma_x = 0.0038610038610 # conductivty (S/m) along x-axis
sigma_z = 0.0002201673272 # conductivty (S/m) along z-axis
sigma_l = 21.0 # conductivity (S/m) of the coductive phase in cracks

ans = sigma_x / sigma_z
eps = 0.001
a = -10.0
b = 10.0
Expand All @@ -118,11 +122,10 @@ def f(k, ans):
else:
a = c
if abs(f(c, ans)) < eps:
fileName = 'kappa.txt'
fileName = 'kappa_phi.txt'
f = open(fileName, 'w')
f.write("kappa: " + str(c) + "\n")
f.write("factor X: " + str(integrationSigmaX(c)) + "\n")
f.write("factor Z: " + str(integrationSigmaZ(c)) + "\n")
f.write("crack volume fraction: " + str(sigma_z/integrationSigmaZ(c)/sigma_l) + "\n")
f.close()
break
n += 1
11 changes: 7 additions & 4 deletions CrackX.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,15 @@ def integration(k):
result += 0.5 * dTheta * (sum1 + sum2)
return result

fileName = 'crack_x.csv'
phi=0.01 #volume fraction (0 <= phi <= 1.0)
sigma_l = 1.0 # conductivity (S/m) of the coductive phase in cracks
fileName = 'crack_sigma_x.csv'
f = open(fileName, 'w')
f.write("kappa, sigma_x"+'\n')
list = (100.0, 50.0, 30.0, 20.0, 10.0, 5.0, 3.0, 2.0, 1.0, 0.0, -1.0, -2.0, -3.0, -5.0, -10.0, -20.0, -30.0, -50.0, -100.0)
for k in list:
result = integration(k)
s = str(k)+','+str(result)+'\n'
for kappa in list:
sigma_x = integration(kappa) * sigma_l * phi # conductivity (S/m)
s = str(kappa)+','+str(sigma_x)+'\n'
f.write(s)
f.flush()
f.close()
11 changes: 7 additions & 4 deletions CrackZ.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,15 @@ def integration(k):
result += 0.5 * dTheta * (sum1 + sum2)
return result

fileName = 'crack_z.csv'
phi=0.01 #volume fraction (0 <= phi <= 1.0)
sigma_l = 1.0 # conductivity (S/m) of the coductive phase in cracks
fileName = 'crack_sigma_z.csv'
f = open(fileName, 'w')
f.write("kappa, sigma_z"+'\n')
list = (100.0, 50.0, 30.0, 20.0, 10.0, 5.0, 3.0, 2.0, 1.0, 0.0, -1.0, -2.0, -3.0, -5.0, -10.0, -20.0, -30.0, -50.0, -100.0)
for k in list:
result = integration(k)
s = str(k)+','+str(result)+'\n'
for kappa in list:
sigma_z = integration(kappa) * sigma_l * phi # conductivity (S/m)
s = str(kappa)+','+str(sigma_z)+'\n'
f.write(s)
f.flush()
f.close()
11 changes: 7 additions & 4 deletions TubeX.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,15 @@ def integration(k):
result += 0.5 * dTheta * (sum1 + sum2)
return result

fileName = 'tube_x.csv'
phi=0.01 #volume fraction (0 <= phi <= 1.0)
sigma_l = 1.0 # conductivity (S/m) of the coductive phase in cracks
fileName = 'tube_sigma_x.csv'
f = open(fileName, 'w')
f.write("kappa, sigma_x"+'\n')
list = (100.0, 50.0, 30.0, 20.0, 10.0, 5.0, 3.0, 2.0, 1.0, 0.0, -1.0, -2.0, -3.0, -5.0, -10.0, -20.0, -30.0, -50.0, -100.0)
for k in list:
result = integration(k)
s = str(k)+','+str(result)+'\n'
for kappa in list:
sigma_x = integration(kappa) * sigma_l * phi # conductivity (S/m)
s = str(kappa)+','+str(sigma_x)+'\n'
f.write(s)
f.flush()
f.close()
11 changes: 7 additions & 4 deletions TubeZ.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,15 @@ def integration(k):
result += 0.5 * dTheta * (sum1 + sum2)
return result

fileName = 'tube_zx.csv'
phi=0.01 #volume fraction (0 <= phi <= 1.0)
sigma_l = 1.0 # conductivity (S/m) of the coductive phase in cracks
fileName = 'tube_sigma_z.csv'
f = open(fileName, 'w')
f.write("kappa, sigma_z"+'\n')
list = (100.0, 50.0, 30.0, 20.0, 10.0, 5.0, 3.0, 2.0, 1.0, 0.0, -1.0, -2.0, -3.0, -5.0, -10.0, -20.0, -30.0, -50.0, -100.0)
for k in list:
result = integration(k)
s = str(k)+','+str(result)+'\n'
for kappa in list:
sigma_z = integration(kappa) * sigma_l * phi # conductivity (S/m)
s = str(kappa)+','+str(sigma_z)+'\n'
f.write(s)
f.flush()
f.close()

0 comments on commit fcf4ffb

Please sign in to comment.