Add TtoZ functionality and compare with input Zave

This commit is contained in:
JHendrikx 2025-02-03 16:08:23 +01:00
commit ef5c94f114

View file

@ -1,33 +1,33 @@
! module eos module eos
! use constantParameters, only: dp use constantParameters, only: dp
! implicit none implicit none
!
! private private
! public:: T_to_Z public:: T_to_Z
!
! contains contains
! pure function T_to_Z(T) result(Z) pure function T_to_Z(T) result(Z)
! use constantParameters, only: eV_to_K use constantParameters, only: eV_to_K
! use referenceValues, only: Temp_ref use referenceValues, only: Temp_ref
! implicit none implicit none
!
! real(dp), intent(in):: T real(dp), intent(in):: T
! real(dp):: Z real(dp):: Z
!
! ! Z = (Temp_ref * T / eV_to_K)**0.6 Z = 22.5 * (Temp_ref * T / eV_to_K /100.0)**0.6
! ! Z = max(Z, 1.0_dp) ! Z = max(Z, 1.0_dp)
! ! Z = min(Z, 22.0_dp) ! Z = min(Z, 22.0_dp)
!Z = 12.0_dp !Z = 12.0_dp
!
! end function T_to_Z end function T_to_Z
!
! end module eos end module eos
program VlaPlEx program VlaPlEx
use constantParameters, only: dp, kb, qe, eps_0, ev_to_K, cm3_to_m3, PI use constantParameters, only: dp, kb, qe, eps_0, ev_to_K, cm3_to_m3, PI
use output use output
use referenceValues use referenceValues
! use eos, only: T_to_Z use eos, only: T_to_Z
use moduleTableBC use moduleTableBC
use omp_lib use omp_lib
implicit none implicit none
@ -96,7 +96,7 @@ program VlaPlEx
! Set input parameters (remember these have to be in non-dimensional units) ! Set input parameters (remember these have to be in non-dimensional units)
c_s = sqrt(11.0_dp * gamma_i * 1.0_dp) c_s = sqrt(11.0_dp * gamma_i * 1.0_dp)
bc_file = 'bc.csv' bc_file = 'bc_80ns_T60Z16.csv'
call boundaryConditions%init(bc_file) call boundaryConditions%init(bc_file)
! Set domain boundaries (non-dimensional units) ! Set domain boundaries (non-dimensional units)
@ -105,6 +105,7 @@ program VlaPlEx
dr = 1.0e-6_dp / L_ref dr = 1.0e-6_dp / L_ref
nr = nint((rf - r0) / dr) + 1 nr = nint((rf - r0) / dr) + 1
dr = (rf - r0) / float(nr-1) dr = (rf - r0) / float(nr-1)
print *, '#R gridpoints: ', nr
allocate(r(1:nr)) allocate(r(1:nr))
do i = 1, nr do i = 1, nr
r(i) = dr * float(i-1) + r0 r(i) = dr * float(i-1) + r0
@ -121,6 +122,7 @@ program VlaPlEx
dv = 1.0e-1_dp dv = 1.0e-1_dp
nv = nint((vf - v0) / dv) + 1 nv = nint((vf - v0) / dv) + 1
dv = (vf - v0) / float(nv-1) dv = (vf - v0) / float(nv-1)
print *, '#V gridpoints: ', nv
allocate(v(1:nv)) allocate(v(1:nv))
do j = 1, nv do j = 1, nv
v(j) = dv * float(j-1) + v0 v(j) = dv * float(j-1) + v0
@ -135,9 +137,10 @@ program VlaPlEx
t0 = 0.0_dp t0 = 0.0_dp
tf = 2.0e-7_dp / t_ref tf = 2.0e-7_dp / t_ref
! tf = 1.0e1_dp * (rf - r0) / c_s ! tf = 1.0e1_dp * (rf - r0) / c_s
dt = 1.0e-2_dp*dr/c_s dt = 7.0e2_dp*dr/c_s
nt = nint((tf - t0) / dt) nt = nint((tf - t0) / dt)
dt = (tf - t0) / float(nt) dt = (tf - t0) / float(nt)
print *, '#timesteps: ', nt
everyOutput = nint(1.0e-9_dp/t_ref/dt) everyOutput = nint(1.0e-9_dp/t_ref/dt)
if (everyOutput == 0) then if (everyOutput == 0) then
@ -236,6 +239,12 @@ program VlaPlEx
f0(j0:nv) = 1.0_dp / sqrt(PI*Temp_bc) * exp(-(v(j0:nv) - u_bc)**2 / Temp_bc) f0(j0:nv) = 1.0_dp / sqrt(PI*Temp_bc) * exp(-(v(j0:nv) - u_bc)**2 / Temp_bc)
f0 = f0 * n_bc / (sum(f0)*dv) f0 = f0 * n_bc / (sum(f0)*dv)
T_e = Temp_bc T_e = Temp_bc
print *, 'Time: ', time * t_ref
print *, 'Temp_bc: ', Temp_bc
print *, 'Zave_bc: ', Zave_bc
print *, 'TtoZ: ', T_to_Z(Temp_bc)
print *, '-------------------------'
! Boundary conditions ! Boundary conditions
! r = r0, v>0 ! r = r0, v>0