Skip to content

Commit a251fa2

Browse files
committed
adding von Mises stress routine + post_process to output
1 parent 7570818 commit a251fa2

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/common/m_variables_conversion.fpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,14 @@ contains
10321032
qK_prim_vf(i)%sf(j, k, l) = qK_cons_vf(i)%sf(j, k, l)/rho_K
10331033
end do
10341034
end if
1035+
#ifndef POST_PROCESS
1036+
! to save von Mises stress instead of elastic internal energy
1037+
qK_prim_vf(xiend+1)%sf(j, k, l) = sqrt((3/2)*qK_prim_vf(1)%sf(j, k, l)**2 + &
1038+
2*qK_prim_vf(2)%sf(j, k, l)**2 + qK_prim_vf(3)%sf(j, k, l)**2 + &
1039+
2*qK_prim_vf(4)%sf(j, k, l)**2 + 2*qK_prim_vf(5)%sf(j, k, l)**2 + &
1040+
qK_prim_vf(6)%sf(j, k, l)**2)
1041+
#endif
1042+
end if
10351043

10361044
!$acc loop seq
10371045
do i = advxb, advxe

src/post_process/m_start_up.f90

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,11 @@ subroutine s_save_data(t_step, varname, pres, c, H)
385385
write (varname, '(A,I0)') 'xi', i
386386
call s_write_variable_to_formatted_database_file(varname, t_step)
387387
end if
388+
if (prim_vars_wrt) then
389+
q_sf = q_prim_vf(xiend+1)%sf(j, k, l)
390+
write (varname, '(A,I0)') 'vonMises'
391+
call s_write_variable_to_formatted_database_file(varname, t_step)
392+
end if
388393
varname(:) = ' '
389394
end do
390395
end if

0 commit comments

Comments
 (0)