I was tired of going to input to see the calculation of reference parameters
This commit is contained in:
parent
95f4b55196
commit
43592f420c
2 changed files with 34 additions and 22 deletions
|
|
@ -5,5 +5,34 @@ MODULE moduleRefParam
|
|||
!Reference parameters for non-dimensional problem
|
||||
REAL(8):: L_ref, v_ref, ti_ref, Vol_ref, EF_ref, Volt_ref, B_ref
|
||||
|
||||
contains
|
||||
subroutine calculateDerivedRef()
|
||||
use moduleConstParam, only: pi, qe, eps_0, kb
|
||||
implicit none
|
||||
|
||||
!Derived parameters
|
||||
L_ref = DSQRT(kb*T_ref*eps_0/n_ref)/qe !reference length
|
||||
v_ref = DSQRT(kb*T_ref/m_ref) !reference velocity
|
||||
ti_ref = L_ref/v_ref !reference time
|
||||
Vol_ref = L_ref**3 !reference volume
|
||||
EF_ref = qe*n_ref*L_ref/eps_0 !reference electric field
|
||||
Volt_ref = EF_ref*L_ref !reference voltage
|
||||
B_ref = m_ref / (ti_ref * qe) !reference magnetic field
|
||||
|
||||
if (sigmaVrel_ref == 0.0d0) then
|
||||
! No reference cross section provided, check radius
|
||||
if (r_ref == 0.0d0) then
|
||||
! No reference radius provided, use reference length
|
||||
sigmaVrel_ref = L_ref**2 * v_ref
|
||||
|
||||
else
|
||||
sigmaVrel_ref = pi*(r_ref+r_ref)**2*v_ref !reference cross section times velocity
|
||||
|
||||
end if
|
||||
|
||||
end if
|
||||
|
||||
end subroutine calculateDerivedRef
|
||||
|
||||
END MODULE moduleRefParam
|
||||
|
||||
|
|
|
|||
|
|
@ -111,7 +111,6 @@ MODULE moduleInput
|
|||
!Reads the reference parameters
|
||||
SUBROUTINE readReference(config)
|
||||
USE moduleRefParam
|
||||
USE moduleConstParam
|
||||
USE moduleErrors
|
||||
USE json_module
|
||||
IMPLICIT NONE
|
||||
|
|
@ -131,30 +130,14 @@ MODULE moduleInput
|
|||
CALL config%get(object // '.temperature', T_ref, found)
|
||||
IF (.NOT. found) CALL criticalError('Reference temperature not found','readReference')
|
||||
|
||||
!Derived parameters
|
||||
L_ref = DSQRT(kb*T_ref*eps_0/n_ref)/qe !reference length
|
||||
v_ref = DSQRT(kb*T_ref/m_ref) !reference velocity
|
||||
ti_ref = L_ref/v_ref !reference time
|
||||
Vol_ref = L_ref**3 !reference volume
|
||||
EF_ref = qe*n_ref*L_ref/eps_0 !reference electric field
|
||||
Volt_ref = EF_ref*L_ref !reference voltage
|
||||
B_ref = m_ref / (ti_ref * qe) !reference magnetic field
|
||||
! initialize values for cross sections
|
||||
sigmaVrel_ref = 0.0d0
|
||||
r_ref = 0.0d0
|
||||
|
||||
!If a reference cross section is given, it is used
|
||||
CALL config%get(object // '.sigmaVrel', sigmavRel_ref, found)
|
||||
|
||||
!If not, the reference radius is searched
|
||||
IF (.NOT. found) THEN
|
||||
CALL config%get(object // '.radius', r_ref, found)
|
||||
IF (found) THEN
|
||||
sigmaVrel_ref = PI*(r_ref+r_ref)**2*v_ref !reference cross section times velocity
|
||||
|
||||
ELSE
|
||||
sigmaVrel_ref = L_ref**2 * v_ref
|
||||
|
||||
END IF
|
||||
|
||||
END IF
|
||||
call calculateDerivedRef()
|
||||
|
||||
END SUBROUTINE readReference
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue