Télécharger contactd_fmm.dgibi
* fichier : contactd_fmm.dgibi ********************************************************************* * * * Propagatrion d'une discontinuité de contact. * * * * Methode implicite sans matrice * * * * BECCANTINI A., SFME/LTMF, Fevrier 2003 * * * * Boundary conditions imposed on the border without using ghost * * cells. * * Boundary conditions correctly taken into account into the * * explicit part. * * They are not recomputed at each Jacobi iteration. * * Dual time step strategy. * * Automatic time step strategy * * BDF2 * * * * Juin 2006 : - changement des conditions aux limites pour NS * * (elle peuvent venir de la partie convective) * * - possibilité de utiliser SGS * * * ********************************************************************* ************************************************************************* ************************************************************************* * I) PROCEDURES ********************************************************* ************************************************************************* ************************************************************************* ************************************************************************* ******PROCEDURE PROCPT ************************************************** ************************************************************************* * * 'DEBPROC' PROCPT ; 'FINPROC' ; ************************************************************************* *********** PROCEDURE PNSSM : ******************** *********** SOLUTION OF THE NAVIER-STOKES EQUATIONS ******************** *********** FMM ******************** ************************************************************************* * * RVX . 'RESULTS' : table containing the results * * RVX . 'FREQI' : frequency of presenting the results * * RVX . 'MODEL' : model object * RVX . 'RN0' : density * RVX . 'GN0' : qdm * RVX . 'RET0' : total energy * * RVX . 'PGAS' : table containing the gas model * RVX . 'PGAS' . 'GAMN' : gamma * RVX . 'PGAS' . 'MU' : dynamic viscosity (kg/m^3 x m^2/s) * RVX . 'PGAS' . 'LAMBDA' : heat diffusion (W/K/m) * * * RVX . 'GRAVITY' : gravity * * RVX . 'LISTCONS' : name of the conservative variables * RVX . 'LISTPRIM' : name of the primitive variables * * RVX . 'LISTERR' : name of the error variables * * RVX . 'METHOD' : numerical scheme * RVX . 'CUTOFF' : cut off speed * * RVX . 'SPACEA' : space accuracy * RVX . 'LIMITER' : limiter type * RVX . 'TIMEA' : time accuracy * * RVX . 'T0' : initial time * RVX . 'TFINAL' : final time * RVX . 'DTPS' ('CFL') : time step or CFL number * * RVX . 'DCFL' : CFL number for dual time * * Error criteria for dual time loop: * RVX . 'NDTITER' : number of iterations * RVX . 'RELERR' : Logical (Relative error or absolute error) * RVX . 'EPSDT' : error at which dual time iterations are stopped * * RVX . 'NJAC' : Jacobi iterations * * RVX . 'PROLIM' : table called by the procedure PROLIM, * procedure to compute boundary conditions * * RVX . 'DIFTIMP' : boundary condition on temperature * RVX . 'DIFGTIMP' : boundary condition on gradient of temperature * RVX . 'MDIFCT' : mesh in which we impose the temperature * arising from the convective BC * RVX . 'DIFVIMP' : boundary condition on speed * RVX . 'DIFGVIMP' : boundary condition on gradient of speed * RVX . 'MDIFCV' : mesh in which we impose the velocity * arising from the convective BC * RVX . 'DIFTAUI' : boundary condition on constraint tensor * RVX . 'DIFQIMP' : boundary condition on heat flux * * 'DEBPROC' PNSSM ; 'ARGUMENT' RVX*TABLE ; * * 'SI' ('EXISTE' RVX 'RESULTS') ; 'MESS' 'Table RESULTS already exists' ; 'SINON' ; RVX . 'RESULTS' = 'TABLE' ; RVX . 'RESULTS' . 'TPS' = RVX . 'T0' ; RVX . 'RESULTS' . 'RN' = 'COPIER' (RVX . 'RN0') ; RVX . 'RESULTS' . 'GN' = 'COPIER' (RVX . 'GN0') ; RVX . 'RESULTS' . 'RET' = 'COPIER' (RVX . 'RET0') ; RVX . 'RESULTS' . 'NITER' = 0 ; 'FINSI' ; MDOMINT = RVX . 'MODEL' ; * ***** Physical properties * GAMN = RVX . 'PGAS' . 'GAMN' ; GAMSCA1 = 'MAXIMUM' GAMN ; GAMSCA2 = 'MINIMUM' GAMN ; 'SI' ('EGA' GAMSCA2 GAMSCA1 0.0001) ; GAMSCAL = GAMSCA1 ; 'SINON' ; 'MESSAGE' ; 'MESSAGE' 'Gamma is not constant' ; 'ERREUR' 21 ; 'FINSI' ; * MU = (RVX . 'PGAS' . 'MU') ; LAMBDA = (RVX . 'PGAS' . 'LAMBDA') ; R = (RVX . 'PGAS' . 'R') ; CV = R '/' (GAMSCAL '-' 1.) ; * LISTINCO = RVX . 'LISTCONS' ; LISTPRIM = RVX . 'LISTPRIM' ; LISTERR = RVX . 'LISTERR' ; * Names of the gradient of temperature * Names of the gradient of speed * * Upwind scheme * METO = RVX . 'METHOD' ; * Space accuracy (1 or 2) and limiter * Time accuracy (1 or 2) ORDESP = RVX . 'SPACEA' ; TYPELIM = RVX . 'LIMITER' ; ORDTPS = RVX . 'TIMEA' ; * Initial/final time * Deltat or CFL TPS = RVX . 'RESULTS' . 'TPS' ; TFINAL = RVX . 'TFINAL' ; 'SI' ('EXISTE' RVX 'DTPS') ; 'MESSAGE' 'DTPS or CFL ???' ; 'ERREUR' 21 ; 'FINSI' ; DTPS = RVX . 'DTPS' ; 'SINON' ; 'FINSI' ; * Dual time iterations NDT = RVX . 'NDTITER' ; * Relative error EPSDT = RVX . 'EPSDT' ; * Jacobi iterations * NJAC = RVX . 'NJAC' ; * Cut off speed ICO = RVX . 'CUTOFF' ; * To compute the diffusive cut-off USDELTAX = 'INVERSE' DELTAX ; * **** Conservative variables * * MOT1 = 'EXTRAIRE' LISTINCO 1 ; NOMMOM = 'EXTRAIRE' LISTINCO MOT2 = 'EXTRAIRE' LISTINCO 4 ; 'SINON' ; NOMMOM = 'EXTRAIRE' LISTINCO MOT2 = 'EXTRAIRE' LISTINCO 5 ; 'FINSI' ; * **** Primitive variables * TN0 = PN0 '/' (R '*' RN0) ; MOTRN = 'EXTRAIRE' LISTPRIM 1 ; MOTVN = 'EXTRAIRE' LISTPRIM MOTPN = 'EXTRAIRE' LISTPRIM 4 ; 'SINON' ; MOTVN = 'EXTRAIRE' LISTPRIM MOTPN = 'EXTRAIRE' LISTPRIM 5 ; 'FINSI' ; * ******************************************************************** **** Coeff to compute gradients for convective term (MCHSCA, MCHVEC) **** and for diffusive terms (MCHDIT, MCHVEC) ******************************************************************** * * Boundary conditions have to be taken into account * RCHLIM RESLIM = PROLIM (RVX . 'PROLIM') MDOMINT LISTINCO LISTPRIM RN0 VN0 PN0 GAMN ; MAILLIM = 'EXTRAIRE' RCHLIM 'MAILLAGE' ; * * If only wall conditions (Maillim is then empty) * 'SI' (MAILLIM 'EGA' 0) ; * Convective geometric coefficients GRADRN ALRN MCHSCA = 'PENT' MDOMINT 'CENTRE' 'EULESCAL' 'NOLIMITE' GRADVN ALVN MCHVEC = 'PENT' MDOMINT 'CENTRE' 'EULEVECT' 'NOLIMITE' NOMVEL GN0 'CLIM' (RVX . 'DIFVIMP') ; * Diffusive geometric coefficients LMGTEMP TN0 (RVX . 'DIFTIMP') (RVX . 'DIFGTIMP') ; VN0 (RVX . 'DIFVIMP') (RVX . 'DIFGVIMP') ; * * If other imposed Boudary conditions we create false Chpoints * 'SINON' ; * Convective false champoints 'NATU' 'DISCRET' ; VECTBC = 'MANUEL' 'CHPO' MAILLIM 2 'UX' 0.0 'UY' 0.0 'NATU' 'DISCRET' ; * Same name as NOMVEL 'SINON' ; VECTBC = 'MANUEL' 'CHPO' MAILLIM 3 'UX' 0.0 'UY' 0.0 'UZ' 0.0 'NATU' 'DISCRET' ; 'FINSI' ; VECTBC = VECTBC '+' (RVX . 'DIFVIMP') ; * Convective geometric coefficients GRADRN ALRN MCHSCA = 'PENT' MDOMINT 'CENTRE' 'EULESCAL' 'NOLIMITE' GRADVN ALVN MCHVEC = 'PENT' MDOMINT 'CENTRE' 'EULEVECT' 'NOLIMITE' NOMVEL VN0 'CLIM' VECTBC ; 'FINSI' ; * * Diffusive false champoints * * We have several possibility * We decide to impose the temperature given by the convective boundary * condition on (RVX . 'MDIFCT') and the velocity given by the * convective boundary condition on (RVX . 'MDIFCV') * * We check that (RVX . 'MDIFCT') belongs to MAILLIM * 'SI' (('NEG' NN1 0) 'ET' ('NEG' NN2 0)) ; * *** If both meshes contain at least one element NN1 is equal * to the number of elements belonging to the intersection. * Otherwise NN1 = 0 * 'FINSI' ; 'SI' ('NEG' NN1 NN2) ; 'MESSAGE' 'Problem in MDIFCT' ; 'ERREUR' 21 ; 'FINSI' ; 'NATU' 'DISCRET' ; SCALBC = SCALBC '+' (RVX . 'DIFTIMP') ; 'SI' (('NEG' NN1 0) 'ET' ('NEG' NN2 0)) ; 'FINSI' ; 'SI' ('NEG' NN1 NN2) ; 'MESSAGE' 'Problem in MDIFCV' ; 'ERREUR' 21 ; 'FINSI' ; 2 'UX' 0.0 'UY' 0.0 'NATU' 'DISCRET' ; 'SINON' ; 3 'UX' 0.0 'UY' 0.0 'UZ' 0.0 'NATU' 'DISCRET' ; 'FINSI' ; * VECTBC = VECTBC '+' (RVX . 'DIFVIMP') ; * * Diffusive geometric coefficients LMGTEMP TN0 SCALBC (RVX . 'DIFGTIMP') ; * VN0 VECTBC (RVX . 'DIFGVIMP') ; * *************************************************************** *** After each dual time loop, we could display * the evolution of the error in the dual time loop * the evolution of the dual time step (the safety factor) *************************************************************** * LISTLINF = RVX . 'RESULTS' . 'LISTLINF' ; LISTITDT = RVX . 'RESULTS' . 'LISTITDT' ; LISTITER = RVX . 'RESULTS' . 'LISTITER' ; * 'MESSAGE' ; 'MESSAGE' ('CHAINE' 'Methode = ' METO) ; 'MESSAGE' ; * 'TEMPS' 'ZERO' ; * ************************************************************************ ************************************************************************ **** Temporal loop ***************************************************** ************************************************************************ ************************************************************************ RN_N1M1 = 'COPIER' RN0 ; GN_N1M1 = 'COPIER' GN0 ; RET_N1M1 = 'COPIER' RET0 ; 'SI' (AA > 0) ; PTITER = 'EXTRAIRE' LISTITER AA ; 'SINON' ; PTITER = 0 ; 'FINSI' ; DUSDT = 0.0D0 ; 'REPETER' BLITER (RVX . 'NITER') ; PTITER = PTITER '+' 1 ; * **** Personal procedure * PROCPT RVX ; * * **** _N1M = (t^n,\tau^m) * _N1M1 = (t^n,\tau^{m+1}) * * ************************************************************************ ****** Loop on dual time*********************************************** ************************************************************************ * * *** DUSDT0 is the increment of DUSDT in the previous (physical) time * iteration. * DUSDT0 = DUSDT ; DUSDT = 0.0D0 ; 'REPETER' BLDT NDT ; RN_N1M = RN_N1M1 ; GN_N1M = GN_N1M1 ; RET_N1M = RET_N1M1 ; * **** Primitive variables * * *** Boundary conditions * RCHLIM RESLIM = PROLIM (RVX . 'PROLIM') MDOMINT LISTINCO LISTPRIM RN_N1M VN_N1M PN_N1M GAMN ; * ****** First/second order reconstruction * 'SI' (ORDESP 'EGA' 2) ; * 'SI' (NNLIM 'EGA' 0) ; RNLIM = CHPVID ; PNLIM = CHPVID ; VNLIM = RVX . 'DIFVIMP' ; 'SINON' ; '+' (RVX . 'DIFVIMP') ; 'FINSI' ; GRADRN ALRN0 = 'PENT' MDOMINT 'CENTRE' 'EULESCAL' TYPELIM 'CLIM' RNLIM 'GRADGEO' MCHSCA ; GRADPN ALPN0 = 'PENT' MDOMINT 'CENTRE' 'EULESCAL' TYPELIM 'CLIM' PNLIM 'GRADGEO' MCHSCA ; GRADVN ALVN0 = 'PENT' MDOMINT 'CENTRE' 'EULEVECT' TYPELIM 'CLIM' VNLIM 'GRADGEO' MCHVEC ; * 'SI' (&BLDT < NLCB) ; * ALRN0 = 'COPIER' ALRN ; * ALPN0 = 'COPIER' ALPN ; * ALVN0 = 'COPIER' ALVN ; * 'SINON' ; * 'SI' (&BLDT 'EGA' NLCB) ; * 'MESSAGE' ; * 'MESSAGE' 'On gele les limiteurs!!!' ; * 'MESSAGE' ; * 'FINSI' ; * 'FINSI' ; MDOMINT RN_N1M GRADRN ALRN0 VN_N1M GRADVN ALVN0 PN_N1M GRADPN ALPN0 GAMN ; 'SINON' ; MDOMINT RN_N1M VN_N1M PN_N1M GAMN ; 'FINSI' ; MDOMINT LISTINCO ROF VITF PF GAMF MAILLIM * ICO (MU '*' ('INVERSE' RN_N1M) '*' USDELTAX) ; ICO ICO ; RESIDU = RESIDU '+' RESLIM ; * **** La gravite * RN_N1M GN_N1M1 (RVX . 'GRAVITY') ; RESIDU = RESIDU '+' RESGRA ; * ************************************** **** Diffusive terms ***************** ************************************** * TN_N1M = PN_N1M '/' (R '*' RN_N1M) ; * * Computation of the CHPOINTS at the boundary of the domain * 'SI' (NN1 > 0) ; TNLIM = (PNLIM '/' (RNLIM '*' R) ) ; (RVX . 'DIFVIMP') ; (RVX . 'DIFTIMP') ; 'SINON' ; VNLIM = (RVX . 'DIFVIMP') ; TNLIM = (RVX . 'DIFVIMP') ; 'FINSI' ; * LMGTEMP TN_N1M TNLIM (RVX . 'DIFGTIMP') 'GRADGEO' MCHDIT ; * * 'LIST' (RVX . 'DIFGVIMP') ; LMGVIT VN_N1M VNLIM (RVX . 'DIFGVIMP') 'GRADGEO' MCHDIV ; * * NOMVEL = 'MOTS' 'UX' 'UY' ; * * MDOMINT MU LAMBDA CV RN_N1M VN_N1M TN_N1M GRADVN GRADTN LISTINCO 'VIMP' VNLIM 'TAUI' (RVX . 'DIFTAUI') 'QIMP' (RVX . 'DIFQIMP') ; RESIDU = RESIDU '+' RESIDI ; * ***** Spectral radious of the viscosity matrix * COEFV1 = (0.0 '*' RN_N1M) '+' 1.0 ; COEFV1 = COEFV1 '*' (lambda '*' (gamscal '-' 1.)) ; COEFV1 = COEFV1 '/' (R '*' RN_N1M) ; COEFV2 = (0.0 '*' RN_N1M) '+' ((4.0 '/' 3.0) '*' MU) ; COEFV2 = COEFV2 '/' RN_N1M ; COEFV = 0.5 '*' (COEFV1 '+' COEFV2) ; COEFV = COEFV '+' (0.5 '*' ((COEFV1 '-' COEFV2) 'ABS')) ; * 'MESSAGE' ; * 'MESSAGE' 'Je fais n importe' ; * COEFV = COEFV '*' 0.25 ; * ****** Residuum for dual tims stepping also involved the * variation of the conserved variables with respect * to time 'SI' ((&BLITER 'EGA' 1) 'OU' (ORDTPS 'EGA' 1)) ; RESIDU = RESIDU '-' DUSDT ; 'SINON' ; RESIDU = RESIDU '-' ((1.5 '*' DUSDT) '-' (0.5 '*' DUSDT0)) ; 'FINSI' ; * *** Time step at the first iteration/jacobi iteration * 'SI' (&BLDT 'EGA' 1) ; 'SINON' ; DTPS = RVX . 'DTPS' ; 'FINSI' ; TPS = TPS '+' DTPS ; * NJAC = 'ENTIER' ('MINIMUM' (RVX . 'NJACITER')) ; NJAC0 = NJAC ; 'SINON' ; (RVX . 'NJACLERR') (RVX . 'NJACITER') ; NJAC = 'ENTIER' NJAC ; NJAC0 = NJAC ; 'FINSI' ; * *** JACOBI * * **** CFL dual * 'SI' (&BLDT 'EGA' 1) ; SAFFACD = ('MINIMUM' (RVX . 'DCFL')) '*' 2 ; 'SINON' ; (RVX . 'DCFLERR') (RVX . 'DCFL')) '*' 2 ; 'FINSI' ; 'SI' ((&BLITER 'EGA' 1) 'OU' (ORDTPS 'EGA' 1)) ; * DUN IPRO = 'DETO' (RVX . 'TYPEJAC') LISTINCO MDOMINT RESIDU RN_N1M GN_N1M RET_N1M GAMN ICO DTPS SAFFACD NJAC 'CLIM' LISTPRIM RCHLIM COEFV ; 'SINON' ; * DUN IPRO = 'DETO' (RVX . 'TYPEJAC') LISTINCO MDOMINT RESIDU RN_N1M GN_N1M RET_N1M GAMN ICO (DTPS '/' 1.5) SAFFACD NJAC 'CLIM' LISTPRIM RCHLIM COEFV ; 'FINSI' ; * 'FINSI' ; 'SI' (IPRO 'NEG' 0) ; 'MESSAGE' ; 'MESSAGE' 'Probleme dans FMM' ; 'MESSAGE' ; 'ERREUR' 21 ; 'FINSI' ; * **** We compute DUSDT for the future loop * DUSDT = DUSDT '+' (DUN '/' DTPS) ; * **** We evaluate the conservative variables at t^{n+1}, \tau^{m+1} * RN_N1M1 = RN_N1M '+' DRN ; GN_N1M1 = GN_N1M '+' DGN ; RET_N1M1 = RET_N1M '+' DRET ; ERRINF = 'MAXIMUM' DUN 'ABS' LISTERR ; 'SI' ((&BLDT 'EGA' 1) 'OU' (((&BLDT '/' (RVX . 'FREQI')) '*' (RVX . 'FREQI')) 'EGA' &BLDT)) ; 'MESSAGE' ; 'MESSAGE' ('CHAINE' 'ITER =' PTITER ' TPS =' TPS ' DTITER =' &BLDT ' LINF =' ERRINF ' DCFL =' SAFFACD ' NJAC =' NJAC) ; 'MESSAGE' ; 'FINSI' ; * * *** Update of RVX . 'RESULTS' * RVX . 'RESULTS' . 'RN' = RN_N1M1 ; RVX . 'RESULTS' . 'GN' = GN_N1M1 ; RVX . 'RESULTS' . 'RET' = RET_N1M1 ; RVX . 'RESULTS' . 'LISTITDT' = LISTITDT ; RVX . 'RESULTS' . 'LISTITER' = LISTITER ; RVX . 'RESULTS' . 'LISTLINF' = LISTLINF ; * 'SI' (RVX . 'RELERR') ; * Relative error 'SI' (&BLDT 'EGA' 1) ; ERRINF0 = ERRINF ; 'SINON' ; 'SI' (ERRINF < (EPSDT '*' ERRINF0)) ; 'QUITTER' BLDT ; 'FINSI' ; 'FINSI' ; 'SINON' ; 'SI' (ERRINF < EPSDT) ; 'QUITTER' BLDT ; 'FINSI' ; 'FINSI' ; 'FIN' BLDT ; ************************************************************************ ****** End of the loop on dual time************************************* ************************************************************************ * *** Update of RVX . 'RESULTS' * RVX . 'RESULTS' . 'TPS' = TPS ; RVX . 'RESULTS' . 'NITER' = (RVX . 'RESULTS' . 'NITER') '+' 1 ; * 'SI' (TPS '>EG' TFINAL) ; 'QUITTER' BLITER ; 'FINSI' ; 'FIN' BLITER ; TCPU = 'TEMPS' 'NOEC' ; RVX . 'RESULTS' . 'TCPU' = TCPU ; 'FINPROC' ; ************************************************************************* ****** FIN PROCEDURE PNSSM ********************************************** ************************************************************************* ************************************************************************* ******PROCEDURE PROLIM ************************************************** ************************************************************************* * 'DEBPROC' PROLIM ; 'ARGUMENT' RVX*'TABLE' MDOMINT*'MMODEL' LISTINCO*'LISTMOTS' LISTPRIM*'LISTMOTS' RN*'CHPOINT' VN*'CHPOINT' PN*'CHPOINT' GAMN*'CHPOINT' ; * * Récupération du nombres de CL imposées * NCL = RVX . 'N' ; * * Initialisation de RESLIM et de RCHLIM * * * Boucle d'évaluation des résidus et des CHPOINTS aux limites * 'REPETER' BCLIM NCL ; MOTCLI = 'EXTRAIRE' (RVX . 'CLN' . &BCLIM) 1 ; MODELI = RVX . 'MODELN' . &BCLIM ; CHPOLI = RVX . 'CHPOLN' . &BCLIM ; MDOMINT MODELI LISTINCO LISTPRIM RN VN PN GAMN CHPOLI MOTCLI ; RCHLIM = RCHLIM '+' RCHLI ; RESLIM = RESLIM '+' RESLI ; 'FIN' BCLIM ; 'RESPRO' RCHLIM RESLIM ; 'FINPROC' ; ************************************************************************* ****** FIN PROCEDURE PROLIM ********************************************* ************************************************************************* ************************************************************************* ***** PROCEDURE POUR CALCULER LES VARIABLES CONSERVATIVES *************** ************************************************************************* 'DEBPROC' CONS ; 'ARGUMENT' RN*'CHPOINT' VN*'CHPOINT' PN*'CHPOINT' GAMN*'CHPOINT' ; RECIN = 0.5 '*' CELL ; REIN = PN '/' (GAMN '-' 1.0) ; RET = RECIN '+' REIN ; DETR CELL ; DETR RECIN ; DETR REIN ; 'RESPRO' RVN RET ; 'FINPROC' ; ************************************************************************* ************************************************************************* ****************** FIN PROCEDURES ************************************** ************************************************************************* ************************************************************************* ************************************************************************* ************************************************************************* ****************** MAILLAGE ******************************************** ************************************************************************* ************************************************************************* TYEL = 'QUA4' ; * GRAPH = VRAI ; GRAPH = FAUX ; * RAF = 1 ; L = 1. ; NX = 50 '*' RAF ; DX = L '/' NX ; * NY = 4 ; 'MESSAGE' ; 'MESSAGE' 'MODIF' ; 'MESSAGE' ; NY = 1 ; LIGM = (0.0 0.0) 'DROIT' NY (0.0 (NY '*' DX)) ; DOM1 = LIGG 'REGLER' NX LIGM ; DOM2 = LIGM 'REGLER' NX LIGD ; DOMINT = DOM1 'ET' DOM2 ; * **** Creation of MODELS * MDOMINT = 'MODELISER' DOMINT 'EULER' ; MDOM1 = 'MODELISER' DOM1 'EULER' ; MDOM2 = 'MODELISER' DOM2 'EULER' ; MLIGG = 'MODELISER' LIGG 'EULER' ; MLIGD = 'MODELISER' LIGD 'EULER' ; MCDOM = 'MODELISER' CDOM 'EULER' ; QDOMINT = TDOMINT . 'QUAF' ; QDOM1 = TDOM1 . 'QUAF' ; QDOM2 = TDOM2 . 'QUAF' ; QLIGD = TLIGD . 'QUAF' ; QLIGG = TLIGG . 'QUAF' ; QCDOM = TCDOM . 'QUAF' ; 'ELIMINATION' QDOMINT (1.0D-3 '/' RAF) QDOM1 ; 'ELIMINATION' QDOMINT (1.0D-3 '/' RAF) QDOM2 ; 'ELIMINATION' QDOMINT (1.0D-3 '/' RAF) QLIGG ; 'ELIMINATION' QDOMINT (1.0D-3 '/' RAF) QLIGD ; 'ELIMINATION' QDOMINT (1.0D-3 '/' RAF) QCDOM ; 'SI' GRAPH ; 'TRACER' DOMINT 'TITRE' 'FINSI' ; ************************************************************************* ************************************************************************* **************** FIN MAILLAGE ****************************************** ************************************************************************* ************************************************************************* ************************************************************************* ************************************************************************* **************** INITIAL CONDITIONS ************************************* ************************************************************************* ************************************************************************* * Noms des variables MOTRN = 'RN' ; MOTGNX = 'RUX' ; MOTGNY = 'RUY' ; MOTVNX = 'UX' ; MOTVNY = 'UY' ; MOTRET = 'RETN' ; MOTPN = 'PN' ; GAMAIR = 1.4 ; * ***** Left state * ROL = 1.4 ; PL = 1.0 ; UL = 0.01 ; HTL = ((GAMAIR '/' (GAMAIR '-' 1.0)) '*' (PL '/' ROL)) '+' (0.5 '*' UL '*' UL) ; SL = PL '/' (ROL '**' GAMAIR) ; * ***** Right state * ROR = 1.4 '/' 10. ; PR = PL ; UR = UL ; * *** Boundary Conditions * * * * Subsonic inlet. * We impose the total enthalpy and the entropy. * The velocity direction is supposed to be 90 degrees * * 'S' SL ; * * Subsonic outlet * We impose the pressure * * * Point where we directly compute the boundary conditions * * 'NATURE' 'DISCRET') '+' 'NATURE' 'DISCRET') ; 'UY' 0.0 'NATURE' 'DISCRET') 'ET' 'UY' 0.0 'NATURE' 'DISCRET') ; 'NATURE' 'DISCRET') 'ET' 'NATURE' 'DISCRET') ; 'NATURE' 'DISCRET' ; GN0 RET0 = CONS RN0 VN0 PN0 GAMN ; ERRO = 'MAXIMUM' (PN1 '-' PN0) 'ABS' ; 'SI' (ERRO > 1.0D-6) ; 'MESSAGE' 'Problem in the ic file!!!' 'ERREUR' 5 ; 'FINSI' ; * **** Plot of IC * * 'SI' (FAUX 'ET' GRAPH) ; 'SI' (GRAPH) ; CHM_MN = 'KCHA' MDOMINT 'CHAM' 'TRACER' CHM_RN MDOMINT 'TRACER' CHM_PN MDOMINT 'TRACER' CHM_VN MDOMINT 'TRACER' CHM_MN MDOMINT 'FINSI' ; ************************************************************************* ************************************************************************* **************** FIN INITIAL CONDITIONS ********************************* ************************************************************************* ************************************************************************* ************************************************************************* ************************************************************************* ************** COMPUTATION OF THE SOLUTION ****************************** ************************************************************************* ************************************************************************* RV = 'TABLE' ; RV . 'FREQI' = 1 ; RV . 'MODEL' = MDOMINT ; * **** Conservative variables / primitive variables * * * RV . 'RN0' = RN0 ; RV . 'GN0' = GN0 ; RV . 'RET0' = RET0 ; * **** Gas property/gravity * RV . 'PGAS' = 'TABLE' ; RV . 'PGAS' . 'GAMN' = GAMN ; RV . 'PGAS' . 'MU' = 0.0D0 ; RV . 'PGAS' . 'R' = 1.0D0 ; RV . 'PGAS' . 'LAMBDA' = 0.0D0 ; RV . 'GRAVITY' = (GRAVITE '*' 0.0) ; * * Table for BC (injection part) * RV . 'PROLIM' = 'TABLE' ; RV . 'PROLIM' . 'N' = 2 ; RV . 'PROLIM' . 'CLN' = 'TABLE' ; RV . 'PROLIM' . 'MODELN' = 'TABLE' ; RV . 'PROLIM' . 'MODELN' . 1 = MLIGG ; RV . 'PROLIM' . 'MODELN' . 2 = MLIGD ; RV . 'PROLIM' . 'CHPOLN' = 'TABLE' ; RV . 'PROLIM' . 'CHPOLN' . 1 = CHPINL ; RV . 'PROLIM' . 'CHPOLN' . 2 = CHPOUT ; * * Table for BC * * RVX . 'DIFTIMP' : boundary condition on temperature * RVX . 'MDIFCT' : mesh in which we impose the temperature * arising from the convective BC * RVX . 'DIFGTIMP' : boundary condition on gradient of temperature * RVX . 'DIFVIMP' : boundary condition on speed * RVX . 'MDIFCV' : mesh in which we impose the velocity * arising from the convective BC * RVX . 'DIFGVIMP' : boundary condition on gradient of speed * RVX . 'DIFTAUI' : boundary condition on constraint tensor * RVX . 'DIFQIMP' : boundary condition on heat flux * RV . 'DIFTIMP' = CHPVID ; 'P1DY' 0.0 ; 'UY' 0.0 ; RV . 'DIFVIMP' = CHPVID ; 'P1DY' 0.0 'P2DX' 0.0 'P2DY' 0.0 ; 'TXY' 0.0 'TYY' 0.0 ; * **** Numerical parameters * * * Variable to compute L2 error * * RV . 'LISTERR' = 'MOTS' MOTRET ; * * Upwind scheme * * RV . 'METHOD' = 'RUSANOLM' ; RV . 'METHOD' = 'AUSMPLM' ; * RV . 'METHOD' = 'HLLCLM' ; * * Low-Mach Cut off * CO = UL '*' 10.D-2 ; 'NATURE' 'DISCRET' ; * * Reconstruction/limiter * Time accuracy (1 or 2) * Iterations * Final time RV . 'SPACEA' = 2 ; * RV . 'LIMITER' = 'NOLIMITE' ; RV . 'LIMITER' = 'LIMITEUR' ; RV . 'TIMEA' = 2 ; * **** Physical time * RV . 'T0' = 0 ; * RV . 'CFL' = 20. ; RV . 'TFINAL' = L '/' (2 '*' UL) ; * RV . 'CFL' = 20. ; RV . 'DTPS' = 0.5 '*' (DX '/' UL) ; RV . 'NITER' = -1 ; * **** Dual time * * Safety factor for the dual time step * Max. Dual time iterations * Relative error * RV . 'NDTITER' = 100 ; RV . 'RELERR' = FAUX ; RV . 'EPSDT' = 1.0D-10 ; * **** Jacobi iterations * * RV . 'TYPEJAC' = 'PJACO' ; RV . 'TYPEJAC' = 'LJACOFB' ; * **** Parameters for PROCPT * RV . 'PROCPT' = 'TABLE' ; * PNSSM RV ; ************************************************************************* ************************************************************************* ************** FIN COMPUTATION OF THE SOLUTION ************************** ************************************************************************* ************************************************************************* ************************************************************************* ************************************************************************* ************** POST TREATMENT ******************************************* ************************************************************************* ************************************************************************* * RN = RV . 'RESULTS' . 'RN' ; GN = RV . 'RESULTS' . 'GN' ; RET = RV . 'RESULTS' . 'RET' ; GAMN = RV . 'PGAS' . 'GAMN' ; * *** Convergence evolution inside of each iteration * LISTITER = RV . 'RESULTS' . 'LISTITER' ; LISTITDT = RV . 'RESULTS' . 'LISTITDT' ; LISTLINF = RV . 'RESULTS' . 'LISTLINF' ; 'SI' GRAPH ; I1 = 1 ; 'REPETER' BLITER NITERE ; I0 = I1 ; I1 = 'EXTRAIRE' LISTITER &BLITER ; 'SI' (I1 'EGA' I0) ; 'SINON' ; ('LOG' 10.)) ; 'DESSIN' everr 'TITRE' ('CHAINE' 'Convergence at iter ' (I1 '-' 1)) 'NCLK' ; 'FINSI' ; 'FIN' BLITER ; ('LOG' 10.)) ; 'DESSIN' everr 'TITRE' ('CHAINE' 'Convergence at iter ' (I1)) 'NCLK' ; 'FINSI' ; * * **** The mesh * 'SI' GRAPH ; 'TRACER' DOMINT 'TITR' 'Maillage' ; 'FINSI' ; * **** Initial conditions * 'SI' GRAPH ; RN0 = RV . 'RN0' ; GN0 = RV . 'GN0' ; RET0 = RV . 'RET0' ; VN PN0 = 'PRIM' 'PERFMONO' RN0 GN0 RET0 GAMN 'TRICHE' ; 'FINSI' ; * **** The 2D graphics * CN2 = GAMN '*' (PN '/' RN) ; VN2 = 'PSCAL' VN VN NOMVEL NOMVEL ; MACHN2 = VN2 '/' CN2 ; MACHN = MACHN2 '**' 0.5 ; HTN = (GAMN '/' (GAMN '-' 1.0)) '*' (PN '/' RN) ; ECIN = 0.5 '*' ('PSCAL' VN VN NOMVEL NOMVEL) ; HTN = HTN '+' ECIN ; SN = PN '/' (RN '**' 1.4) ; TPS = RV . 'RESULTS' . 'TPS' ; TPS = 'MINIMUM' TPS ; 'FINSI' ; 'SI' GRAPH ; VECN = 'VECTEUR' VN (1. '/' RAF) 'UX' 'UY' 'JAUNE' ; ('CHAINE' 'v at t= ' TPS) ; 'TRACER' DOMINT RNV ('CONTOUR' DOMINT) 15 'TITRE' 'ro'; 'TRACER' DOMINT PNV ('CONTOUR' DOMINT) 15 'TITRE' 'p' ; 'FINSI' ; * **** Evolution objects * * * Position of the contact * TYPELIM = RV . 'LIMITER' ; POS = TPS '*' UL ; (RV . 'TIMEA') ', ' RV . 'METHOD' ; 'SI' VRAI ; TITOLO = 'CHAINE' TITOLO ', OE = 2, ' TYPELIM ; 'SINON' ; TITOLO = 'CHAINE' TITOLO ', OE = 1 ' ; 'FINSI' ; 'OPTION' 'ELEM' QUA4 ; 'ORDONNER' DCEN ; LIGEVOL = 'QUELCONQUE' DCEN 'SEG2' ; RNEX = (ROL * (('COORDONNEE' 1 (TDOMINT . 'CENTRE')) 'MASQUE' 'INFERIEUR' POS)) '+' (ROR * (('COORDONNEE' 1 (TDOMINT . 'CENTRE')) 'MASQUE' 'SUPERIEUR' POS)) ; 'SI' GRAPH ; 'DESSIN' (EVR 'ET' EVPOS 'ET' EVREX) 'MIMA' 'TITRE' TITOLO 'GRILL' 'YBOR' 0.0 1.6 ; 'DESSIN' (EVP 'ET' EVPOS) 'MIMA' 'TITRE' TITOLO 'GRILL' ; 'DESSIN' (EVH 'ET' EVPOS) 'MIMA' 'TITRE' ('CHAINE' TITOLO ', hl =' HTL) 'GRILL' ; 'DESSIN' (EVS 'ET' EVPOS) 'MIMA' 'TITRE' ('CHAINE' TITOLO ', sl =' SL) 'GRILL' ; 'FINSI' ; * **** Test de convergence * 'SI' (AA > 1.0D-8) ; 'FINSI' ; ERRO = 'ABS' (RN '-' RNEX) ; 'SI' (ERRO > 1.0D-1) ; 'FINSI' ; 'FIN' ;
© Cast3M 2003 - Tous droits réservés.
Mentions légales