Bonjour, je travaille sur le module conduction ionique avec l'équipe de Thierry Paillat à Poitiers. Je voudrais utiliser itrmas.f90 pour ajouter un fux de migration d'une espèce chargée au flux de masse rho*u (c'est à dire, pour impliciter le terme de migration)
Sur la version 2.0.2, pour le calcul sur les faces de bord (sans reconstruction), la routine faisait:
! FLUX DE MASSE SUR LES FACETTES DE BORD
do ifac = 1, nfabor
ii = ifabor(ifac)
pfac = inc*coefap(ifac) +coefbp(ifac)*pvar(ii)
flumab(ifac) = flumab(ifac) +viscb(ifac)*( pvar(ii) -pfac )
enddo
Sur la version 3.0.1 la routine fait:
! Mass flow though boundary faces
do ig = 1, ngrpb
!$omp parallel do private(ifac, ii, pfac) if(nfabor > thr_n_min)
do it = 1, nthrdb
do ifac = iomplb(1,ig,it), iomplb(2,ig,it)
ii = ifabor(ifac)
pfac = inc*cofafp(ifac) + cofbfp(ifac)*pvar(ii)
flumab(ifac) = flumab(ifac) + viscb(ifac)*pfac
enddo
enddo
enddo
Voici ma question, pourquoi sur la nouvelle version flumab est mis à jour avec "viscb(ifac)*pfac" au lieu de "viscb(ifac)*( pvar(ii) -pfac )"
Merci!
calcul fait dans itrmas.f90
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
-
- Posts: 4208
- Joined: Mon Feb 20, 2012 3:25 pm
Re: calcul fait dans itrmas.f90
Hello,
The change is due to the change in formulation of internal boundary condition formulation (split between gradient and diffusive flux BCs), which was one of the major changes between Code_Saturne 2.0 and 3.0.
The theory documentation is up to date, so checking the parts describing the internal boundary coefficient handling should help you (if you need such a level of detail).
Regards,
Yvan
The change is due to the change in formulation of internal boundary condition formulation (split between gradient and diffusive flux BCs), which was one of the major changes between Code_Saturne 2.0 and 3.0.
The theory documentation is up to date, so checking the parts describing the internal boundary coefficient handling should help you (if you need such a level of detail).
Regards,
Yvan
-
- Posts: 9
- Joined: Tue Aug 05, 2014 2:56 pm
Re: calcul fait dans itrmas.f90
Hello Yvan, I have read the theory documentation of the versions (1.3.1) and (3.3), condli and clptur. I see no difference between these two documentations.
I have compared condli.f and condli.f90 and I see that in the new version there are pointers to gradient boundary conditions 'iclu = iclrtp(iu, icoef)' and to flux boundary conditions 'icluf = iclrtp(iu, icoeff)'.
Do these different type of boundary conditions exist also for the scalars? More specifically for the particular physics scalars?
Can you tell me where can I find documentation regarding this aspect of the code?
Also, I was trying to modify covofi in order to implicit the migration term of the ionic conduction module. I had donne this in a pevious version of the code (1.3.1) but now I see that this part:
C TERME D'ACCUMULATION DE MASSE -(dRO/dt)*VOLUME
C
INIT = 1
CALL DIVMAS(NCELET,NCEL,NFAC,NFABOR,INIT,NFECRA,
& IFACEL,IFABOR,PROPFA(1,IFLMAS),PROPFB(1,IFLMAB),W1)
C
C Extrapolation ou non, le terme d'accumulation de masse va dans SMBRS
DO IEL = 1, NCEL
SMBRS(IEL) = SMBRS(IEL)
& + ICONV(IVAR)*W1(IEL)*RTPA(IEL,IVAR)
ENDDO
C
C Extrapolation ou non le terme d'accumulation de masse a la meme forme
C par coherence avec bilsc2
DO IEL = 1, NCEL
ROVSDT(IEL) = ROVSDT(IEL) - ICONV(IVAR)*W1(IEL)*THETV
ENDDO
C
is not performed anymore in covofi. I found that the mass divergence is added in bilsc2 :
fluxi = iconvp*(flui*pir + fluj*pjf - flumas(ifac)*pi) &
+ idiffp*viscf(ifac)*(pipr - pjp)
fluxj = iconvp*(flui*pif + fluj*pjr - flumas(ifac)*pj) &
+ idiffp*viscf(ifac)*(pip - pjpr)
smbrp(ii) = smbrp(ii) - fluxi
smbrp(jj) = smbrp(jj) + fluxj
but I could not find where is rovsdt modified??
Anyway, I think the theory guide is not up to date regarding covofi and bilsc2, am I right?
Thanks again
Martin
I have compared condli.f and condli.f90 and I see that in the new version there are pointers to gradient boundary conditions 'iclu = iclrtp(iu, icoef)' and to flux boundary conditions 'icluf = iclrtp(iu, icoeff)'.
Do these different type of boundary conditions exist also for the scalars? More specifically for the particular physics scalars?
Can you tell me where can I find documentation regarding this aspect of the code?
Also, I was trying to modify covofi in order to implicit the migration term of the ionic conduction module. I had donne this in a pevious version of the code (1.3.1) but now I see that this part:
C TERME D'ACCUMULATION DE MASSE -(dRO/dt)*VOLUME
C
INIT = 1
CALL DIVMAS(NCELET,NCEL,NFAC,NFABOR,INIT,NFECRA,
& IFACEL,IFABOR,PROPFA(1,IFLMAS),PROPFB(1,IFLMAB),W1)
C
C Extrapolation ou non, le terme d'accumulation de masse va dans SMBRS
DO IEL = 1, NCEL
SMBRS(IEL) = SMBRS(IEL)
& + ICONV(IVAR)*W1(IEL)*RTPA(IEL,IVAR)
ENDDO
C
C Extrapolation ou non le terme d'accumulation de masse a la meme forme
C par coherence avec bilsc2
DO IEL = 1, NCEL
ROVSDT(IEL) = ROVSDT(IEL) - ICONV(IVAR)*W1(IEL)*THETV
ENDDO
C
is not performed anymore in covofi. I found that the mass divergence is added in bilsc2 :
fluxi = iconvp*(flui*pir + fluj*pjf - flumas(ifac)*pi) &
+ idiffp*viscf(ifac)*(pipr - pjp)
fluxj = iconvp*(flui*pif + fluj*pjr - flumas(ifac)*pj) &
+ idiffp*viscf(ifac)*(pip - pjpr)
smbrp(ii) = smbrp(ii) - fluxi
smbrp(jj) = smbrp(jj) + fluxj
but I could not find where is rovsdt modified??
Anyway, I think the theory guide is not up to date regarding covofi and bilsc2, am I right?
Thanks again
Martin
-
- Posts: 4208
- Joined: Mon Feb 20, 2012 3:25 pm
Re: calcul fait dans itrmas.f90
Hello,
I may have answers to some of your questions, but not all.
The flux and gradient of boundary conditions exist for all variables (for a given field, search for calls of the form field_get_coef*). In addition to coefa/coefb (for gradient) and coefaf/coefbf (for flux), some fields also have coefac/coefbc (convection) and coefad/coefbd (used for the divergence operator for Rij).
If some parts of the user documentation do not seem up to date, check the newer parts (the Doxygen documentation) in version 3.3 (or on this website). Also, the "general" parts of the theory documentation are probably more up to data than the "subroutine by subroutine" parts (which are being replaced by the Doxygen documentation).
I'll try to see if others can complete this answer, within a week or two.
Regards,
Yvan
I may have answers to some of your questions, but not all.
The flux and gradient of boundary conditions exist for all variables (for a given field, search for calls of the form field_get_coef*). In addition to coefa/coefb (for gradient) and coefaf/coefbf (for flux), some fields also have coefac/coefbc (convection) and coefad/coefbd (used for the divergence operator for Rij).
If some parts of the user documentation do not seem up to date, check the newer parts (the Doxygen documentation) in version 3.3 (or on this website). Also, the "general" parts of the theory documentation are probably more up to data than the "subroutine by subroutine" parts (which are being replaced by the Doxygen documentation).
I'll try to see if others can complete this answer, within a week or two.
Regards,
Yvan
-
- Posts: 9
- Joined: Tue Aug 05, 2014 2:56 pm
Re: calcul fait dans itrmas.f90
Thanks Yvan, I'll keep on working and check on the forum from time to time so see if there is an update on the other questions.
Regards
Martín
Regards
Martín
-
- Posts: 45
- Joined: Sun Sep 08, 2013 8:50 pm
Re: calcul fait dans itrmas.f90
Hello,
Regarding your question about the mass accumulation term, the section of code you cite from the 1.3.1 version has been moved to other routines deeper in the calling tree.
To be more precised, the mass accumulation term is added directly to the diagonal part of the matrix in the C function cs_matrix_scalar (see file cs_matrix_building.c) and not anymore to rovsdt.
Then, as you had already figured out, the second part that was adding it up to the right hand side is now done in bilsc2.f90 (v3.0) or in function cs_convection_diffusion_scalar (file cs_convection_diffusion.c) (v3.3).
The first change is purely refactoring, whereas the second change partially implicits the mass accumulation term as it is now updated at each sweep of the fixed point algorithm (so called reconstruction sweeps) implemented in codits.f90.
Hope this helps clear things out.
Regards,
Erwan
Regarding your question about the mass accumulation term, the section of code you cite from the 1.3.1 version has been moved to other routines deeper in the calling tree.
To be more precised, the mass accumulation term is added directly to the diagonal part of the matrix in the C function cs_matrix_scalar (see file cs_matrix_building.c) and not anymore to rovsdt.
Then, as you had already figured out, the second part that was adding it up to the right hand side is now done in bilsc2.f90 (v3.0) or in function cs_convection_diffusion_scalar (file cs_convection_diffusion.c) (v3.3).
The first change is purely refactoring, whereas the second change partially implicits the mass accumulation term as it is now updated at each sweep of the fixed point algorithm (so called reconstruction sweeps) implemented in codits.f90.
Hope this helps clear things out.
Regards,
Erwan