Skip to content

Commit

Permalink
Added csv output to input file and updated tests ( #122 )
Browse files Browse the repository at this point in the history
  • Loading branch information
chaibhave committed Apr 4, 2024
1 parent 2a44229 commit 99f783f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/tests/ver-1fa/comparison_ver-1fa.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
analytical_temp = Ts + Q*L**2 * (1- analytical_x**2/L**2) / (2*k)
ax.scatter(analytical_x,analytical_temp,label=r"Analytical",c='k', marker='^')

tmap_sol = pd.read_csv("./gold/u_vs_x.csv")
tmap_sol = pd.read_csv("./gold/ver-1fa_out_line_0011.csv")
tmap_x = tmap_sol['id']
tmap_temp = tmap_sol['temp']
ax.plot(tmap_x,tmap_temp,label=r"TMAP8",c='tab:gray')
Expand Down
File renamed without changes.
17 changes: 16 additions & 1 deletion test/tests/ver-1fa/tests
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
[Tests]
design = 'HeatConduction.md HeatConductionTimeDerivative.md HeatSource.md'
issues = '#12'
[heat_conduction_generation]
[ver-1fa]
type = Exodiff
input = ver-1fa.i
exodiff = ver-1fa_out.e
requirement = 'The system shall be able to model heat conduction in a slab that has heat generation'
verification = 'ver-1fa.md'
[]
[ver-1fa_lineplot]
type = CSVDiff
input = ver-1fa.i
should_execute = False # this test relies on the output files from ver-1fa, so it shouldn't be run twice
csvdiff = ver-1fa_out_line_0011.csv
requirement = 'The system shall be able to model heat conduction in a slab that has heat generation to generate CSV data for use in comparisons with the analytic solution for the profile concentration.'
prereq = ver-1fa
[]
[ver-1fa_comparison]
type = RunCommand
command = 'python3 comparison_ver-1fa.py'
requirement = 'The system shall be able to generate comparison plots between the analytical solution and simulated solution of verification case 1fa, to model heat conduction in a slab that has heat generation.'
prereq = ver-1fa
required_python_packages = 'matplotlib numpy pandas os git'
[]
[]
8 changes: 4 additions & 4 deletions test/tests/ver-1fa/ver-1fa.i
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = '-pc_type -ksp_grmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 101 preonly ilu 1'
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-10
l_tol = 1e-4
Expand All @@ -92,5 +92,5 @@
[Outputs]
execute_on = FINAL
exodus = true
csv = false
csv = true
[]

0 comments on commit 99f783f

Please sign in to comment.