Skip to content
Snippets Groups Projects
Commit bb05b796 authored by Jan Habscheid's avatar Jan Habscheid
Browse files

add coverage + skip main functions for coverage

parent b9cae728
No related branches found
No related tags found
1 merge request!9Added Coverage
Pipeline #1611833 failed
This commit is part of merge request !9. Comments created here will be created in the context of that merge request.
.coverage 0 → 100644
File added
This diff is collapsed.
......@@ -337,7 +337,7 @@ def ElectrolyticDiode(Bias_type:str, phi_bias:float, g_phi:float, z_A:float, z_C
else:
raise ValueError('Invalid return_type')
if __name__ == '__main__':
if __name__ == '__main__': # pragma: no cover # dont cover main in coverage
phi_bias = 10#10
Bias_type = 'ForwardBias' # 'ForwardBias', 'NoBias', 'BackwardBias'
g_phi = 350#5
......
......@@ -242,47 +242,47 @@ def solve_System_2eq(phi_left:float, phi_right:float, p_right:float, z_A:float,
return y_A_vals, y_C_vals, phi_vals, p_vals, x_vals
if __name__ == '__main__':
# Define the parameters
phi_left = 5.0
phi_right = 0.0
p_right = 0.0
y_A_R = 1/3
y_C_R = 1/3
z_A = -1.0
z_C = 1.0
K = 'incompressible'
Lambda2 = 8.553e-6
a2 = 7.5412e-4
number_cells = 1024
relax_param = .1
rtol = 1e-4
max_iter = 500
# if __name__ == '__main__':
# # Define the parameters
# phi_left = 5.0
# phi_right = 0.0
# p_right = 0.0
# y_A_R = 1/3
# y_C_R = 1/3
# z_A = -1.0
# z_C = 1.0
# K = 'incompressible'
# Lambda2 = 8.553e-6
# a2 = 7.5412e-4
# number_cells = 1024
# relax_param = .1
# rtol = 1e-4
# max_iter = 500
# Solve the system
y_A, y_C, phi, p, x = solve_System_2eq(phi_left, phi_right, p_right, z_A, z_C, y_A_R, y_C_R, K, Lambda2, a2, number_cells, relax_param=relax_param, x0=0, x1=1, refinement_style='uniform', return_type='Vector', max_iter=max_iter, rtol=rtol)
# # Solve the system
# y_A, y_C, phi, p, x = solve_System_2eq(phi_left, phi_right, p_right, z_A, z_C, y_A_R, y_C_R, K, Lambda2, a2, number_cells, relax_param=relax_param, x0=0, x1=1, refinement_style='uniform', return_type='Vector', max_iter=max_iter, rtol=rtol)
# Plot the solution
plt.plot(x, phi)
plt.xlim(0,0.05)
plt.grid()
plt.xlabel('x [-]')
plt.ylabel('$\\varphi$ [-]')
plt.show()
# # Plot the solution
# plt.plot(x, phi)
# plt.xlim(0,0.05)
# plt.grid()
# plt.xlabel('x [-]')
# plt.ylabel('$\\varphi$ [-]')
# plt.show()
plt.plot(x, y_A, '--', color='tab:blue', label='$y_A$')
plt.plot(x, y_C, '-', color='tab:blue', label='$y_C$')
plt.plot(x, 1 - y_A - y_C, ':', color='tab:blue', label='$y_S$')
plt.xlim(0,0.05)
plt.legend()
plt.grid()
plt.xlabel('x [-]')
plt.ylabel('$y_\\alpha$ [-]')
plt.show()
# plt.plot(x, y_A, '--', color='tab:blue', label='$y_A$')
# plt.plot(x, y_C, '-', color='tab:blue', label='$y_C$')
# plt.plot(x, 1 - y_A - y_C, ':', color='tab:blue', label='$y_S$')
# plt.xlim(0,0.05)
# plt.legend()
# plt.grid()
# plt.xlabel('x [-]')
# plt.ylabel('$y_\\alpha$ [-]')
# plt.show()
plt.plot(x, p)
plt.xlim(0,0.05)
plt.grid()
plt.xlabel('x [-]')
plt.ylabel('$p$ [-]')
plt.show()
# plt.plot(x, p)
# plt.xlim(0,0.05)
# plt.grid()
# plt.xlabel('x [-]')
# plt.ylabel('$p$ [-]')
# plt.show()
......@@ -274,7 +274,7 @@ def solve_System_4eq(phi_left:float, phi_right:float, p_right:float, z_A:float,
return y_A, y_C, phi, p, msh
if __name__ == '__main__':
if __name__ == '__main__': # pragma: no cover # dont cover main in coverage
# Define the parameters
phi_left = 10.0
phi_right = 0.0
......
......@@ -238,7 +238,7 @@ def solve_System_Neq(phi_left:float, phi_right:float, p_right:float, z_alpha:lis
return y, phi, p, x
if __name__ == '__main__':
if __name__ == '__main__': # pragma: no cover # dont cover main in coverage
# Define the parameters
phi_left = 8.0
phi_right = 0.0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment