* fichier : burgers1d-2.dgibi ************************************************************************ * Section : Fluides Transitoire * Section : Fluides Convection ************************************************************************ * NOM : BURGERS1D-2.DGIBI * DESCRIPTION : Exemple équation de Burgers 1D * 1D Burgers equation * * Similar to burgers1d.dgibi but more complex: * + interactive GUI (interact = vrai) * + slide generation for the lecture notes (transp = vrai) * * * See: * ENSTA Lecture Notes 2021 * Introduction to the finite element method applied to * incompressible fluid mechanics (in english) * Introduction a la methode des elements finis en * mecanique des fluides incompressibles (en francais) * Stephane GOUNAND and Sergey KUDRIAKOV * http://www-cast3m.cea.fr/index.php?xml=supportcours * * * * LANGAGE : GIBIANE-CAST3M * AUTEUR : Stéphane GOUNAND (CEA/DEN/DM2S/SFME/LTMF) * mél : gounand@semt2.smts.cea.fr ********************************************************************** * VERSION : v1, 25/09/2007, version initiale * HISTORIQUE : v1, 25/09/2007, création ************************************************************************ * 'OPTION' 'DIME' 2 'ELEM' 'QUA8' ; interact = FAUX ; graph = FAUX ; transp = VRAI ; * 'DEBPROC' MAJUN ; 'ARGUMENT' rvx*'TABLE' ; rv = rvx . 'EQEX' ; cn = rv . 'INCO' . 'CN' ; * cn = 'ELNO' $mt ('NOEL' $mt cn) ; un = '+' ('NOMC' 'UX' cn) ('NOMC' 'UY' ('*' cn 0.)) ; rv . 'INCO' . 'UN' = 'KCHT' $mt 'VECT' 'SOMMET' un ; matvid chvid = 'KOPS' 'MATRIK' ; 'RESPRO' matvid chvid ; 'FINPROC' ; * 'DEBPROC' CALCUL ; 'ARGUMENT' icini*'ENTIER' ; 'ARGUMENT' idecent*'ENTIER' ; 'ARGUMENT' lnclk/'LOGIQUE' ; * 'SI' ('NON' ('EXISTE' lnclk)) ; lnclk = FAUX ; 'FINSI' ; * nmail = 10 ; cfl = 0.5 ; dt = '/' cfl nmail ; tfinal = 2. ; nitma = 'ENTIER' ('/' tfinal dt) ; * 'SI' ('EGA' idecent 1) ; typdec = 'CENTREE' ; niter = 5 ; difart = '/' ('/' 1. ('FLOTTANT' nmail)) 2.D5 ; 'FINSI' ; 'SI' ('EGA' idecent 2) ; typdec = 'SUPG' ; niter = 5 ; difart = 0. ; 'FINSI' ; 'SI' ('EGA' idecent 3) ; typdec = 'SUPGDC' ; niter = 5 ; difart = 0. ; 'FINSI' ; omeg = 0.7 ; * * Maillage (Mesh) * pA = -1. 0. ; pB = 0. 0. ; pC = 1. 0. ; pD = 3. 0. ; lt1 = 'DROIT' nmail pA pB ; lt2 = 'DROIT' nmail pB pC ; lt3 = 'DROIT' nmail pC pD ; lt = lt1 'ET' lt2 'ET' lt3 ; bas = lt ; mt = 'TRANSLATION' lt 1 (0. 1.) ; gau = 'COTE' 4 mt ; dro = 'COTE' 2 mt ; _bas = 'CHANGER' bas 'QUAF' ; _gau = 'CHANGER' gau 'QUAF' ; _dro = 'CHANGER' dro 'QUAF' ; _mt = 'CHANGER' mt 'QUAF' ; 'ELIMINATION' (_mt 'ET' _bas 'ET' _gau 'ET' _dro) 1.D-6 ; $mt = 'MODE' _mt 'NAVIER_STOKES' 'LINE' ; $bas = 'MODE' _bas 'NAVIER_STOKES' 'LINE' ; $gau = 'MODE' _gau 'NAVIER_STOKES' 'LINE' ; $dro = 'MODE' _dro 'NAVIER_STOKES' 'LINE' ; mt = 'DOMA' $mt 'MAILLAGE' ; bas = 'DOMA' $bas 'MAILLAGE' ; gau = 'DOMA' $gau 'MAILLAGE' ; dro = 'DOMA' $dro 'MAILLAGE' ; * * Définition de la condition initiale et des conditions aux limites * Initial and boundary conditions * xmt = 'COORDONNEE' 1 mt ; * 'SI' ('EGA' icini 1) ; pmt = 'CHANGER' mt 'POI1' ; pmt1 = 'POIN' xmt 'EGINFE' 0. ; pmt3 = 'POIN' xmt 'EGSUPE' 1. ; pmt2 = 'DIFF' pmt (pmt1 'ET' pmt3) ; c1 = 'MANUEL' 'CHPO' pmt1 1 'SCAL' 0. ; c2 = 'COORDONNEE' 1 pmt2 ; c3 = 'MANUEL' 'CHPO' pmt3 1 'SCAL' 1. ; umcini = c1 '+' c2 '+' c3 ; cini = '*' ('-' umcini 1.) -1. ; 'FINSI' ; * 'SI' ('EGA' icini 2) ; cini = 'MASQUE' xmt 'SUPERIEUR' 0. ; 'FINSI' ; uini = '+' ('NOMC' 'UX' cini) ('NOMC' 'UY' ('*' cini 0.)) ; cgau = 'REDU' cini gau ; cdro = 'REDU' cini dro ; * * table EQEX (Problem definition) * rv = 'EQEX' 'NITER' niter 'OMEGA' omeg 'ITMA' 1 'OPTI' 'EF' 'IMPL' 'CENTREE' 'ZONE' $mt 'OPER' 'DFDT' 1. 'CNM1' dt 'INCO' 'CN' ; rv = 'EQEX' rv 'ZONE' $mt 'OPER' 'MAJUN' 'OPTI' 'EF' 'IMPL' typdec 'CMD' 0.2 'ZONE' $mt 'OPER' 'KONV' 1. 'UN' 'ALF' 'INCO' 'CN' 'OPTI' 'EF' 'IMPL' 'CENTREE' 'ZONE' $mt 'OPER' 'LAPN' 'ALF' 'INCO' 'CN' 'CLIM' gau 'CN' 'TIMP' cgau 'CLIM' dro 'CN' 'TIMP' cdro ; * rv . 'INCO' = 'TABLE' 'INCO' ; rv . 'INCO' . 'UN' = 'KCHT' $mt 'VECT' 'SOMMET' uini ; rv . 'INCO' . 'ALF' = 'KCHT' $mt 'SCAL' 'CENTRE' difart ; rv . 'INCO' . 'CN' = 'KCHT' $mt 'SCAL' 'SOMMET' cini ; rv . 'INCO' . 'CNM1' = 'KCHT' $mt 'SCAL' 'SOMMET' cini ; * * Boucle en temps à la main * Manual time stepping loop * res = 'TABLE' ; res . 'icini' = icini ; res . 'bas' = bas ; res . 'TPS' = 'TABLE' ; res . 'CN' = 'TABLE' ; ires = 1 ; cn = rv . 'INCO' . 'CN' ; res . 'TPS' . ires = rv . 'PASDETPS' . 'TPS' ; res . 'CN' . ires = 'COPIER' cn ; 'REPETER' iitma nitma ; EXEC rv ; ires = '+' ires 1 ; cn = rv . 'INCO' . 'CN' ; res . 'TPS' . ires = rv . 'PASDETPS' . 'TPS' ; res . 'CN' . ires = 'COPIER' cn ; evc = 'EVOL' 'CHPO' cn 'SCAL' bas ; evtot = evc ; tabt = 'TABLE' ; tabt . 'TITRE' = 'TABLE' ; tabt . 1 = 'CHAINE' 'TIRC MARQ CROI' ; *tabt . 1 = 'CHAINE' 'TIRC NOLI' ; tabt . 'TITRE' . 1 = 'CHAINE' 'Sol. App.' ; cht = 'CHAINE' 'Pdt = ' &iitma ; 'SI' graph ; 'SI' lnclk ; 'DESSIN' evtot 'TITX' 'X' 'TITY' 'C' 'TITR' cht 'LEGE' tabt 'NCLK' ; 'SINON' ; 'DESSIN' evtot 'TITX' 'X' 'TITY' 'C' 'TITR' cht 'LEGE' tabt ; 'FINSI' ; 'FINS' ; 'FIN' iitma ; 'RESPRO' res ; 'FINPROC' ; * * Post-traitement (Post-treatment) * 'DEBPROC' POST ; 'ARGUMENT' res*'TABLE' ; 'ARGUMENT' lnclk/'LOGIQUE' ; 'SI' ('NON' ('EXISTE' lnclk)) ; lnclk = FAUX ; 'FINSI' ; 'OPTI' 'DIME' 3 ; icini = res . 'icini' ; bas = res . 'bas' ; rt = res . 'TPS' ; rc = res . 'CN' ; tm = 'TABLE' 'ESCLAVE' ; 'REPETER' it ('DIME' rt) ; ti = rt . &it ; ci = rc . &it ; mail = bas 'PLUS' ('NOMC' 'UZ' ci) ; mail = mail 'PLUS' (0. ti 0.) ; tm . &it = mail ; 'FIN' it ; 'SI' ('EGA' icini 1) ; oeil = '*' (1.2 -2.4 1.3) 2. ; 'FINSI' ; 'SI' ('EGA' icini 2) ; oeil = '*' (-2.1 -2.4 1.3) 2. ; 'FINSI' ; mtp = 'ET' tm ; 'SI' lnclk ; 'TRACER' oeil mtp 'NCLK' ; 'SINON' ; 'TRACER' oeil mtp ; 'FINSI' ; 'OPTI' 'DIME' 2 ; 'FINPROC' ; * * Table contenant les choix des menus (Menu entries) * tcini = 'TABLE' ; tcini . 1 = 'choc' ; tcini . 2 = 'detente' ; ntcini = 'DIME' tcini ; itcini = 1 ; tadc = 'TABLE' ; tadc . 1 = 'CENTREE' ; tadc . 2 = 'SUPG' ; tadc . 3 = 'SUPGDC' ; ntadc = 'DIME' tadc ; itadc = 1 ; * * Précalcul de tous les cas (Precompute all cases) * tprec = 'TABLE' ; 'REPETER' b1 ntcini ; tprec . &b1 = 'TABLE' ; 'REPETER' b2 ntadc ; tprec . &b1 . &b2 = CALCUL &b1 &b2 VRAI ; 'FIN' b2 ; 'FIN' b1 ; * * Boucle d'affichage (Print loop) * 'SI' interact ; 'REPETER' bouc ; * CALCUL itcini itadc VRAI ; POST (tprec . itcini . itadc) VRAI ; cha = 'CHAINE' ' ' ; ret = 'MENU' cha (tcini . itcini) (tadc . itadc) ; 'SI' ('EGA' ret 'Quitter') ; 'QUITTER' bouc ; 'FINSI'; 'SI' ('EGA' ret (tcini . itcini)) ; itcini = '+' itcini 1 ; 'FINSI' ; 'SI' (itcini > ntcini) ; itcini = 1 ; 'FINSI'; 'SI' ('EGA' ret (tadc . itadc)) ; itadc = '+' itadc 1 ; 'FINSI' ; 'SI' (itadc > ntadc) ; itadc = 1 ; 'FINSI'; 'FIN' bouc ; 'FINS' ; * * Mes transparents * Lecture notes slides * 'SI' transp ; 'OPTI' 'TRAC' 'PS' ; POST (tprec . 1 . 1) VRAI ; POST (tprec . 1 . 2) VRAI ; POST (tprec . 2 . 1) VRAI ; POST (tprec . 2 . 2) VRAI ; 'FINSI' ; * 'SI' interact ; 'OPTION' 'DONN' 5 ; 'FINSI' ; * * End of dgibi file BURGERS1D-2.DGIBI * 'FIN' ;