* fichier : shock2d.dgibi ************************************************************************ * NOM : shock2d.dgibimain2D * DESCRIPTION : file to solve 2D tests: * two-fluid shock tube * * LANGAGE : GIBIANE-CAST3M * AUTEUR : Jose R. Garcia-Cascales, * Universidad Politecnica de Cartagena, * jr.garcia@upct.es ********************************************************************** * VERSION : v1, 19/04/2002, version initiale * HISTORIQUE : v.final, 22/11/2005 ************************************************************************ * * MESH DEFINITION * ************************************************************************ TYEL = 'QUA4' ; * TYEL = 'TRI6' ; * * GRAPH = VRAI ; GRAPH = FAUX ; ****************** **** MAILLAGE **** ****************** * number of elements = 2*LS2*RAF = 10*RAF * RAF = 10 -> 100 elements * RAF = 50 -> 500 elements * RAF = 100 -> 1000 elements RAF = 10 ; * length of the tube = 2*LS2 = 10 metres LS2 = 5. ; L = 2.*LS2 ; DX = 1.0 '/' RAF ; * number of elements in the x axis NX = 2 ; * tube width LINJ = NX '*' DX ; P2 = LINJ 0.0 ; P3 = 0.0 0.0 ; NYS2 = 'ENTIER' ((LS2 '/' DX) '+' 0.5) ; P2P3 = P2 'DROIT' NX P3 ; DOM1 = P2P3 'TRANSLATION' NYS2 (0.0 LS2) ; DOM2 = P2P3 'TRANSLATION' NYS2 (0.0 (-1.0 '*' LS2)) ; * DOMTOT = total region DOMTOT = DOM1 'ET' DOM2 ; * **** Creation of DOMAINE tables via the MODEL object * TP2P3 = $P2P3. 'QUAF'; TDOMTOT = $DOMTOT.'QUAF'; TDOM1 = $DOM1. 'QUAF'; TDOM2 = $DOM2. 'QUAF'; 'ELIMINATION' (TDOMTOT 'ET' TDOM1 'ET' TDOM2 'ET' TP2P3) 1.D-5; * **** Line to plot the results * 'OPTION' 'ELEM' 'SEG2' ; P4 = (DX '/' 2.) ((-1. '*' LS2) '+' (DX '/' 2.)) ; P5 = (DX '/' 2.) (LS2 '-' (DX '/' 2.)) ; P4P5 = P4 'DROIT' (NYS2 '+' NYS2 '-' 1) P5 ; 'ELIMINATION' P4P5 (1.0D-3 '/' RAF) ($DOMTOT.'CENTRE') ; 'SI' GRAPH ; 'TRACER' (DOMTOT 'ET' (P4P5)) 'TITRE' 'Domaine total' ; 'FINSI' ; ************************************************************************ * * INITIAL CONDITIONS * ************************************************************************ CP = 2.d0 ; CVM = 0.d0 ; * 'DISCRET') 'ET' 'DISCRET') ; 'NATURE' 'DISCRET') ; 'NATURE' 'DISCRET') ; 'DISCRET') 'ET' 'DISCRET') ; 'DISCRET') ; 'DISCRET'); 'DISCRET'); 'DISCRET'); 'DISCRET'); 'DISCRET'); 'DISCRET'); 'DISCRET'); * vch7 (rhov) = gammav*p/((gammav - 1.D0)*Cpv*T) * vch8 (rhol) = gammal*(p + pil)/((gammal - 1.D0)*Cpl*T) * IMPROVE, VCH7 & VCH8 ARE NOT ASSOCIATED TO ANY MESH!!!!!!!!! VCH7 = NUM1 '/' NUM2 ; NUM3 = 2.8d0 * (VCH4 '+' 8.5d8) ; VCH8 = NUM3 '/' NUM4 ; *************************************************************** ***** PROCEDURE POUR CALCULER LES VARIABLES CONSERVATIVES ***** *************************************************************** 'DEBPROC' CONS ; 'ARGUMENT'VCH1*'CHPOINT' VCH2*'CHPOINT' VCH3*'CHPOINT' VCH4*'CHPOINT' VCH5*'CHPOINT' VCH6*'CHPOINT' VCH7*'CHPOINT' VCH8*'CHPOINT' ; AL = VCH1 '-' 1.0 ; AL = AL * (-1.0) ; 'NATURE' 'DISCRET' ; 'NATURE' 'DISCRET' ; ECV = 0.5d0 * (UVX2 '+' UVY2) ; * ev = Cpv*v(5)/gammav * IEV = ('PSCAL' CPV VCH5 ('MOTS' 'SCAL') ('MOTS' 'SCAL'))'/' 1.4d0 ; IEV = (1008.d0 * VCH5)'/' 1.4d0 ; TIEV = IEV '+' ECV ; WCH5 = WCH1 * TIEV ; ECL = 0.5d0 * (ULX2 '+' ULY2) ; * el = Cpl*v(6)/gammal + pil/rl * NUM9 = ('PSCAL' CPL VCH5 ('MOTS' 'SCAL') ('MOTS' 'SCAL'))'/' 2.8d0 ; NUM9 = (4186.d0 * VCH6)'/' 2.8d0 ; NUM0 = 8.5d8 '*'(VCH8 '**' -1.) ; IEL = NUM9 '+' NUM0 ; TIEL = IEL '+' ECL ; WCH6 = WCH2 * TIEL ; 'RESPRO' WCH1 WCH2 WCH3 WCH4 WCH5 WCH6 ; 'FINPROC' ; *************************************************************** WCH1 WCH2 WCH3 WCH4 WCH5 WCH6 = CONS VCH1 VCH2 VCH3 VCH4 VCH5 VCH6 VCH7 VCH8 ; * * We create old alpha, to satisfy the prim operator * necessities * OALP = VCH1 ; OTV = VCH5 ; OTL = VCH6 ; PINT RL RV TL TV P UL UV ALP = 'PRIM' 'TWOFLUID' WCH1 WCH2 WCH3 WCH4 WCH5 WCH6 OALP OTV OTL CP CVM; ERRO = 'MAXIMUM' (VCH4 '-' P) 'ABS' ; 'SI' (ERRO > 1.0D-6) ; 'MESSAGE' 'Problem in the stic file!!!' 'ERREUR' 5 ; 'FINSI' ; * **** Plot of IC * 'SI' GRAPH ; MOD1 = 'MODELISER' ($DOMTOT . 'MAILLAGE' ) 'THERMIQUE'; 'TRACER' CHM_V1 MOD1 'TRACER' CHM_V2 MOD1 'TRACER' CHM_V3 MOD1 'TRACER' CHM_V4 MOD1 'TRACER' CHM_V5 MOD1 'TRACER' CHM_V6 MOD1 'TRACER' CHM_V7 MOD1 'TRACER' CHM_V8 MOD1 'FINSI' ; ************************************************************************ * * MAIN PROGRAM * ************************************************************************ * * Different upwind schemes available * AUSM + * METO = 'AUSMP1' ; * Preconditioned AUSM + METO = 'AUSMP2'; * AUSMDV * METO = 'AUSMDV1'; * Preconditioned AUSMDV * METO = 'AUSMDV2'; * * Maximum number of iterations * NITER = 900000000 ; * * SI IMPLICIT * IMPL = 1 ; * SI EXPLICIT IMPL = 0 ; * Gravity, Final time, CFL-like parameter * g = 0.d0 ; TFINAL = 0.005d0 ; MCFL = 0.1D0 ; FRICC = 0 ; * * Order in space, order in time and a useful counter * ORDESP = 1; ORDTEM = 1; COUNT = 1; * * TIME IS RESETED TO 0 seconds * TPS = 0.0 ; * * Names of the residuum components * 'MESSAGE' ; 'MESSAGE' ('CHAINE' 'Methode = ' METO) ; 'MESSAGE' ; DALP LIMCH GRG = 'PENT' MDOMTOT 'CENTRE' 'SI' (ORDESP 'EGA' 2) ; GRADAL CACA COEFSCAL = 'PENT' MDOMTOT 'CENTRE' 'EULESCAL' GRADUV CACA COEFVECT = 'PENT' MDOMTOT 'CENTRE' 'EULEVECT' 'FINSI' ; * **** Temporal loop * 'REPETER' BL1 NITER ; * **** Evaluation of variables at each side of the interface (PRET operator) * 'SI' ((ORDESP 'EGA' 1) 'OU' (&BL1 'EGA' 1)) ; RLF RVF TLF TVF PF ULF UVF ALPF = 'PRET' 'TWOFLUID' 1 1 $DOMTOT ALP UV UL P TV TL RV RL ; 'SINON' ; GRADAL LIMALP = 'PENT' MDOMTOT 'CENTRE' 'EULESCAL' 'LIMITEUR' GRADUV LIMUV = 'PENT' MDOMTOT 'CENTRE' 'EULESCAL' 'LIMITEUR' GRADUL LIMUL = 'PENT' MDOMTOT 'CENTRE' 'EULESCAL' 'LIMITEUR' GRADP LIMP = 'PENT' MDOMTOT 'CENTRE' 'EULESCAL' 'LIMITEUR' GRADTV LIMTV = 'PENT' MDOMTOT 'CENTRE' 'EULESCAL' 'LIMITEUR' GRADTL LIMTL = 'PENT' MDOMTOT 'CENTRE' 'EULESCAL' 'LIMITEUR' RLF RVF TLF TVF PF ULF UVF ALPF = 'PRET' 'TWOFLUID' ORDESP ORDTEM $DOMTOT ALP GRADAL LIMALP UV GRADUV LIMUV UL GRADUL LIMUL P GRADP LIMP TV GRADTV LIMTV TL GRADTL LIMTL RV RL DELTAT ; 'FINSI' ; $DOMTOT LISTINCO ALPF UVF ULF PF TVF TLF RVF RLF ; DT = MCFL '*' DELTAT ; 'SI' (&BL1 'EGA' 1 ) ; OALP = ALP ; OLDDT = DT ; 'FINSI' ; * **** Increment of the variables (convection) * RESIDU = DT '*' RESIDU ; * To analyse the evolution of the residual, only for the momentum equations * RU3N = WCH3 ; RU4N = WCH4 ; * **** Update of conserved variables * TPS = TPS '+' DT ; WCH1 = WCH1 '+' DRVN ; WCH2 = WCH2 '+' DRLN ; WCH3 = WCH3 '+' DRUVN ; WCH4 = WCH4 '+' DRULN ; WCH5 = WCH5 '+' DRETVN ; WCH6 = WCH6 '+' DRETLN ; * **** Adittion of the source terms * * * Interfacial friction term, drag force * FV = 0. ; FL = 0. ; * DALP1 LIMCH = 'PENT' MDOMTOT 'CENTRE' * *** Void fraction gradient terms * DADP = DT * PINT * DALP1 ; * * Source term corresponding to the vapour momentum equation * 'DISCRET'); S32 = DT * ALP * RV * g ; S3 = S31 'ET' S321 ; 'NATURE' 'DISCRET' ; SO3 = (S3 '+' DADP) ; 'NATURE' 'DISCRET' ; WCH3 = WCH3 '+' SO3 '+' FV; * Source term corresponding to the liquid momentum equation 'DISCRET'); S42 = DT *(ALP '-' 1.d0) * RL * g ; S42 = S42 * (-1.) ; S4 = S41 'ET' S421 ; 'NATURE' 'DISCRET' ; SO4 = (S4 '-' DADP) ; 'NATURE' 'DISCRET' ; WCH4 = WCH4 '+' SO4 '+' FL; * Source term corresponding to the vapour total energy equation S5 = S32 * VY ; DADT = DT * PINT * (ALP '-' OALP) '/' OLDDT ; SO5 = (S5 '-' DADT) ; WCH5 = WCH5 '+' SO5 ; * Source term corresponding to the liquid total equation S6 = S42 * LY ; SO6 = (S6 '+' DADT) ; WCH6 = WCH6 '+' SO6 ; OALP = ALP ; OLDDT = DT ; OTV = TV ; OTL = TL ; *********************************************************************** *** Updating Primitive variables *********************************************************************** PINT RL RV TL TV P UL UV ALP = 'PRIM' 'TWOFLUID' WCH1 WCH2 WCH3 WCH4 WCH5 WCH6 OALP OTV OTL CP CVM; ************************************************************************ **** Graphical outputs ************************************************************************ 'SI' (((&BL1 '/' 1000) '*' 1000) 'EGA' &BL1) ; 'MESSAGE' &BL1 TPS ; 'FINSI' ; 'SI' (TPS > TFINAL) ; LINE = P4P5 ; TITULO = 'CHAINE' 'Shock tube test' ; 'MESSAGE' &BL1 TPS ; 'SI' GRAPH ; 'alpha' ; 'uvx (m/s)' ; 'uvy (m/s)' ; 'ulx (m/s)' ; 'uly (m/s)' ; 'p (Pa)' ; 'Tv (K)' ; 'Tl (K)' ; 'rv (kg/m3)' ; 'rl (kg/m3)' ; 'FINSI' ; 'QUITTER' BL1 ; 'FINSI' ; 'FIN' BL1 ; * 'SI' GRAPH ; MOD1 = 'MODELISER' ($DOMTOT . 'MAILLAGE' ) 'THERMIQUE'; 'TRACER' CHM_V1 MOD1 'TRACER' CHM_V2 MOD1 'TRACER' CHM_V3 MOD1 'TRACER' CHM_V4 MOD1 'TRACER' CHM_V5 MOD1 'TRACER' CHM_V6 MOD1 'TRACER' CHM_V7 MOD1 'TRACER' CHM_V8 MOD1 'FINSI' ; * * Saving the results * 'OPTION' 'SAUVER' ('CHAINE' 'shock2d.sauv') ; * 'SAUVER' ; * 'FIN' ;
© Cast3M 2003 - Tous droits réservés.
Mentions légales