Corrections to Z naming and iteration model

This commit is contained in:
Jorge Gonzalez 2025-04-09 15:12:00 +02:00
commit af63194cb2
2 changed files with 22 additions and 24 deletions

View file

@ -29,6 +29,14 @@ module output
end subroutine setTimeFormat
function setZFormat(Z) result(ZString)
real(dp), intent(in):: Z
character(len=4):: ZString
write(ZString, '(F4.1)') Z
end function setZFormat
subroutine createPath()
character(8) :: date_now
character(10) :: time_now
@ -57,16 +65,13 @@ module output
character(:), allocatable:: filename
integer:: i, j
character(len=10):: timeString
character(len=10) :: ZString
character(len=4) :: ZString
do j = 1, nz
write (timeString, formatTime) t
write(ZString, '(F6.3)') Z_list(j)
ZString = adjustl(trim(ZString))
ZString = setZFormat(Z_list(j))
ZString = adjustl(ZString)
ZString = ZString(:index(ZString // '.', '.') - 1) // ZString(index(ZString, '.') + 1:)
filename = 'time_' // trim(timeString) // '_Z' // trim(ZString) // '_f_i.csv'
filename = 'time_' // trim(timeString) // '_Z_' // trim(adjustl(ZString)) // '_f_i.csv'
write (*, '(A, A)') 'Writing: ', filename
open(unit=dataF_id, file=pathOutput // filename)
@ -142,16 +147,13 @@ module output
integer:: i
integer:: j
character(len=10):: timeString
character(len=10) :: ZString
character(len=4) :: ZString
do j = 1, nz
write (timeString, formatTime) t
write(ZString, '(F6.3)') Z_list(j)
ZString = adjustl(trim(ZString))
ZString = setZFormat(Z_list(j))
ZString = adjustl(ZString)
ZString = ZString(:index(ZString // '.', '.') - 1) // ZString(index(ZString, '.') + 1:)
filename = 'time_' // trim(timeString) // '_Z' // trim(ZString) // '_mom_i.csv'
filename = 'time_' // trim(timeString) // '_Z_' // trim(adjustl(ZString)) // '_mom_i.csv'
write (*, '(A, A)') 'Writing: ', filename
open(unit=dataPhi_id, file=pathOutput//filename)
@ -275,17 +277,14 @@ module output
character(:), allocatable:: filename
integer:: i, j
character(len=10):: timeString
character(len=10) :: ZString
character(len=4) :: ZString
do j = 1, nz
write (timeString, formatTime) t
write(ZString, '(F6.3)') Z_list(j)
ZString = adjustl(trim(ZString))
ZString = setZFormat(Z_list(j))
ZString = adjustl(ZString)
ZString = ZString(:index(ZString // '.', '.') - 1) // ZString(index(ZString, '.') + 1:)
filename = 'time_' // trim(timeString) // '_Z' // trim(ZString) // '_fCum_i.csv'
filename = 'time_' // trim(timeString) // '_Z_' // trim(adjustl(ZString)) // '_fCum_i.csv'
write (*, '(A, A)') 'Writing: ', filename
open(unit=dataCum_id, file=pathOutput // filename)

View file

@ -129,7 +129,7 @@ program VlaPlEx
rCum_index = minloc(abs(r - rCum), 1)
v0 =-0.5e1_dp*c_s
vf = 1.0e1_dp*c_s
vf = 1.5e1_dp*c_s
dv = 2.0e-1_dp
nv = nint((vf - v0) / dv) + 1
dv = (vf - v0) / float(nv-1)
@ -146,8 +146,7 @@ program VlaPlEx
end if
t0 = 0.0_dp
tf = 2.0e-7_dp / t_ref
! tf = 1.0e1_dp * (rf - r0) / c_s
tf = 3.0e-7_dp / t_ref
dt = 5.0e-2_dp*dr/c_s
nt = nint((tf - t0) / dt)
dt = (tf - t0) / float(nt)
@ -268,9 +267,9 @@ program VlaPlEx
do while (Zave_bc - Zave_bc_old > 0.1_dp)
Zave_bc_old = Zave_bc
call TtoZne%get(Temp_bc, Zave_bc * n_bc, Zave_bc)
z_inj = minloc(abs(Z_list - Zave_bc),1)
Zave_bc = Z_list(z_inj)
end do
z_inj = minloc(abs(Z_list - Zave_bc),1)
Zave_bc = Z_list(z_inj)
u_bc = sqrt(Zave_bc * Temp_bc)
call writeOutputBoundary(t, dt, n_bc, u_bc, Temp_bc, Zave_bc)
@ -364,7 +363,7 @@ program VlaPlEx
! n_e = sum_ni(1) * exp((phi- phi0) / T_e) ! Isothermal (Boltzmann)
n_e = sum_ni(1) * (1.0_dp + (gamma_e - 1.0_dp)/gamma_e*(phi-phi0)/T_e)**gamma_e_exp !Polytropic
! Diagonal matrix for Newton integration scheme
! db_dphi = n_e / T_e ! Isotropic
! db_dphi = n_e / T_e ! Isothermal (Boltzmann)
db_dphi = sum_ni(1) / (gamma_e * T_e) * &
(1.0_dp + (gamma_e - 1.0_dp)/gamma_e*(phi-phi0)/T_e)**gamma_e_dexp !Polytropic