I'm struggling to get my head around the coding of the Elder turbulence model. I can understand most of the FORTRAN coding I've looked at in the TELEMAC sources so I'm sure I'm missing something obvious and would appreciate if someone could help explain it to me.
In disper.f
00094 !-----------------------------------------------------------------------
00095 ! COMPUTES DISPERSION COEFFICIENTS
00096 !-----------------------------------------------------------------------
00097 !
00098 NPOIN = VISC%DIM1
00099 NPX = VISC%MAXDIM1
00100 !
00101 DO I=1,NPOIN
00102 !
00103 NORMV = MAX(SQRT(U(I)**2+V(I)**2),1.D-6)
00104 COST = U(I)/NORMV
00105 SINT = V(I)/NORMV
00106 USTAR = SQRT( 0.5D0 * CF(I) * ( U(I)**2 + V(I)**2 ) )
00107 KL = ELDER(1) * USTAR * H(I)
00108 KT = ELDER(2) * USTAR * H(I) ! I understand up to here
00109 VISC%R(I ) = PROPNU + ( KL - KT ) * COST**2 + KT
00110 VISC%R(I+NPX ) = PROPNU + ( KT - KL ) * COST**2 + KL
00111 VISC%R(I+2*NPX) = PROPNU + ( KL - KT ) * COST*SINT
00112 !
00113 ENDDO ! I
I don't understand what values are contained in NPX. MAXDIM1 returns the maximum size per dimension so does this contain 2 values as VISC(NPOIN,3), 1st col - x dim, 2nd col y dim, 3rd col z dim?
00071 !| VISC |<--| COEFFICIENTS OF DISPERSION TENSOR VISC(NPOIN,3)
Following on from this, which locations do VISC%R(I+NPX ) and VISC%R(I+2*NPX) refer to if there are only NPOIN rows and I is being looped from 1:NPOIN? At a guess, do +NPX and +2*NPX assign a value to the Ith row of the 2nd and 3rd column of VISC respectively?
Thanks
Jon