convergence_diffusion_constant_conductivity_bubble_wall_Newton.yml 158 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383
  1. flower:
  2. physics:
  3. #Coefficients for Butler-volmer
  4. alpha: &alpha 0.5
  5. alpha_a: 0.5
  6. alpha_c: 0.5
  7. bulk_velocity: zero #use zero velocity in liquid phase for transport
  8. # Species H2 KOH H2O
  9. # concentration0: &concentration0 [1.6e-1, 6.7e3, 4.9e4]
  10. # concentration0: [&cH2, cKOH, cH2O]
  11. # concentration0: [1.6e-1, 6.7e3, 4.9e4]
  12. concentration0_H2: &concentration0_H2 1.6e-1
  13. concentration0_KOH: &concentration0_KOH 6.7e3
  14. concentration0_H2O: &concentration0_H2O 4.9e4
  15. concentration0: [*concentration0_H2, *concentration0_KOH, *concentration0_H2O]
  16. epsilon_concentration: [1e-14, 1e-14, 1e-14]
  17. electrolysis_reaction: "Butler_no_concentration"
  18. diffusion_coeff_H2: &diffusion_coeff_H2 5.8e-9
  19. diffusion_coeff_KOH: &diffusion_coeff_KOH 3.2e-9
  20. diffusion_coeff_H2O: &diffusion_coeff_H2O 3.2e-9
  21. diffusion_coeff: [*diffusion_coeff_H2, *diffusion_coeff_KOH, *diffusion_coeff_H2O]
  22. species_names: &species_names ['H2','KOH','H2O']
  23. end_time: 1.0 #7.3 #s
  24. current: 1000 #A
  25. Faraday: &Faraday 9.64853321233100184e4 #C⋅mol−1
  26. Henry_H2: &Henry_H2 1
  27. Henry_KOH: &Henry_KOH 0
  28. Henry_H2O: &Henry_H2O 0
  29. Henry: [*Henry_H2, *Henry_KOH, *Henry_H2O]
  30. i0: &i0 1.0
  31. intfc_x: 0.0 # x coordinate of bubble center
  32. intfc_y: 5.0e-5 # y coordinate of bubble center
  33. # KOHwtpercent: 30
  34. ls_wall_xmin: 5e-6
  35. mu1: 0.0 #6.7e-7*1258.0
  36. mu2: 0.0
  37. mu_cin1: &mu_cin1 6.7e-7
  38. mu_cin2: &mu_cin2 6.7e-7 #m^2/s
  39. MWH2: 2.01568e-3 #kg/mol
  40. nb_levelsets: &nb_levelsets 1 #2
  41. nb_transported_scalars: &nb_transported_scalars 0 #TODO or inv stoechiometric
  42. Navier_slip_length: 1.0e-2
  43. nucleation_time: -1.0 #deactivated
  44. #Electric potential
  45. phi_ele0: 0.0
  46. phi_ele1: &phi_ele1 -0.6
  47. pres0: 0.0 #1e5
  48. radius: 1.2e-5 # 6.0e-6 #3.0e-6 #initial radius
  49. ref_length: 1e-4
  50. rho1: &rho1 1258.0 #liquid
  51. rho2: 0.069575 #gaz
  52. #TODO need for 80°C, check with other study
  53. #"0.7016E-01" in \citet{cohnTABLETHERMODYNAMICPROPERTIES1963} H2
  54. # Linear interpolation between 350 and 360
  55. # 350 360 353 B 0.13841 353 350 360
  56. # 7.02E-02 6.82E-02 -0.00194999999999999 A -0.000194999999999999 0.069575 0.07016 0.06821
  57. radial_vel_factor: 1e-7
  58. Ru: &Ru 8.314
  59. sigma: 7.7e-2
  60. temperature0: &temperature0 353.0
  61. theta_e: 30 #145 #90
  62. theta_adv: 120
  63. theta_rec: 30
  64. # if θe < 40
  65. # max_its = 35000
  66. # elseif θe < 100
  67. # max_its = 15000
  68. # else
  69. # max_its = 5000
  70. # end
  71. v_inlet: &v_inlet 6.7e-4
  72. g: 9.81
  73. beta: 0.0 #angle for gravity
  74. domain_length: &domain_length 1.0e-4
  75. mesh:
  76. nx: 128
  77. ny: 128
  78. xmin: &mesh_xmin 0.0
  79. xmax: &mesh_xmax 1.0e-4
  80. ymin: &mesh_ymin 0.0
  81. ymax: &mesh_ymax 1.0e-4
  82. simulation:
  83. activate_interface: &activate_interface 1
  84. advection_LS_mode: 10 #9 #8 #2 #5 #4 #3 #2
  85. adapt_timestep_mode: 3 #fixed timestep
  86. average_liquid_solid: 0
  87. ns_advection: 1 #0 no advection
  88. auto_reinit: 1 #activated: 1
  89. bc_int: WallNoSlip #FreeSurface #WallNoSlip
  90. breakup: 1
  91. bulk_conductivity: 3 #2 3:constant conductivity from c_0
  92. # uses bulk or interfacial concentrationfor conductivity
  93. case: None #Planar #Cylinder
  94. CFL: 0.5
  95. concentration_check_factor: &concentration_check_factor 1.0e-4 #TODO do not write 1e-4, ill read in python
  96. contact_angle: 1 #activate advancing/receding contact angle
  97. convection_Cdivu: 0
  98. convection_mode: 1 #0 #1
  99. electrolysis_convection: 0 #1
  100. electrical_potential: 3 #2 #0 deactivated
  101. electrical_potential_max_iter: 50 #20
  102. electrical_potential_relative_residual: 1.0e-10
  103. electrical_potential_residual: 1.0e-10
  104. electrical_potential_nonlinear_solver: 1 #0 for successive substitutions #1 for Newton-Raphson
  105. electrolysis_phase_change_case: "None" #"Khalighi" #no phase change
  106. phase_change_method: 6 #5 #fixed mass transfer rate 0.05 rho_l #4
  107. epsilon_volume_fraction_phase_change: 1.0e-6
  108. # electrolysis_phase_change_case: "Khalighi" #integration on whole surface to get a radius
  109. # electrolysis_phase_change_case: "levelset" # local
  110. eps: 1.0e-12 #eps for small numbers
  111. epsilon: 0.2 #0.05 #0.2 #cut small cells
  112. epsilon_wall: 0.2 #0.05 #0.2
  113. #if epsilon=0 centroids will be on the interface
  114. epsilon_mode: 2 #way to handle epsilon:
  115. # if num.epsilon_mode == 0
  116. # return 1 / (W+eps(0.01))
  117. # elseif num.epsilon_mode == 1
  118. # return 1 / max(W, num.epsilon_vol)
  119. # elseif num.epsilon_mode == 2
  120. # return inv_weight_clip(num,W)
  121. # end
  122. kill_dead_cells: 1
  123. extend_field: 1 #do not
  124. imposed_velocity : "none" #"zero" #"none" #"zero" #"none"
  125. index_phase_change: 1
  126. index_electrolyte: 2
  127. max_iter: 1 #1 #60 #1 #60 #1 #60 #maximum number of iterations
  128. average_velocity: 1 #0
  129. laplacian: 0 #1 #multiply by 4/3
  130. marching_squares_epsilon: 1.0e-9
  131. marching_squares_max_iter: 15
  132. mass_transfer_rate: 2 #1 #Johansen & Colella
  133. mode_2d: 3
  134. # mode_2d = 1 #use equivalent cylinder
  135. # mode_2d = 2 #mol/meter
  136. # mode_2d = 3 #mol/meter with xcoord and ycoord parameters for LS definition
  137. name: "convergence_diffusion"
  138. nb_reinit: 2 #10
  139. non_dimensionalize: 0 # 0: NS equations as is (without non_dimensionalization)
  140. null_space: 0 #method for null space, matrix diagonal
  141. one_fluid_model: 0
  142. one_fluid_normal: 1
  143. surface_tension: 1 # 0 for CSF from VOF, 1 for LS
  144. mu_one_fluid_average: 1 #0 : arithmetic #1 harmonic
  145. smooth_VOF: 2
  146. periodic_x: 0
  147. periodic_y: 0
  148. prediction: PmIIimposedpressureBCincrement #0 #4 #0 #pressure-velocity coupling
  149. # prediction = 0
  150. # prediction = 1
  151. # prediction = 2
  152. # prediction = 3 # PIII in Brown's article
  153. # prediction = 4
  154. pressure_velocity_coupling: 0 #3 #3 #1 # 0: projection, 1: coupled
  155. pressure_velocity_solver: 0 #direct 1 #BICGSTAB(2)
  156. solve_solid: 0 #0 do not solve in solid
  157. reinit_every: 3 #0 #3 # period of levelset reinialization
  158. levelset_reinitialize: 0 #do not reinit
  159. restart: 0 #TODO restart with PDI
  160. show_every: 1
  161. scalar_bc: 0 #1 for multiple LS (describing wall) #0 for one LS
  162. scalar_scheme: 0 #1 #0 #CN 1 #Backward Euler (implicit)
  163. solve_Navier_Stokes_liquid_phase: 0 #1 activated
  164. solve_Navier_Stokes: 0
  165. solve_potential: 1
  166. solve_species: 1
  167. solver: 0 #2 #0 #1 #0: Julia 1: MUMPS
  168. debug: "None" #"allocations_start" #"scalar_testing" #"scalar_debug"
  169. time_scheme: FE #CN #FE #Forward Euler
  170. # time_scheme: CN
  171. n_ext: 10
  172. delta_reinit: 10.0 # delta for automatic reinitialization
  173. NB: 24 # number of cells the velocity is extended
  174. verbosity: 0 #3
  175. macros:
  176. boundaries: |
  177. # Signs in divergence theorem
  178. sign_left = -1.0 #n \cdot e_x = -1
  179. sign_right = 1.0 #n \cdot e_x = 1
  180. sign_bottom = -1.0 #n \cdot e_y = -1
  181. sign_top = 1.0 #n \cdot e_y = 1
  182. if phys.nb_levelsets ==1
  183. BC_int = [WallNoSlip()] #[FreeSurface()]
  184. end
  185. BC_uL= BoundariesInt()
  186. BC_vL= BoundariesInt()
  187. BC_pL = Boundaries(
  188. name = "BC_pL",
  189. left = Neumann(),
  190. right = Neumann(),
  191. bottom = Neumann(),
  192. top = Neumann(),
  193. )
  194. i_butler = gp.x[:,1] .*0.0
  195. phi_ele = gp.x[:,1] .*0.0
  196. i_butler=butler_volmer_no_concentration.(phys.alpha_a,phys.alpha_c,phys.Faraday,phys.i0,phi_ele,phys.phi_ele1,phys.Ru,phys.temperature0)
  197. BC_phi_ele = BoundariesInt(
  198. left = Neumann(val=i_butler./elec_cond), #TODO -BC in Flower ? so i_butler not -i_butler
  199. right = Dirichlet(),
  200. bottom = Neumann(val=0.0),
  201. top = Neumann(val=0.0),
  202. int = Neumann(val=0.0),
  203. LS = [Neumann(val=0.0)]
  204. )
  205. BC_trans_scal_H2 = BoundariesInt(
  206. bottom = Dirichlet(val = phys.concentration0[1]),
  207. top = Neumann(),
  208. left = Neumann(val=-i_butler/(2*phys.Faraday*DH2)),
  209. right = Dirichlet(val = phys.concentration0[1]),
  210. int = Dirichlet(val = phys.concentration0[1]/phys.Henry_H2))
  211. #KOH
  212. BC_trans_scal_KOH = BoundariesInt(
  213. bottom = Dirichlet(val = phys.concentration0[2]),
  214. top = Neumann(),
  215. left = Neumann(val=-i_butler/(2*phys.Faraday*DKOH)),
  216. right = Dirichlet(val = phys.concentration0[2]),
  217. int = Neumann(val=0.0)) #KOH
  218. #H2O
  219. BC_trans_scal_H2O = BoundariesInt(
  220. bottom = Dirichlet(val = phys.concentration0[3]),
  221. top = Neumann(),
  222. left = Neumann(val=i_butler/(phys.Faraday*DH2O)),
  223. right = Dirichlet(val = phys.concentration0[3]),
  224. int = Neumann(val=0.0))
  225. BC_trans_scal = [
  226. BC_trans_scal_H2, #H2
  227. BC_trans_scal_KOH, #KOH
  228. BC_trans_scal_H2O] #H2O
  229. BC_u = Boundaries(
  230. bottom = Neumann_inh(),
  231. top = Neumann_inh(),
  232. left = Neumann_inh(),
  233. right = Neumann_inh()
  234. )
  235. BC_uS = BoundariesInt()
  236. BC_vS = BoundariesInt()
  237. BC_pS = Boundaries()
  238. # print BC
  239. # print("\n BC_int ",BC_int)
  240. print("\n BC_uL ",BC_uL)
  241. print("\n BC_vL ",BC_vL)
  242. print("\n BC_pL ",BC_pL)
  243. print("\n BC_phi_ele ",BC_phi_ele)
  244. print("\n BC_trans_scal ",BC_trans_scal)
  245. open("BC0.html", "w") do file
  246. print_BC_html(BC_uL,"u";io=file)
  247. print_BC_html(BC_vL,"v";io=file)
  248. print_BC_html(BC_pL,"p";io=file)
  249. print_BC_html(BC_phi_ele,"phi";io=file)
  250. print_BC_html(BC_trans_scal_H2,"H2";io=file)
  251. print_BC_html(BC_trans_scal_KOH,"KOH";io=file)
  252. print_BC_html(BC_trans_scal_H2O,"H2O";io=file)
  253. # write(file, "This is a line of text.\n")
  254. # The file will be automatically closed here
  255. end
  256. L0 = mesh.xmax - mesh.xmin
  257. print("\n grad ",(BC_pL.top.val-BC_pL.bottom.val)/L0)
  258. init_fields: |
  259. printstyled(color=:green, @sprintf "\n Initialisation \n")
  260. #init Bulk
  261. if num.solve_solid == 1
  262. phS.T .= phys.temperature0
  263. end
  264. phL.T .= phys.temperature0
  265. # Electrochemistry
  266. for iscal=1:phys.nb_transported_scalars
  267. phL.trans_scal[:,:,iscal] .= phys.concentration0[iscal]
  268. end
  269. phL.phi_ele .= phys.phi_ele0
  270. # Initialize Poiseuille pressure profile
  271. phL.u .= 0.0
  272. phL.v .= 0.0
  273. phL.uD .= 0.0
  274. phL.vD .= 0.0
  275. # p_top = 0
  276. # p_bottom = p_top + phys.rho1*phys.g*(mesh.ymax - mesh.ymin)
  277. # phL.p .= p_bottom .+ (gp.y .- mesh.ymin)*(p_top-p_bottom)/(mesh.ymax - mesh.ymin)
  278. # vec1(phL.pD,gp) .= vec(phL.p)
  279. #
  280. # p_top = 0
  281. # p_bottom = p_top + 8*mu1/phys.ref_length*phys.v_inlet
  282. # phL.p .= p_bottom .+ (gp.y .- mesh.ymin)*(p_top-p_bottom)/(mesh.ymax - mesh.ymin)
  283. # vec1(phL.pD,gp) .= vec(phL.p)
  284. # # Initialize Poiseuille velocity profile
  285. # vPoiseuille = Poiseuille_fmax.(gv.x,phys.v_inlet,phys.ref_length)
  286. # vPoiseuilleb = Poiseuille_fmax.(gv.x[1,:],phys.v_inlet,phys.ref_length)
  287. # phL.u .= 0.0
  288. # phL.v .= vPoiseuille
  289. # vecb_B(phL.vD,gv) .= vPoiseuilleb
  290. interface: |
  291. # gp.LS[1].u .= gp.x .- phys.ls_wall_xmin
  292. if sim.activate_interface == 1
  293. gp.LS[1].u .= sqrt.((gp.x .- phys.intfc_x).^2 + (gp.y .- phys.intfc_y).^2) - phys.radius * ones(gp)
  294. #modify velocity field near interface
  295. su = sqrt.((gv.x .- phys.intfc_x).^2 .+ (gv.y .- phys.intfc_y).^2)
  296. R1 = phys.radius + 3.0*num.Δ
  297. bl = 4.0
  298. for II in gv.ind.all_indices
  299. if su[II] <= R1
  300. phL.v[II] = 0.0
  301. # elseif su[II] > R1
  302. # uL[II] = tanh(bl*(su[II]-R1))
  303. end
  304. end
  305. elseif sim.activate_interface == -1
  306. gp.LS[1].u .= sqrt.((gp.x .- phys.intfc_x).^2 + (gp.y .- phys.intfc_y).^2) - phys.radius * ones(gp)
  307. gp.LS[1].u .*= -1.0
  308. else
  309. gp.LS[1].u .= 1.0
  310. end
  311. test_LS(gp)
  312. print_parameters: |
  313. print("\n Print parameters from yml file \n")
  314. mu = phys.mu_cin1 *phys.rho1 #in Pa s = M L^{-1} T^{-1}}
  315. phys.mu1 = mu
  316. phys.mu2 = mu
  317. mu1=mu
  318. mu2=mu
  319. h0 = phys.radius
  320. # print("\n phys.concentration0 ",phys.concentration0)
  321. # c0_H2 = phys.concentration0.concentration0_H2
  322. # c0_KOH = phys.concentration0.concentration0_KOH
  323. # c0_H2O = phys.concentration0.concentration0_H2O
  324. # concentration0_dict = PropertyDict(phys.concentration0)
  325. # c0_H2 = concentration0_dict.concentration0_H2
  326. # c0_KOH = concentration0_dict.concentration0_KOH
  327. # c0_H2O = concentration0_dict.concentration0_H2O
  328. c0_H2,c0_KOH,c0_H2O = phys.concentration0
  329. DH2,DKOH,DH2O= phys.diffusion_coeff
  330. elec_cond=2*phys.Faraday^2*c0_KOH*DKOH/(phys.Ru*phys.temperature0)
  331. printstyled(color=:red, @sprintf "\n elec_cond : %.2e \n" elec_cond)
  332. Re=phys.rho1*phys.v_inlet*phys.ref_length/mu #Reynolds number
  333. printstyled(color=:green, @sprintf "\n Re : %.2e %.2e %.2e %.2e\n" Re phys.rho1/mu1 phys.rho1 mu1)
  334. Re=phys.rho1/mu1 #not Reynolds number, but rho1/mu1
  335. printstyled(color=:green, @sprintf "\n 'Re' i.e. rho/mu : %.2e %.2e %.2e %.2e\n" Re phys.rho1/mu1 phys.rho1 mu1)
  336. if phys.nb_transported_scalars>0
  337. if length(phys.concentration0)!=phys.nb_transported_scalars
  338. print(@sprintf "\nnb_transported_scalars: %5i\n" phys.nb_transported_scalars)
  339. @error ("nb_transported_scalars")
  340. end
  341. if length(phys.diffusion_coeff)!=phys.nb_transported_scalars
  342. print(@sprintf "\nnb_transported_scalars: %5i\n" phys.nb_transported_scalars)
  343. @error ("nb_transported_scalars")
  344. end
  345. else
  346. printstyled(color=:red, @sprintf "\n WARNING no scalar transport\n")
  347. end
  348. print(@sprintf "\nnb_transported_scalars: %5i\n" phys.nb_transported_scalars)
  349. # diffusion_t = (phys.radius^2)./phys.diffusion_coeff
  350. diffusion_t = ((mesh.xmax-mesh.xmin)^2)./phys.diffusion_coeff
  351. print("\n diffusion time ", diffusion_t,"\n")
  352. open("report.html", "w") do file
  353. # write("simulation time ", phys.end_time)
  354. # write("simulation dt ", timestep)
  355. # write("simulation max_iter ", sim.max_iter)
  356. # write("diffusion time ", diffusion_t)
  357. print(file,"\nsimulation time ", phys.end_time)
  358. # print(file,"\ndt ", timestep)
  359. print(file,"\nsimulation max_iter ", sim.max_iter)
  360. print(file,"\ndiffusion time ", diffusion_t)
  361. # print_BC_html(BC_uL,"u";io=file)
  362. # print_BC_html(BC_vL,"v";io=file)
  363. # print_BC_html(BC_pL,"p";io=file)
  364. # write(file, "This is a line of text.\n")
  365. # The file will be automatically closed here
  366. end
  367. print("\n end Print parameters from yml file \n")
  368. # test_end: |
  369. # print("\n test end \n")
  370. # open("BC.html", "w") do file
  371. # print_BC_html(BC_uL,"u";io=file)
  372. # print_BC_html(BC_vL,"v";io=file)
  373. # print_BC_html(BC_pL,"p";io=file)
  374. # print_BC_html(BC_phi_ele,"phi";io=file)
  375. # print_BC_html(BC_trans_scal_H2,"H2";io=file)
  376. # print_BC_html(BC_trans_scal_KOH,"KOH";io=file)
  377. # print_BC_html(BC_trans_scal_H2O,"H2O";io=file)
  378. # # write(file, "This is a line of text.\n")
  379. # # The file will be automatically closed here
  380. # end
  381. # phi_test = -1.166e-02
  382. # i_butler_test = butler_volmer_no_concentration.(phys.alpha_a,phys.alpha_c,phys.Faraday,phys.i0,phi_test,phys.phi_ele1,phys.Ru,phys.temperature0)
  383. # print("\n test Butler ",i_butler_test)
  384. # # L = Lmesh_xmax-mesh_xmin
  385. # print("\n test Butler ",i_butler_test,-i_butler_test*L)
  386. # print("\n")
  387. study:
  388. #tolerance for tests
  389. test_tolerance: 1.e-11 #1.e-14
  390. test_tolerance_solution_absolute: 1.e-1 # from n = 16
  391. meshes: [32,64,128] #[32,64,128,256]
  392. compute_errors: None
  393. timesteps: [1e-4] #[1e-3] #[5e-3] #[1e-2] #[5e-2] #[5e-3] # #[1e-3] #[1e-4]
  394. #nucleation_time is 2.0e-2
  395. plot:
  396. ax_locator_x: [0,20,40,60,80,100] #ticks in matplotlib
  397. ax_locator_y: [0,20,40,60,80,100]
  398. ax_formatter_x: [0,20,40,60,80,100] #[0,$L_e$]
  399. ax_formatter_y: [0,20,40,60,80,100] #[0,$L_e$]
  400. xlim: [0,100] #[0,3.175e-4]
  401. ylim: [0,100] #[0,3.175e-4]
  402. cbarlabel: "" #["u","v"]
  403. cmap: "viridis"
  404. color_line: "k" #"w" #"k"
  405. color_wall: 'k'
  406. fig_fraction: 1.0 #0.5
  407. interface_color: 'r' #'k'
  408. extend: neither #max
  409. xlabel: $x ( \unit{\um})$
  410. ylabel: $y ( \unit{\um})$
  411. linewidth: 1
  412. linestyle: None
  413. skip_every: 1 #12
  414. text_color: k
  415. themes: [dark,light] #[light] #[dark,light]
  416. theme: light
  417. film_format: mp4
  418. quiver_scale: 1e-4
  419. quiver_scale_unit: xy #None
  420. scale_time: 1e-3
  421. scale_vel: 1e-4
  422. scale_x: 1e-6
  423. scale_y: 1e-6
  424. theta1: 0
  425. theta2: 90
  426. ticks_x: 0:20:100
  427. ticks_y: 0:20:100
  428. unit_time: ms
  429. write_h5: 0
  430. plot_grid: false
  431. plot_levelset: True
  432. plot_levelset_segments: False
  433. plot_movies : false
  434. plot_R : false
  435. #debug Levelset
  436. plotcase : "none"
  437. #plotcase : "circle"
  438. plot_current_wall : false
  439. # plot_current_wall : true
  440. plot_interface : false
  441. # plot_interface : true
  442. plot_mode: "pcolormesh"
  443. fontsize: 2
  444. print_mode: "val"
  445. plotbc: true
  446. dpi: 300
  447. font_size: 12
  448. img_format: "pdf"
  449. latex_frame_height: 180 #220 #180 #200 #220 # 261.20912 #228.4378 #pt #beamer
  450. latex_frame_width: 426.79135 # 398.3386
  451. #do not plot 2D figure, used in special plots (velocity vectors and current lines):
  452. no_2D_plot: ["velocity_x","velocity_y","i_current_x","i_current_y"]
  453. pdi: 1 #1: pdi activated
  454. # quiver_scale_unit: xy #None
  455. # scale_time: 1e-3
  456. # scale_vel: 1e-4
  457. # scale_x: 1.0 #1e-6
  458. # scale_y: 1.0 #1e-6
  459. # theta1: 0
  460. # theta2: 90
  461. # ticks_x: 0:1:0.5 #0:20:100
  462. # ticks_y: 0:2:0.5 #0:20:100
  463. # unit_time: ms
  464. # write_h5: 0
  465. # # plot_grid: false
  466. # # plot_levelset: True
  467. # # plot_levelset_segments: False
  468. # plot_movies : false
  469. # plot_R : false
  470. # #debug Levelset
  471. # plotcase : "none"
  472. # #plotcase : "circle"
  473. # plot_current_wall : false
  474. # # plot_current_wall : true
  475. # plot_interface : false
  476. # # plot_interface : true
  477. # # plot_mode: "pcolormesh"
  478. # # print_mode: "val"
  479. # plotbc: true
  480. # prefix: "./"
  481. # show_nodes: False
  482. # figsize: None
  483. # aspect_box: 'box'
  484. # aspect_ratio: 'equal'
  485. # fontsize: 4
  486. # isocontour: False
  487. # levels: 10
  488. # # mesh_macro: |
  489. # # global x_1D_2, y_1D_2,key_LS_2
  490. # # x_1D_2 = xp
  491. # # y_1D_2 = yv
  492. # plot_bc: True
  493. # plot_grid: True
  494. # plot_levelset: True
  495. # plot_levelset_segments: #True
  496. # plot_normal: True
  497. # plot_normal_macro: |
  498. # normal_x
  499. # quiver_scale: 10
  500. # # skip_every:
  501. # plot_mode: pcolormesh #contourf
  502. # print_mode: "val"
  503. # range: [0,1e-4]
  504. # slope_color: 'k'
  505. # slope_alpha: 0.5
  506. # zoom: [[0,5],[0,5]]
  507. # zoom_mode: index
  508. # zoom: [[1,11],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  509. # zoom: [[0,10],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  510. # zoom: [[0,4],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  511. # zoom_mode: coord
  512. color_annot_bc: w
  513. color_annot_bulk: w
  514. linestyles: ['(0, (3, 6))' ]
  515. # macro_file_name: ['file_name+"_"+str(mesh["nx"])+"_"+plotpar["theme"]+ ".pdf"',
  516. # 'file_name+"_"+str(mesh["nx"])+ "_"+plotpar["theme"]+".svg"']
  517. # macro_file_name: ['file_name+"_"+str(mesh["nx"])+"_"+"it"+"_"+str(nstep)+"_"+plotpar["theme"]+ ".pdf"',
  518. # 'file_name+"_"+str(mesh["nx"])+"_"+"it"+"_"+str(nstep)+"_"+plotpar["theme"]+".svg"']
  519. macro_file_name: ['file_name+"_"+"it"+"_"+str(nstep)+"_"+plotpar["theme"]+ ".pdf"',
  520. 'file_name+"_"+"it"+"_"+str(nstep)+"_"+plotpar["theme"]+".svg"']
  521. ticks_format: '%.2e'
  522. files_macro: | #macro to select files for film
  523. import re
  524. global h5_files_2
  525. freq = 10
  526. freq = 1
  527. max_iter = 23
  528. h5_files_2 = []
  529. for file in h5_files:
  530. iter = int(re.split(r'_|\.h5', file)[1])
  531. # print('iter',iter,iter%freq)
  532. # if iter%freq == 0:
  533. # h5_files_2.append(file)
  534. if (iter%freq == 0) and (iter < max_iter):
  535. h5_files_2.append(file)
  536. # zoom: &zoom1 [[0.0,1.0],[0.0,1.0]]
  537. # zoom_mode: &zoom_mode1 coord
  538. zoom: &zoom1 [[0.27,0.73],[0.27,0.73]]
  539. zoom_mode: &zoom_mode1 coord
  540. zoom2: &zoom2 [[0.4,0.6],[0.6,0.8]]
  541. zoom_mode2: &zoom_mode2 coord
  542. # zoom2: &zoom2 [[0.0,0.1],[0,0.1]]
  543. # zoom_mode2: &zoom_mode2 coord
  544. # zoom3: &zoom3 [[0.9,1.0],[0,0.1]]
  545. # zoom_mode3: &zoom_mode3 coord
  546. # zoom4: &zoom4 [[0.9,1.0],[0.9,1.0]]
  547. # zoom_mode4: &zoom_mode4 coord
  548. # zoom5: &zoom5 [[0,0.1],[0.9,1.0]]
  549. # zoom_mode5: &zoom_mode5 coord
  550. figures:
  551. - var: i_current_x
  552. figsize: True
  553. file: current_lines
  554. fig_fraction: 1.0
  555. fig_ratio: 0.5
  556. add_schematics: True
  557. add_schematics_coords: [0, 2, 61, 63] #[0, 1, 55, 57]
  558. fontsize: 6
  559. func: plot_current_lines
  560. cbarlabel: "$ \\text{Electrical potential} ~ (\\unit{V})$" #Electrical potential
  561. ax_locator_x: [0,20,40,60,80,100]
  562. ax_locator_y: [0,20,40,60,80,100]
  563. img_format: mp4
  564. isocontour: #True
  565. levels: 10 #10
  566. range: np.linspace(-1.116e-2,0,11)
  567. plot_bc: True
  568. plot_grid: True
  569. plot_levelset: True
  570. plot_levelset_segments: False
  571. plot_mode: contourf
  572. # range: [0,1e-4]
  573. ticks_format: '%.2e'
  574. # xlim: [0,100]
  575. # ylim: [0,100]
  576. linewidth: 0.25 #1
  577. linestyle: '-' #'dotted'
  578. zoom_mode: None
  579. #For current lines
  580. density: '[0.5,0.5]'
  581. streamplot_cbarlabel: "$ \\text{Current magnitude} ~ \\rightarrow$"
  582. streamplot_color: 'k' #mag
  583. streamplot_mutation_scale: 5 #1 very small, 10 default?
  584. # start_points: 'np.array([[100,100,100,100,100,100,100,100,100,100,100,100,100,100], [10,20,30,40,45,47.5,48,51,52.5,55,60,70,80,90]])' #'np.array([[0,20,40,60,80,100], [0,20,40,60,80,100]])'
  585. # broken_streamlines: True
  586. streamplot_lw: 0.25
  587. # plot_schematic_wall: True
  588. # - var: i_current_x
  589. # # figsize: True
  590. # file: current_lines
  591. # func: plot_current_lines
  592. # cbarlabel: "$ \\text{Electrical potential} ~ (\\unit{V})$" #Electrical potential
  593. # # #macro_file_name: ['file_name+"_"+str(mesh["nx"])+"_"+plotpar["theme"]+ ".pdf"', 'file_name+"_"+str(mesh["nx"])+ "_"+plotpar["theme"]+".svg"']
  594. # # fig_fraction: 1.0
  595. # # fig_ratio: 0.5
  596. # add_schematics: #True
  597. # add_schematics_coords: [0, 2, 61, 63] #[0, 1, 55, 57]
  598. # fontsize: 6
  599. # # # ax_locator_x: [0,0.5,1]
  600. # # # ax_locator_y: [0,0.5,1,0.5,2]
  601. # # img_format: mp4
  602. # # isocontour: #True
  603. # # levels: 10 #10
  604. # # # range: np.linspace(-1.116e-2,0,11)
  605. # # plot_bc: True
  606. # # plot_grid: True
  607. # # plot_levelset: #True
  608. # # plot_levelset_segments: False
  609. # # plot_mode: contourf
  610. # # # range: [0,1e-4]
  611. # # ticks_format: '%.2e'
  612. # # linewidth: 0.25 #1
  613. # # linestyle: '-' #'dotted'
  614. # # zoom_mode: None
  615. # # #For current lines
  616. # # density: '[0.5,0.5]'
  617. # # streamplot_cbarlabel: "$ \\text{Current magnitude} ~ \\rightarrow$"
  618. # # streamplot_color: 'k' #mag
  619. # # streamplot_mutation_scale: 5 #1 very small, 10 default?
  620. # # # start_points: 'np.array([[100,100,100,100,100,100,100,100,100,100,100,100,100,100], [10,20,30,40,45,47.5,48,51,52.5,55,60,70,80,90]])' #'np.array([[0,0.5,1], [0,0.5,1]])'
  621. # # # broken_streamlines: True
  622. # # streamplot_lw: 0.25
  623. # # # plot_schematic_wall: True
  624. # - var: dcap_1
  625. # func: plot_python_pdf_full2
  626. # file: dcap_1_zoom
  627. # cbarlabel: "dcap_1"
  628. # img_format: pdf
  629. # isocontour: False
  630. # levels: 10
  631. # range: np.linspace(48982,49000.001,11) #49000.001 for rounding errors, otherwise use extend parameter but we cannot check if c>>490000
  632. # plot_bc: #True
  633. # plot_grid: True
  634. # plot_levelset: True
  635. # plot_levelset_segments: False
  636. # plot_capacities: True
  637. # plot_capacities_ijlist: [[1,1],[1,5],[1,10]]
  638. # plot_mode: contourf
  639. # xlim: [0,100]
  640. # ylim: [0,100]
  641. # zoom: [[0,10],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  642. # zoom_mode: coord
  643. # color_annot_bc: w
  644. # color_annot_bulk: w
  645. # linewidth: 1
  646. # linestyle: None
  647. # - var: dcap_1
  648. # file: dcap_1
  649. # field_index: 1
  650. # cbarlabel: "$\\chi$"
  651. # fontsize: 4
  652. # isocontour: False
  653. # levels: 10
  654. # # lcolor:
  655. # plot_bc: True
  656. # plot_wall: #True
  657. # plot_grid: True
  658. # plot_levelset: True
  659. # plot_levelset_segments: #True
  660. # plot_levelset_segments_print:
  661. # plot_mode: contourf
  662. # print_mode:
  663. # range: [0,1e-4]
  664. # xlim: [0,100]
  665. # ylim: [0,100]
  666. # linewidth: 1
  667. # linestyle: None
  668. # - var: dcap_2
  669. # file: dcap_2
  670. # field_index: 1
  671. # cbarlabel: "$\\chi$"
  672. # fontsize: 4
  673. # isocontour: False
  674. # levels: 10
  675. # # lcolor:
  676. # plot_bc: True
  677. # plot_wall: #True
  678. # plot_grid: True
  679. # plot_levelset: True
  680. # plot_levelset_segments: #True
  681. # plot_levelset_segments_print:
  682. # plot_mode: contourf
  683. # print_mode:
  684. # range: [0,1e-4]
  685. # xlim: [0,100]
  686. # ylim: [0,100]
  687. # linewidth: 1
  688. # linestyle: None
  689. # - var: dcap_3
  690. # file: dcap_3
  691. # field_index: 1
  692. # cbarlabel: "$\\chi$"
  693. # fontsize: 4
  694. # isocontour: False
  695. # levels: 10
  696. # # lcolor:
  697. # plot_bc: True
  698. # plot_wall: #True
  699. # plot_grid: True
  700. # plot_levelset: True
  701. # plot_levelset_segments: #True
  702. # plot_levelset_segments_print:
  703. # plot_mode: contourf
  704. # print_mode:
  705. # range: [0,1e-4]
  706. # xlim: [0,100]
  707. # ylim: [0,100]
  708. # linewidth: 1
  709. # linestyle: None
  710. # - var: dcap_4
  711. # file: dcap_4
  712. # field_index: 1
  713. # cbarlabel: "$\\chi$"
  714. # fontsize: 4
  715. # isocontour: False
  716. # levels: 10
  717. # # lcolor:
  718. # plot_bc: True
  719. # plot_wall: #True
  720. # plot_grid: True
  721. # plot_levelset: True
  722. # plot_levelset_segments: #True
  723. # plot_levelset_segments_print:
  724. # plot_mode: contourf
  725. # print_mode:
  726. # range: [0,1e-4]
  727. # xlim: [0,100]
  728. # ylim: [0,100]
  729. # linewidth: 1
  730. # linestyle: None
  731. # - var: levelset_p
  732. # file: levelset_p
  733. # figsize: None
  734. # aspect_box: 'box'
  735. # aspect_ratio: 'equal'
  736. # cbarlabel: Levelset p
  737. # fontsize: 4
  738. # isocontour: False
  739. # levels: 10
  740. # plot_bc: True
  741. # plot_wall: #True
  742. # plot_grid: True
  743. # plot_levelset: True #False
  744. # plot_levelset_segments: #True
  745. # plot_normal: #True
  746. # skip_every: 1
  747. # quiverkey: True
  748. # quiver_scale: 1
  749. # # quiver_scale_unit: xy #None
  750. # quiver_unit: m/s #given value v_inlet
  751. # quiver_x: 0.7
  752. # quiver_y: 0.05
  753. # # linewidth: 1
  754. # # linestyle: 'dotted'
  755. # plot_mode: contourf #pcolormesh #contourf
  756. # print_mode: "val"
  757. # range: [0,1e-4]
  758. # xlim: [0,100]
  759. # ylim: [0,100]
  760. # # zoom: [[0,5],[0,5]]
  761. # # zoom_mode: index
  762. # # zoom: [[1,11],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  763. # # zoom: [[0,10],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  764. # # zoom: [[0,4],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  765. # # zoom_mode: coord
  766. # color_annot_bc: w
  767. # color_annot_bulk: w
  768. # linewidth: 1
  769. # linestyle: None
  770. - var: concentration_H2_1DT
  771. func: plot_python_pdf_full2
  772. macro_file_name: ['file_name+"_"+str(mesh["nx"])+"_"+plotpar["theme"]+ ".pdf"', 'file_name+"_"+str(mesh["nx"])+ "_"+plotpar["theme"]+".svg"']
  773. file: concentration_H2_zoom_no_bc
  774. cbarlabel: "$ \\text{Concentration} ~ \\ce{H2}$"
  775. img_format: pdf
  776. isocontour: False
  777. levels: 10
  778. range: np.linspace(48982,49000.001,11) #49000.001 for rounding errors, otherwise use extend parameter but we cannot check if c>>490000
  779. plot_bc: #True
  780. plot_grid: True
  781. plot_levelset: True
  782. plot_levelset_segments: False
  783. plot_mode: contourf
  784. xlim: [0,100]
  785. ylim: [0,100]
  786. zoom: [[0,10],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  787. zoom_mode: coord
  788. color_annot_bc: w
  789. color_annot_bulk: w
  790. linewidth: 1
  791. linestyle: None
  792. - var: concentration_H2_1DT
  793. file: concentration_H2
  794. func: plot_file
  795. macro_file_name: ['file_name+"_"+str(mesh["nx"])+"_"+plotpar["theme"]+ ".pdf"', 'file_name+"_"+str(mesh["nx"])+ "_"+plotpar["theme"]+".svg"']
  796. cbarlabel: "$\\text{Concentration}~H_2$"
  797. fontsize: 4
  798. isocontour: False
  799. levels: 10
  800. # lcolor:
  801. plot_bc: True
  802. plot_grid: True
  803. plot_levelset: True
  804. plot_levelset_segments: #True
  805. plot_levelset_segments_print:
  806. plot_mode: contourf
  807. print_mode:
  808. range: [0,1e-4]
  809. xlim: [0,100]
  810. ylim: [0,100]
  811. linewidth: 1
  812. linestyle: None
  813. # - var: levelset_p
  814. # func: plot_python_pdf_full2
  815. # file: levelset_p_zoom
  816. # field_index: 1
  817. # cbarlabel: LS
  818. # fontsize: 4
  819. # isocontour: False
  820. # levels: 10
  821. # plot_bc: True
  822. # plot_grid: True
  823. # plot_levelset: False
  824. # plot_levelset_segments: False
  825. # plot_normal: #True
  826. # plot_mode: pcolormesh #contourf
  827. # print_mode: "val"
  828. # range: [0,1e-4]
  829. # xlim: [0,100]
  830. # ylim: [0,100]
  831. # #zoom: [[0,5],[0,5]]
  832. # #zoom_mode: index
  833. # zoom: [[0,4],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  834. # zoom_mode: coord
  835. # color_annot_bc: k #w
  836. # color_annot_bulk: w
  837. # - var: levelset_p
  838. # file: levelset_p
  839. # figsize: None
  840. # aspect_box: 'box'
  841. # aspect_ratio: 'equal'
  842. # cbarlabel: Levelset p
  843. # fontsize: 4
  844. # isocontour: False
  845. # levels: 10
  846. # plot_bc: True
  847. # plot_wall: #True
  848. # plot_grid: True
  849. # plot_levelset: True #False
  850. # plot_levelset_segments: #True
  851. # plot_normal: True
  852. # plot_mode: contourf #pcolormesh #contourf
  853. # print_mode: "val"
  854. # range: [0,1e-4]
  855. # xlim: [0,100]
  856. # ylim: [0,100]
  857. # # zoom: [[0,5],[0,5]]
  858. # # zoom_mode: index
  859. # # zoom: [[1,11],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  860. # # zoom: [[0,10],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  861. # # zoom: [[0,4],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  862. # # zoom_mode: coord
  863. # color_annot_bc: w
  864. # color_annot_bulk: w
  865. # linewidth: 1
  866. # linestyle: None
  867. # - var: normal_velocity_intfc
  868. # func: plot_file
  869. # file: normal_velocity_intfc
  870. # field_index: 1
  871. # cbarlabel: normal_velocity_intfc
  872. # fontsize: 4
  873. # isocontour: False
  874. # levels: 10
  875. # plot_bc: True
  876. # plot_grid: True
  877. # plot_levelset: True
  878. # plot_levelset_segments: False
  879. # plot_mode: pcolormesh #contourf
  880. # print_mode: "val"
  881. # range: [0,1e-4]
  882. # xlim: [0,100]
  883. # ylim: [0,100]
  884. # #zoom: [[0,5],[0,5]]
  885. # #zoom_mode: index
  886. # zoom: [[0,4],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  887. # zoom_mode: None #coord
  888. # color_annot_bc: k #w
  889. # color_annot_bulk: w
  890. # linewidth: 1
  891. # linestyle: None
  892. # - var: normal_velocity_intfc
  893. # func: plot_python_pdf_full2
  894. # file: normal_velocity_intfc_zoom
  895. # field_index: 1
  896. # cbarlabel: normal_velocity_intfc
  897. # fontsize: 4
  898. # isocontour: False
  899. # levels: 10
  900. # plot_bc: True
  901. # plot_grid: True
  902. # plot_levelset: False
  903. # plot_levelset_segments: False
  904. # plot_mode: pcolormesh #contourf
  905. # print_mode: "val"
  906. # range: [0,1e-4]
  907. # xlim: [0,100]
  908. # ylim: [0,100]
  909. # #zoom: [[0,5],[0,5]]
  910. # #zoom_mode: index
  911. # zoom: [[0,4],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  912. # zoom_mode: coord
  913. # color_annot_bc: k #w
  914. # color_annot_bulk: w
  915. # - var: concentration_H2_1DT
  916. # func: plot_python_pdf_full2
  917. # file: concentration_H2_zoom
  918. # field_index: 1
  919. # cbarlabel: "$\\text{Concentration}~H_2$"
  920. # fontsize: 4
  921. # isocontour: False
  922. # levels: 10
  923. # plot_bc: True
  924. # plot_grid: True
  925. # plot_levelset: True
  926. # plot_levelset_segments: False
  927. # plot_mode: pcolormesh #contourf
  928. # print_mode: "val"
  929. # range: [0,1e-4]
  930. # xlim: [0,100]
  931. # ylim: [0,100]
  932. # #zoom: [[0,5],[0,5]]
  933. # #zoom_mode: index
  934. # zoom: [[0,4],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  935. # zoom_mode: coord
  936. # color_annot_bc: k #w
  937. # color_annot_bulk: w
  938. # - var: concentration_H2_1DT
  939. # func: plot_python_pdf_full2
  940. # file: concentration_H2_zoom_int
  941. # field_index: 2
  942. # cbarlabel: "$\\text{Concentration}~H_2$"
  943. # fontsize: 4
  944. # isocontour: False
  945. # levels: 10
  946. # plot_bc: #True
  947. # plot_grid: True
  948. # plot_levelset: False
  949. # plot_levelset_segments: False
  950. # plot_mode: pcolormesh #contourf
  951. # print_mode: "val"
  952. # range: [0,1e-4]
  953. # xlim: [0,100]
  954. # ylim: [0,100]
  955. # #zoom: [[0,5],[0,5]]
  956. # #zoom_mode: index
  957. # zoom: [[0,4],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  958. # zoom_mode: coord
  959. # color_annot_bc: k #w
  960. # color_annot_bulk: w
  961. # - var: mass_transfer_rate_border
  962. # func: plot_python_pdf_full2
  963. # file: mass_transfer_rate_zoom_border
  964. # figsize: None
  965. # aspect_box: 'box'
  966. # aspect_ratio: 'equal'
  967. # cbarlabel: Mass transfer rate
  968. # fontsize: 4
  969. # isocontour: False
  970. # levels: 10
  971. # plot_bc: True
  972. # plot_grid: True
  973. # plot_levelset: True #False
  974. # plot_levelset_segments: #True
  975. # plot_mode: pcolormesh #contourf
  976. # print_mode: "val"
  977. # range: [0,1e-4]
  978. # xlim: [0,100]
  979. # ylim: [0,100]
  980. # # zoom: [[0,5],[0,5]]
  981. # # zoom_mode: index
  982. # # zoom: [[1,11],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  983. # # zoom: [[0,10],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  984. # zoom: [[0,4],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  985. # zoom_mode: coord
  986. # color_annot_bc: w
  987. # color_annot_bulk: w
  988. # linewidth: 1
  989. # linestyle: None
  990. # - var: mass_transfer_rate_intfc
  991. # func: plot_python_pdf_full2
  992. # file: mass_transfer_rate_zoom_intfc
  993. # figsize: None
  994. # aspect_box: 'box'
  995. # aspect_ratio: 'equal'
  996. # cbarlabel: Mass transfer rate
  997. # fontsize: 4
  998. # isocontour: False
  999. # levels: 10
  1000. # plot_bc: True
  1001. # plot_grid: True
  1002. # plot_levelset: True #False
  1003. # plot_levelset_segments: #True
  1004. # plot_mode: pcolormesh #contourf
  1005. # print_mode: "val"
  1006. # range: [0,1e-4]
  1007. # xlim: [0,100]
  1008. # ylim: [0,100]
  1009. # # zoom: [[0,5],[0,5]]
  1010. # # zoom_mode: index
  1011. # # zoom: [[1,11],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1012. # # zoom: [[0,10],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1013. # zoom: [[0,4],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1014. # zoom_mode: coord
  1015. # color_annot_bc: w
  1016. # color_annot_bulk: w
  1017. # linewidth: 1
  1018. # linestyle: None
  1019. # - var: mass_transfer_rate_bulk
  1020. # func: plot_python_pdf_full2
  1021. # file: mass_transfer_rate_zoom_bulk
  1022. # figsize: None
  1023. # aspect_box: 'box'
  1024. # aspect_ratio: 'equal'
  1025. # cbarlabel: Mass transfer rate
  1026. # fontsize: 4
  1027. # isocontour: False
  1028. # levels: 10
  1029. # plot_bc: True
  1030. # plot_grid: True
  1031. # plot_levelset: True #False
  1032. # plot_levelset_segments: #True
  1033. # plot_mode: pcolormesh #contourf
  1034. # print_mode: "val"
  1035. # range: [0,1e-4]
  1036. # xlim: [0,100]
  1037. # ylim: [0,100]
  1038. # # zoom: [[0,5],[0,5]]
  1039. # # zoom_mode: index
  1040. # # zoom: [[1,11],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1041. # # zoom: [[0,10],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1042. # zoom: [[0,4],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1043. # zoom_mode: coord
  1044. # color_annot_bc: w
  1045. # color_annot_bulk: w
  1046. # linewidth: 1
  1047. # linestyle: None
  1048. # - var: mass_transfer_rate
  1049. # func: plot_python_pdf_full2
  1050. # file: mass_transfer_rate_zoom
  1051. # figsize: None
  1052. # aspect_box: 'box'
  1053. # aspect_ratio: 'equal'
  1054. # cbarlabel: Mass transfer rate
  1055. # fontsize: 4
  1056. # isocontour: False
  1057. # levels: 10
  1058. # plot_bc: True
  1059. # plot_grid: True
  1060. # plot_levelset: True #False
  1061. # plot_levelset_segments: #True
  1062. # plot_mode: pcolormesh #contourf
  1063. # print_mode: "val"
  1064. # range: [0,1e-4]
  1065. # xlim: [0,100]
  1066. # ylim: [0,100]
  1067. # # zoom: [[0,5],[0,5]]
  1068. # # zoom_mode: index
  1069. # # zoom: [[1,11],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1070. # # zoom: [[0,10],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1071. # zoom: [[0,4],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1072. # zoom_mode: coord
  1073. # color_annot_bc: w
  1074. # color_annot_bulk: w
  1075. # linewidth: 1
  1076. # linestyle: None
  1077. # - var: velocity_x
  1078. # func: plot_vector
  1079. # file: velocity_vectors
  1080. # plot_levelset: True
  1081. # plot_levelset_segments: False
  1082. # skip_every: 12
  1083. # xlim: [0,100]
  1084. # ylim: [0,100]
  1085. # quiverkey: True
  1086. # quiver_unit: m/s #given value v_inlet
  1087. # quiver_x: 0.7
  1088. # quiver_y: 0.97
  1089. # linewidth: 1
  1090. # linestyle: 'dotted'
  1091. # ax_locator_x: [0,20,40,60,80,100]
  1092. # ax_locator_y: [0,20,40,60,80,100]
  1093. # - var: i_current_x
  1094. # file: current_lines
  1095. # func: plot_current_lines
  1096. # cbarlabel: Electrical potential
  1097. # # img_format: mp4
  1098. # isocontour: #True
  1099. # levels: 0 #10
  1100. # range: np.linspace(-1.5e-4,0,11)
  1101. # plot_bc: True
  1102. # plot_grid: True
  1103. # plot_levelset: True
  1104. # plot_levelset_segments: False
  1105. # plot_mode: contourf
  1106. # # range: [0,1e-4]
  1107. # ticks_format: '%.2e'
  1108. # xlim: [0,100]
  1109. # ylim: [0,100]
  1110. # linewidth: 1
  1111. # linestyle: 'dotted'
  1112. # zoom_mode: None
  1113. # #For current lines
  1114. # density: '[0.5,0.5]'
  1115. # streamplot_color: mag
  1116. # streamplot_mutation_scale: 5 #1 very small, 10 default?
  1117. # streamplot_lw: 0.25
  1118. # - var: i_current_x
  1119. # figsize: True
  1120. # file: current_lines
  1121. # macro_file_name: ['file_name+"_"+str(mesh["nx"])+"_"+plotpar["theme"]+ ".pdf"', 'file_name+"_"+str(mesh["nx"])+ "_"+plotpar["theme"]+".svg"']
  1122. # fig_fraction: 1.0
  1123. # fig_ratio: 0.5
  1124. # # add_schematics: #True
  1125. # add_schematics_coords: [0, 2, 61, 63] #[0, 1, 55, 57]
  1126. # fontsize: 6
  1127. # func: plot_current_lines
  1128. # cbarlabel: "$ \\text{Electrical potential} ~ (\\unit{V})$" #Electrical potential
  1129. # ax_locator_x: [0,20,40,60,80,100]
  1130. # ax_locator_y: [0,20,40,60,80,100]
  1131. # img_format: mp4
  1132. # isocontour: #True
  1133. # levels: 10 #10
  1134. # range: np.linspace(-1.116e-2,0,11)
  1135. # plot_bc: True
  1136. # plot_grid: True
  1137. # plot_levelset: True
  1138. # plot_levelset_segments: False
  1139. # plot_mode: contourf
  1140. # # range: [0,1e-4]
  1141. # ticks_format: '%.2e'
  1142. # xlim: [0,100]
  1143. # ylim: [0,100]
  1144. # linewidth: 0.25 #1
  1145. # linestyle: '-' #'dotted'
  1146. # zoom_mode: None
  1147. # #For current lines
  1148. # density: '[0.5,0.5]'
  1149. # streamplot_cbarlabel: "$ \\text{Current magnitude} ~ \\rightarrow$"
  1150. # streamplot_color: 'k' #mag
  1151. # streamplot_mutation_scale: 5 #1 very small, 10 default?
  1152. # # start_points: 'np.array([[100,100,100,100,100,100,100,100,100,100,100,100,100,100], [10,20,30,40,45,47.5,48,51,52.5,55,60,70,80,90]])' #'np.array([[0,20,40,60,80,100], [0,20,40,60,80,100]])'
  1153. # # broken_streamlines: True
  1154. # streamplot_lw: 0.25
  1155. # # plot_schematic_wall: True
  1156. - var: i_current_x
  1157. figsize: True
  1158. file: current_lines_schematics
  1159. macro_file_name: ['file_name+"_"+str(mesh["nx"])+"_"+plotpar["theme"]+ ".pdf"', 'file_name+"_"+str(mesh["nx"])+ "_"+plotpar["theme"]+".svg"']
  1160. fig_fraction: 1.0
  1161. fig_ratio: 0.5
  1162. add_schematics: #True
  1163. add_schematics_coords: [0, 2, 61, 63] #[0, 1, 55, 57]
  1164. fontsize: 6
  1165. func: plot_current_lines
  1166. cbarlabel: "$ \\text{Electrical potential} ~ (\\unit{V})$" #Electrical potential
  1167. ax_locator_x: [0,20,40,60,80,100]
  1168. ax_locator_y: [0,20,40,60,80,100]
  1169. img_format: mp4
  1170. isocontour: #True
  1171. levels: 10 #10
  1172. range: np.linspace(-1.116e-2,0,11)
  1173. plot_bc: True
  1174. plot_grid: True
  1175. plot_levelset: True
  1176. plot_levelset_segments: False
  1177. plot_mode: contourf
  1178. # range: [0,1e-4]
  1179. ticks_format: '%.2e'
  1180. xlim: [0,100]
  1181. ylim: [0,100]
  1182. linewidth: 0.25 #1
  1183. linestyle: '-' #'dotted'
  1184. zoom_mode: None
  1185. #For current lines
  1186. density: '[0.5,0.5]'
  1187. streamplot_cbarlabel: "$ \\text{Current magnitude} ~ \\rightarrow$"
  1188. streamplot_color: 'k' #mag
  1189. streamplot_mutation_scale: 5 #1 very small, 10 default?
  1190. # start_points: 'np.array([[100,100,100,100,100,100,100,100,100,100,100,100,100,100], [10,20,30,40,45,47.5,48,51,52.5,55,60,70,80,90]])' #'np.array([[0,20,40,60,80,100], [0,20,40,60,80,100]])'
  1191. # broken_streamlines: True
  1192. streamplot_lw: 0.25
  1193. # plot_schematic_wall: True
  1194. - var: v_1D
  1195. file: v_LS
  1196. cbarlabel: v/v_inlet
  1197. isocontour: False
  1198. norm: *v_inlet #reference inside yaml
  1199. levels: 10
  1200. plot_bc: True
  1201. plot_grid: True
  1202. plot_levelset: True
  1203. plot_levelset_segments: False
  1204. plot_mode: contourf
  1205. range: [0,1e-4]
  1206. xlim: [0,100]
  1207. ylim: [0,100]
  1208. linewidth: 0.5
  1209. linestyle: 'dotted'
  1210. # - var: mass_transfer_rate
  1211. # file: mass_transfer_rate
  1212. # cbarlabel: mass_transfer_rate
  1213. # isocontour: False
  1214. # levels: 10
  1215. # plot_bc: True
  1216. # plot_grid: True
  1217. # plot_levelset: True
  1218. # plot_levelset_segments: False
  1219. # plot_mode: contourf
  1220. # range: [0,1e-4]
  1221. # xlim: [0,100]
  1222. # ylim: [0,100]
  1223. # linewidth: 1
  1224. # linestyle: None
  1225. # - var: mass_transfer_rate
  1226. # file: mass_transfer_rate_no_intfc
  1227. # cbarlabel: mass_transfer_rate
  1228. # isocontour: False
  1229. # levels: 10
  1230. # plot_bc: True
  1231. # plot_grid: True
  1232. # plot_levelset: #True
  1233. # plot_levelset_segments: False
  1234. # plot_mode: contourf
  1235. # range: [0,1e-4]
  1236. # xlim: [0,100]
  1237. # ylim: [0,100]
  1238. # linewidth: 1
  1239. # linestyle: None
  1240. # - var: trans_scal_1D_H2
  1241. # file: trans_scal_1D_H2
  1242. # cbarlabel: '$\\text{Concentration} H_2$'
  1243. # isocontour: False
  1244. # levels: 10
  1245. # plot_bc: True
  1246. # plot_grid: True
  1247. # plot_levelset: False
  1248. # plot_mode: contourf
  1249. # range: [0,1e-4]
  1250. # xlim: [0,100]
  1251. # ylim: [0,100]
  1252. # linewidth: 1
  1253. # linestyle: None
  1254. # - var: trans_scal_1D_H2_1DT
  1255. # file: trans_scal_1D_H2_zoom
  1256. # field_index: 1 # 1 for bulk, 2 for 1st interface
  1257. # cbarlabel: '$\\text{Concentration} H_2$'
  1258. # fontsize: 4
  1259. # isocontour: False
  1260. # levels: 10
  1261. # plot_bc: True
  1262. # plot_grid: True
  1263. # plot_levelset: False
  1264. # plot_mode: colormesh
  1265. # print_mode: "val"
  1266. # range: [0,1e-4]
  1267. # xlim: [0,100]
  1268. # ylim: [0,100]
  1269. # linewidth: 1
  1270. # linestyle: None
  1271. # zoom: [[0,5],[0,5]]
  1272. # - var: concentration_H2_1DT
  1273. # file: concentration_H2
  1274. # cbarlabel: "$\\text{Concentration}~H_2$"
  1275. # fontsize: 4
  1276. # isocontour: False
  1277. # levels: 10
  1278. # # lcolor:
  1279. # plot_bc: True
  1280. # plot_grid: True
  1281. # plot_levelset: False #True
  1282. # plot_levelset_segments: #True
  1283. # plot_levelset_segments_print:
  1284. # plot_mode: contourf
  1285. # print_mode:
  1286. # range: [0,1e-4]
  1287. # xlim: [0,100]
  1288. # ylim: [0,100]
  1289. # linewidth: 1
  1290. # linestyle: None
  1291. # - var: concentration_KOH_1DT
  1292. # file: concentration_KOH
  1293. # cbarlabel: '$\\text{Concentration} KOH$'
  1294. # isocontour: False
  1295. # levels: 10
  1296. # plot_bc: True
  1297. # plot_grid: True
  1298. # plot_levelset: True
  1299. # plot_levelset_segments: False
  1300. # plot_mode: contourf
  1301. # range: [0,1e-4]
  1302. # xlim: [0,100]
  1303. # ylim: [0,100]
  1304. # linewidth: 1
  1305. # linestyle: None
  1306. # - var: concentration_H2O_1DT
  1307. # file: concentration_H2O
  1308. # cbarlabel: '$\\text{Concentration} H_2O$'
  1309. # isocontour: False
  1310. # levels: 10
  1311. # plot_bc: True
  1312. # plot_grid: True
  1313. # plot_levelset: True
  1314. # plot_levelset_segments: False
  1315. # plot_mode: contourf
  1316. # range: [0,1e-4]
  1317. # xlim: [0,100]
  1318. # ylim: [0,100]
  1319. # linewidth: 1
  1320. # linestyle: None
  1321. # #Zoom
  1322. # - var: mass_transfer_rate
  1323. # func: plot_python_pdf_full2
  1324. # file: mass_transfer_rate_zoom_coord
  1325. # figsize: None
  1326. # aspect_box: 'box'
  1327. # aspect_ratio: 'equal'
  1328. # cbarlabel: Mass transfer rate
  1329. # fontsize: 4
  1330. # isocontour: False
  1331. # levels: 10
  1332. # plot_bc: True
  1333. # plot_grid: True
  1334. # plot_levelset: True #False
  1335. # plot_levelset_segments: #True
  1336. # plot_mode: pcolormesh #contourf
  1337. # print_mode: "ijcoord" #"val"
  1338. # range: [0,1e-4]
  1339. # xlim: [0,100]
  1340. # ylim: [0,100]
  1341. # # zoom: [[0,5],[0,5]]
  1342. # # zoom_mode: index
  1343. # # zoom: [[1,11],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1344. # # zoom: [[0,10],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1345. # zoom: [[2,4],[45,47]] #[[1,10],[45,55]] activates BC plot so no longer square
  1346. # zoom_mode: coord
  1347. # color_annot_bc: w
  1348. # color_annot_bulk: w
  1349. # linewidth: 1
  1350. # linestyle: None
  1351. # - var: mass_transfer_rate
  1352. # func: plot_python_pdf_full2
  1353. # file: mass_transfer_rate_zoom
  1354. # figsize: None
  1355. # aspect_box: 'box'
  1356. # aspect_ratio: 'equal'
  1357. # cbarlabel: Mass transfer rate
  1358. # fontsize: 4
  1359. # isocontour: False
  1360. # levels: 10
  1361. # plot_bc: True
  1362. # plot_grid: True
  1363. # plot_levelset: True #False
  1364. # plot_levelset_segments: #True
  1365. # plot_mode: pcolormesh #contourf
  1366. # print_mode: "ijval" #"val"
  1367. # range: [0,1e-4]
  1368. # xlim: [0,100]
  1369. # ylim: [0,100]
  1370. # # zoom: [[0,5],[0,5]]
  1371. # # zoom_mode: index
  1372. # # zoom: [[1,11],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1373. # # zoom: [[0,10],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1374. # zoom: [[0,4],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1375. # zoom_mode: coord
  1376. # color_annot_bc: w
  1377. # color_annot_bulk: w
  1378. # linewidth: 1
  1379. # linestyle: None
  1380. # - var: v_1D
  1381. # file: v_zoom
  1382. # figsize: None
  1383. # aspect_box: 'box'
  1384. # aspect_ratio: 'equal'
  1385. # cbarlabel: v
  1386. # fontsize: 4
  1387. # isocontour: False
  1388. # levels: 10
  1389. # plot_bc: True
  1390. # plot_grid: True
  1391. # plot_levelset: True #False
  1392. # plot_levelset_segments: #True
  1393. # plot_mode: pcolormesh #contourf
  1394. # print_mode: "val"
  1395. # range: [0,1e-4]
  1396. # xlim: [0,100]
  1397. # ylim: [0,100]
  1398. # # zoom: [[0,5],[0,5]]
  1399. # # zoom_mode: index
  1400. # # zoom: [[1,11],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1401. # # zoom: [[0,10],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1402. # zoom: [[0,4],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1403. # zoom_mode: coord
  1404. # color_annot_bc: w
  1405. # color_annot_bulk: w
  1406. # linewidth: 1
  1407. # linestyle: None
  1408. # - var: concentration_H2_1DT
  1409. # file: concentration_H2_zoom
  1410. # field_index: 1
  1411. # cbarlabel: "$\\text{Concentration}~H_2$"
  1412. # fontsize: 4
  1413. # isocontour: False
  1414. # levels: 10
  1415. # plot_bc: True
  1416. # plot_grid: True
  1417. # plot_levelset: False
  1418. # plot_levelset_segments: False
  1419. # plot_mode: pcolormesh #contourf
  1420. # print_mode: "val"
  1421. # range: [0,1e-4]
  1422. # xlim: [0,100]
  1423. # ylim: [0,100]
  1424. # #zoom: [[0,5],[0,5]]
  1425. # #zoom_mode: index
  1426. # zoom: [[0,4],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1427. # zoom_mode: coord
  1428. # color_annot_bc: w
  1429. # color_annot_bulk: w
  1430. # - var: concentration_H2_1DT
  1431. # file: concentration_H2_zoom_segments
  1432. # field_index: 1
  1433. # cbarlabel: "$\\text{Concentration}~H_2$"
  1434. # fontsize: 4
  1435. # isocontour: False
  1436. # levels: 10
  1437. # plot_bc: True
  1438. # plot_grid: True
  1439. # plot_levelset: False
  1440. # plot_levelset_segments: #True
  1441. # plot_levelset_segments_print: ijy #ijx
  1442. # plot_mode: pcolormesh #contourf
  1443. # print_mode: ijy #ijx #ijcoord #ijval #ij #"val"
  1444. # range: [0,1e-4]
  1445. # xlim: [0,100]
  1446. # ylim: [0,100]
  1447. # zoom: [[1,11],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1448. # zoom_mode: coord
  1449. # color_annot_bc: w
  1450. # color_annot_bulk: w
  1451. # - var: concentration_H2_1DT
  1452. # file: concentration_H2_zoom_segments
  1453. # field_index: 1
  1454. # cbarlabel: '$\\text{Concentration} H_2$'
  1455. # fontsize: 4
  1456. # isocontour: False
  1457. # levels: 10
  1458. # plot_bc: True
  1459. # plot_grid: True
  1460. # plot_levelset: False
  1461. # plot_levelset_segments: True
  1462. # plot_mode: pcolormesh #contourf
  1463. # print_mode: ijval #ij #"val"
  1464. # range: [0,1e-4]
  1465. # xlim: [0,100]
  1466. # ylim: [0,100]
  1467. # zoom: [[1,11],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1468. # zoom_mode: coord
  1469. # color_annot_bc: w
  1470. # color_annot_bulk: w
  1471. films:
  1472. # - var: normal_velocity_intfc
  1473. # file: normal_velocity_intfc_zoom
  1474. # func: plot_python_pdf_full2
  1475. # cbarlabel: normal_velocity_intfc
  1476. # img_format: mp4
  1477. # isocontour: False
  1478. # levels: 10
  1479. # plot_bc: True
  1480. # plot_grid: True
  1481. # plot_levelset: True
  1482. # plot_levelset_segments: False
  1483. # plot_mode: contourf
  1484. # range: [0,1e-4]
  1485. # ticks_format: '%.2e'
  1486. # xlim: [0,100]
  1487. # ylim: [0,100]
  1488. # linewidth: 1
  1489. # linestyle: None
  1490. # zoom: [[0,5],[0,5]]
  1491. # zoom_mode: index
  1492. # - var: normal_velocity_intfc
  1493. # func: plot_file
  1494. # file: normal_velocity_intfc
  1495. # field_index: 1
  1496. # cbarlabel: normal_velocity_intfc
  1497. # img_format: mp4
  1498. # fontsize: 4
  1499. # isocontour: False
  1500. # levels: 0 #10
  1501. # range: np.linspace(-1e-2,1e-2,11)
  1502. # plot_bc: True
  1503. # plot_grid: True
  1504. # plot_levelset: True
  1505. # plot_levelset_segments: False
  1506. # plot_mode: pcolormesh #contourf
  1507. # print_mode: "val"
  1508. # # range: [0,1e-4]
  1509. # xlim: [0,100]
  1510. # ylim: [0,100]
  1511. # #zoom: [[0,5],[0,5]]
  1512. # #zoom_mode: index
  1513. # zoom: [[0,4],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1514. # zoom_mode: None #coord
  1515. # color_annot_bc: k #w
  1516. # color_annot_bulk: w
  1517. # linewidth: 1
  1518. # linestyle: None
  1519. # - var: i_current_x
  1520. # file: current_lines
  1521. # func: plot_current_lines
  1522. # cbarlabel: Electrical potential
  1523. # ax_locator_x: [0,20,40,60,80,100]
  1524. # ax_locator_y: [0,20,40,60,80,100]
  1525. # img_format: mp4
  1526. # isocontour: #True
  1527. # levels: 10 #10
  1528. # range: np.linspace(-1.5e-4,0,11)
  1529. # plot_bc: True
  1530. # plot_grid: True
  1531. # plot_levelset: True
  1532. # plot_levelset_segments: False
  1533. # plot_mode: contourf
  1534. # # range: [0,1e-4]
  1535. # ticks_format: '%.2e'
  1536. # xlim: [0,100]
  1537. # ylim: [0,100]
  1538. # linewidth: 1
  1539. # linestyle: 'dotted'
  1540. # zoom_mode: None
  1541. # #For current lines
  1542. # density: '[0.5,0.5]'
  1543. # streamplot_cbarlabel: "$ \\text{Current magnitude} ~ \\rightarrow$"
  1544. # streamplot_color: mag
  1545. # streamplot_mutation_scale: 5 #1 very small, 10 default?
  1546. # streamplot_lw: 0.25
  1547. # - var: i_current_mag
  1548. # file: i_current_mag
  1549. # cbarlabel: "Current magnitude"
  1550. # ax_locator_x: [0,20,40,60,80,100]
  1551. # ax_locator_y: [0,20,40,60,80,100]
  1552. # img_format: mp4
  1553. # isocontour: False
  1554. # levels: 10
  1555. # range: #np.linspace(48000,49000,11)
  1556. # plot_bc: True
  1557. # plot_grid: True
  1558. # plot_levelset: True
  1559. # plot_levelset_segments: False
  1560. # plot_mode: contourf
  1561. # xlim: [0,100]
  1562. # ylim: [0,100]
  1563. # linewidth: 1
  1564. # linestyle: None
  1565. # zoom_mode: None
  1566. # - var: normal_velocity_intfc
  1567. # file: normal_velocity_intfc_zoom
  1568. # func: plot_python_pdf_full2
  1569. # cbarlabel: normal_velocity_intfc
  1570. # img_format: mp4
  1571. # isocontour: False
  1572. # levels: 10
  1573. # plot_bc: True
  1574. # plot_grid: True
  1575. # plot_levelset: True
  1576. # plot_levelset_segments: False
  1577. # plot_mode: contourf
  1578. # range: [0,1e-4]
  1579. # ticks_format: '%.2e'
  1580. # xlim: [0,100]
  1581. # ylim: [0,100]
  1582. # linewidth: 1
  1583. # linestyle: None
  1584. # zoom: [[0,5],[0,5]]
  1585. # zoom_mode: index
  1586. # - var: levelset_p
  1587. # func: plot_python_pdf_full2
  1588. # file: levelset_p_zoom
  1589. # field_index: 1
  1590. # cbarlabel: LS
  1591. # fontsize: 4
  1592. # isocontour: False
  1593. # levels: 10
  1594. # plot_bc: True
  1595. # plot_grid: True
  1596. # plot_levelset: False
  1597. # plot_levelset_segments: False
  1598. # plot_mode: pcolormesh #contourf
  1599. # print_mode: "val"
  1600. # range: [0,1e-4]
  1601. # xlim: [0,100]
  1602. # ylim: [0,100]
  1603. # #zoom: [[0,5],[0,5]]
  1604. # #zoom_mode: index
  1605. # zoom: [[0,4],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1606. # zoom_mode: coord
  1607. # color_annot_bc: k #w
  1608. # color_annot_bulk: w
  1609. - var: concentration_H2_1DT
  1610. func: plot_python_pdf_full2
  1611. file: concentration_H2_zoom
  1612. macro_file_name: ['file_name+"_"+str(mesh["nx"])+"_"+plotpar["theme"]+ ".pdf"', 'file_name+"_"+str(mesh["nx"])+ "_"+plotpar["theme"]+".svg"']
  1613. cbarlabel: "$ \\text{Concentration} ~ \\ce{H2}$"
  1614. img_format: mp4
  1615. isocontour: False
  1616. levels: 10
  1617. range: np.linspace(48982,49000.001,11) #49000.001 for rounding errors, otherwise use extend parameter but we cannot check if c>>490000
  1618. plot_bc: True
  1619. plot_grid: True
  1620. plot_levelset: True
  1621. plot_levelset_segments: False
  1622. plot_mode: contourf
  1623. xlim: [0,100]
  1624. ylim: [0,100]
  1625. zoom: [[0,4],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1626. zoom_mode: coord
  1627. color_annot_bc: w
  1628. color_annot_bulk: w
  1629. linewidth: 1
  1630. linestyle: None
  1631. # - var: levelset_p
  1632. # func: plot_python_pdf_full2
  1633. # file: levelset_p_zoom_2
  1634. # figsize: None
  1635. # aspect_box: 'box'
  1636. # aspect_ratio: 'equal'
  1637. # cbarlabel: Levelset p
  1638. # color_LS: "#0072B2" #'cyan'
  1639. # img_format: mp4
  1640. # fontsize: 4
  1641. # isocontour: False
  1642. # levels: 0 #10
  1643. # range: 'np.linspace(-1,1,3)'
  1644. # plot_bc: True
  1645. # plot_wall: #True
  1646. # plot_grid: True
  1647. # plot_levelset: True
  1648. # plot_levelset_segments: #True
  1649. # plot_mode: contourf #contourf_LS #pcolormesh #contourf
  1650. # print_mode: "val"
  1651. # # range: [0,1e-4]
  1652. # xlim: [0,100]
  1653. # ylim: [0,100]
  1654. # zoom: [[0,4],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1655. # zoom_mode: coord
  1656. # color_annot_bc: w
  1657. # color_annot_bulk: w
  1658. # linewidth: 1
  1659. # linestyle: None
  1660. - var: levelset_p
  1661. func: plot_python_pdf_full2
  1662. file: levelset_p_zoom
  1663. figsize: None
  1664. aspect_box: 'box'
  1665. aspect_ratio: 'equal'
  1666. cbarlabel: Levelset p
  1667. color_LS: "#0072B2" #'cyan'
  1668. img_format: mp4
  1669. fontsize: 4
  1670. isocontour: False
  1671. levels: 0 #10
  1672. range: 'np.linspace(-1,1,3)'
  1673. plot_bc: True
  1674. plot_wall: #True
  1675. plot_grid: True
  1676. plot_levelset: True
  1677. plot_levelset_segments: #True
  1678. plot_mode: contourf_LS #pcolormesh #contourf
  1679. print_mode: "val"
  1680. # range: [0,1e-4]
  1681. xlim: [0,100]
  1682. ylim: [0,100]
  1683. zoom: [[0,4],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1684. zoom_mode: coord
  1685. color_annot_bc: w
  1686. color_annot_bulk: w
  1687. linewidth: 1
  1688. linestyle: None
  1689. - var: levelset_p
  1690. file: levelset_p
  1691. figsize: None
  1692. aspect_box: 'box'
  1693. aspect_ratio: 'equal'
  1694. ax_locator_x: [0,20,40,60,80,100]
  1695. ax_locator_y: [0,20,40,60,80,100]
  1696. cbarlabel: Levelset p
  1697. color_LS: "#0072B2" #'cyan'
  1698. img_format: mp4
  1699. fontsize: 4
  1700. isocontour: False
  1701. levels: 0 #10
  1702. range: 'np.linspace(-1,1,3)'
  1703. plot_bc: True
  1704. plot_wall: #True
  1705. plot_grid: True
  1706. plot_levelset: #True
  1707. plot_levelset_segments: #True
  1708. plot_mode: contourf_LS #pcolormesh #contourf
  1709. print_mode: "val"
  1710. # range: [0,1e-4]
  1711. xlim: [0,100]
  1712. ylim: [0,100]
  1713. # zoom: [[0,5],[0,5]]
  1714. # zoom_mode: index
  1715. # zoom: [[1,11],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1716. # zoom: [[0,10],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1717. # zoom: [[0,4],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  1718. # zoom_mode: coord
  1719. color_annot_bc: w
  1720. color_annot_bulk: w
  1721. linewidth: 1
  1722. linestyle: None
  1723. - var: p_1D
  1724. file: pressure
  1725. func: plot_file
  1726. cbarlabel: p
  1727. img_format: mp4
  1728. isocontour: False
  1729. levels: 10
  1730. plot_bc: True
  1731. plot_grid: True
  1732. plot_levelset: True
  1733. plot_levelset_segments: False
  1734. plot_mode: contourf
  1735. range: [0,1e-4]
  1736. ticks_format: '%.2e'
  1737. xlim: [0,100]
  1738. ylim: [0,100]
  1739. linewidth: 1
  1740. linestyle: None
  1741. # zoom: [[0,5],[0,5]]
  1742. zoom_mode: None
  1743. # - var: p_1D
  1744. # file: pressure_zoom
  1745. # func: plot_python_pdf_full2
  1746. # cbarlabel: p
  1747. # img_format: mp4
  1748. # isocontour: False
  1749. # levels: 10
  1750. # plot_bc: True
  1751. # plot_grid: True
  1752. # plot_levelset: True
  1753. # plot_levelset_segments: False
  1754. # plot_mode: contourf
  1755. # range: [0,1e-4]
  1756. # ticks_format: '%.2e'
  1757. # xlim: [0,100]
  1758. # ylim: [0,100]
  1759. # linewidth: 1
  1760. # linestyle: None
  1761. # zoom: [[0,5],[0,5]]
  1762. # zoom_mode: index
  1763. - var: velocity_x
  1764. file: velocity_vectors
  1765. func: plot_vector
  1766. img_format: mp4
  1767. plot_levelset: True
  1768. plot_levelset_segments: False
  1769. skip_every: 12
  1770. xlim: [0,100]
  1771. ylim: [0,100]
  1772. quiverkey: True
  1773. quiver_unit: m/s #given value v_inlet
  1774. quiver_x: 0.7
  1775. quiver_y: 0.05
  1776. linewidth: 1
  1777. linestyle: 'dotted'
  1778. # - var: concentration_H2O_1DT
  1779. # file: current_wall
  1780. # func: plot_current_wall
  1781. # axis_offset: 1.25
  1782. # img_format: mp4
  1783. # levels: 10
  1784. # labels: ['$c\left(H_2O\right)$', '$-\eta ~\text{(-overpotential)}$','Current']
  1785. # linestyles: ['(0, (3, 6))',
  1786. # '(3, (3, 6))', #"dashdot"
  1787. # '(6, (3, 6))'] #"dotted"
  1788. # ticks: ['np.linspace(48982,49000,10)','np.linspace(0.5,0.7,11)','np.linspace(0,1,11)']
  1789. # # ticks: ['np.linspace(40000,49000,10)','np.linspace(0.5,0.7,11)','np.linspace(0,1,11)']
  1790. # # range: np.linspace(-0,15,11)
  1791. # plot_bc: True
  1792. # plot_grid: True
  1793. # plot_levelset: True
  1794. # plot_levelset_segments: False
  1795. # plot_mode: contourf
  1796. # xlim: [0,100]
  1797. # ylim: [0,100]
  1798. # linewidth: 1
  1799. # linestyle: None
  1800. # zoom_mode: None
  1801. # - var: concentration_H2_1DT
  1802. # file: concentration_H2
  1803. # cbarlabel: "$ \\text{Concentration} ~ \\ce{H2}$"
  1804. # img_format: mp4
  1805. # isocontour: False
  1806. # levels: 0 #10
  1807. # range: np.linspace(-0,15,11)
  1808. # plot_bc: True
  1809. # plot_grid: True
  1810. # plot_levelset: True
  1811. # plot_levelset_segments: False
  1812. # plot_mode: contourf
  1813. # xlim: [0,100]
  1814. # ylim: [0,100]
  1815. # linewidth: 1
  1816. # linestyle: None
  1817. # zoom_mode: None
  1818. # - var: concentration_H2O_1DT
  1819. # file: concentration_H2O
  1820. # cbarlabel: "$ \\text{Concentration} ~ H_2O$"
  1821. # img_format: mp4
  1822. # isocontour: False
  1823. # levels: 0
  1824. # range: np.linspace(48982,49000.001,11) #49000.001 for rounding errors, otherwise use extend parameter but we cannot check if c>>490000
  1825. # plot_bc: True
  1826. # plot_grid: True
  1827. # plot_levelset: True
  1828. # plot_levelset_segments: False
  1829. # plot_mode: contourf
  1830. # xlim: [0,100]
  1831. # ylim: [0,100]
  1832. # linewidth: 1
  1833. # linestyle: None
  1834. # zoom_mode: None
  1835. - var: velocity_x
  1836. file: velocity_vectors
  1837. func: plot_vector
  1838. img_format: mp4
  1839. plot_levelset: True
  1840. plot_levelset_segments: False
  1841. skip_every: 12
  1842. xlim: [0,100]
  1843. ylim: [0,100]
  1844. quiverkey: True
  1845. quiver_unit: m/s #given value v_inlet
  1846. quiver_x: 0.7
  1847. quiver_y: 0.97
  1848. linewidth: 1
  1849. linestyle: 'dotted'
  1850. # - var: i_current_x
  1851. # file: current_lines
  1852. # func: plot_current_lines
  1853. # cbarlabel: Electrical potential
  1854. # img_format: mp4
  1855. # isocontour: #True
  1856. # levels: 10 #10
  1857. # range: np.linspace(-1.5e-4,0,11)
  1858. # plot_bc: True
  1859. # plot_grid: True
  1860. # plot_levelset: True
  1861. # plot_levelset_segments: False
  1862. # plot_mode: contourf
  1863. # # range: [0,1e-4]
  1864. # ticks_format: '%.2e'
  1865. # xlim: [0,100]
  1866. # ylim: [0,100]
  1867. # linewidth: 1
  1868. # linestyle: 'dotted'
  1869. # zoom_mode: None
  1870. # #For current lines
  1871. # density: '[0.5,0.5]'
  1872. # streamplot_color: mag
  1873. # streamplot_mutation_scale: 5 #1 very small, 10 default?
  1874. # streamplot_lw: 0.25
  1875. - var: v_1D
  1876. file: v_LS
  1877. cbarlabel: v
  1878. img_format: mp4
  1879. isocontour: False
  1880. levels: 10
  1881. plot_bc: True
  1882. plot_grid: True
  1883. plot_levelset: True
  1884. plot_levelset_segments: False
  1885. plot_mode: contourf
  1886. range: [0,1e-4]
  1887. ticks_format: '%.2e'
  1888. xlim: [0,100]
  1889. ylim: [0,100]
  1890. linewidth: 1
  1891. linestyle: None
  1892. zoom_mode: None
  1893. - var: u_1D
  1894. file: u_LS
  1895. cbarlabel: u
  1896. img_format: mp4
  1897. isocontour: False
  1898. levels: 10
  1899. plot_bc: True
  1900. plot_grid: True
  1901. plot_levelset: True
  1902. plot_levelset_segments: False
  1903. plot_mode: contourf
  1904. range: [0,1e-4]
  1905. ticks_format: '%.2e'
  1906. xlim: [0,100]
  1907. ylim: [0,100]
  1908. linewidth: 1
  1909. linestyle: None
  1910. zoom_mode: None
  1911. curves:
  1912. # macro_plot_BC: |
  1913. # inset_ax.text(
  1914. # 0,# xmin/2
  1915. # 0.5, r'$\frac{\partial c_{\ce{H2}} }{\partial n} = \frac{-i}{2FD}$',
  1916. # fontsize=fontsize,color='w',ha='left',va='center')
  1917. # inset_ax.text(0.65, 0.0, r'$c_{\ce{H2},0} $', fontsize=fontsize,va='bottom',ha='center',color='w')
  1918. # inset_ax.text(1.0, 0.5, r'$c_{\ce{H2},0}$', fontsize=fontsize,va='center',ha='right',color='w')
  1919. # inset_ax.text(0.65, 1.0, r'$\frac{\partial c_{\ce{H2}} }{\partial n} = 0$', fontsize=fontsize,va='top',ha='center',color='w')
  1920. # macro_show_slice: |
  1921. # linewidth_points = 1
  1922. # line, = inset_ax.plot([0, 0], [0, 1], ls='-',color='r',lw=linewidth_points)
  1923. # # shift the object over 2 points, and down 2 points
  1924. # dx, dy = +(linewidth_points/2)/72.,0
  1925. # offset = transforms.ScaledTranslation(dx, dy, fig.dpi_scale_trans)
  1926. # shadow_transform = inset_ax.transData + offset
  1927. # inset_ax.text(0.0,0.2, 'Slice',
  1928. # va='center',
  1929. # ha='left',
  1930. # transform = shadow_transform,
  1931. # color='r',
  1932. # fontsize=fontsize,
  1933. # )
  1934. - var: [[x_1D,concentration_H2_1DT]]
  1935. file: concentration_H2_through_bubble
  1936. func: plot_1D
  1937. fontsize: 10
  1938. labels: [["$x ( \\unit{\\um})$", "$ \\text{Concentration} ~ \\ce{H2}$" ]]
  1939. linestyles: ['(0, (3, 6))' ] #,
  1940. # '(3, (3, 6))', #"dashdot"
  1941. # '(6, (3, 6))'] #"dotted" #['-']
  1942. ticks: ['[0,20,40,60,80,100]', '[0,20,40,60,80,100]']
  1943. linewidth: 0.5
  1944. # plot_ref: '4* yml["flower"]["physics"]["v_inlet"]*x_1D*scale_x/(mesh["xmax"]-mesh["xmin"])*(1-x_1D*scale_x/(mesh["xmax"]-mesh["xmin"]))' #use "" not '' in ''
  1945. macro_file_name: ['file_name+"_"+plotpar["theme"]+ ".pdf"', 'file_name+"_"+plotpar["theme"]+".svg"']
  1946. macro_slice: "veci(reshape_data(data),nx,ny,field_index)[ny//2,:]"
  1947. add_schematics: True
  1948. add_schematics_coords: [0,1,0,0.001]
  1949. schematics_width: 40%
  1950. schematics_height: 40%
  1951. schematics_loc: center
  1952. macro_plot_BC: |
  1953. text_height = 0.3
  1954. inset_ax.text(
  1955. 0,# xmin/2
  1956. text_height, r'$\frac{\partial c_{\ce{H2}} }{\partial n} = \frac{-i}{2FD}$',
  1957. fontsize=fontsize,color='w',ha='left',va='center')
  1958. inset_ax.text(0.65, 0.0, r'$c_{\ce{H2},0} $', fontsize=fontsize,va='bottom',ha='center',color='w')
  1959. inset_ax.text(1.0, text_height, r'$c_{\ce{H2},0}$', fontsize=fontsize,va='center',ha='right',color='w')
  1960. inset_ax.text(0.65, 1.0, r'$\frac{\partial c_{\ce{H2}} }{\partial n} = 0$', fontsize=fontsize,va='top',ha='center',color='w')
  1961. macro_show_slice: |
  1962. linewidth_points = 1
  1963. line, = inset_ax.plot([0, 1], [0.5, 0.5], ls='-',color='r',lw=linewidth_points)
  1964. # shift the object over 2 points, and down 2 points
  1965. dx, dy = 0, +linewidth_points/72.
  1966. offset = transforms.ScaledTranslation(dx, dy, fig.dpi_scale_trans)
  1967. shadow_transform = inset_ax.transData + offset
  1968. inset_ax.text(0.5,0.5, 'Slice',
  1969. va='bottom',
  1970. ha='center',
  1971. transform = shadow_transform,
  1972. color='r',
  1973. fontsize=fontsize,
  1974. )
  1975. - var: [[x_1D,phi_ele_1D]]
  1976. file: phi_through_bubble #_poisson_iter
  1977. func: plot_1D
  1978. fontsize: 10
  1979. labels: [["$x ( \\unit{\\um})$", "$ \\text{Electrical potential} ~ (\\unit{V})$"]]
  1980. legend_pos: upper center
  1981. linestyles: ['(0, (3, 6))' ] #,
  1982. # '(3, (3, 6))', #"dashdot"
  1983. # '(6, (3, 6))'] #"dotted" #['-']
  1984. ticks: ['[0,20,40,60,80,100]', '[0,20,40,60,80,100]']
  1985. linewidth: 0.5
  1986. # plot_ref: '4* yml["flower"]["physics"]["v_inlet"]*x_1D*scale_x/(mesh["xmax"]-mesh["xmin"])*(1-x_1D*scale_x/(mesh["xmax"]-mesh["xmin"]))' #use "" not '' in ''
  1987. macro_slice: "veci(reshape_data(data),nx,ny,field_index)[ny//2,:]"
  1988. add_schematics: True
  1989. add_schematics_coords: [0,1,0,0.001]
  1990. schematics_width: 40%
  1991. schematics_height: 40%
  1992. schematics_loc: lower right
  1993. macro_show_slice: |
  1994. linewidth_points = 1
  1995. line, = inset_ax.plot([0, 1], [0.5, 0.5], ls='-',color='r',lw=linewidth_points)
  1996. # shift the object over 2 points, and down 2 points
  1997. dx, dy = 0, -linewidth_points/72.
  1998. offset = transforms.ScaledTranslation(dx, dy, fig.dpi_scale_trans)
  1999. shadow_transform = inset_ax.transData + offset
  2000. inset_ax.text(0.5,0.5, 'Slice',
  2001. va='top',
  2002. ha='center',
  2003. transform = shadow_transform,
  2004. color='r',
  2005. fontsize=fontsize,
  2006. )
  2007. macro: |
  2008. # label1 = str(file['poisson_iter'][()])
  2009. global label2
  2010. label2 = label1
  2011. # X = varx*scale_x
  2012. # Y = slice_1D
  2013. # # Add a column of ones to X to account for the intercept
  2014. # X = np.vstack([X, np.ones(len(X))]).T
  2015. # # Perform least squares fit
  2016. # coefficients, residuals, rank, s = np.linalg.lstsq(X, Y, rcond=None)
  2017. # # coefficients[0] is the slope, coefficients[1] is the intercept
  2018. # slope, intercept = coefficients
  2019. # # slope = slope/scale_x #rescale if X not resaled
  2020. # print(f"Slope: {slope}, Intercept: {intercept}")
  2021. # import numpy as np
  2022. # from scipy.stats import pearsonr
  2023. # # Calculate the correlation coefficient and p-value
  2024. # correlation_coefficient, p_value = pearsonr(varx*scale_x, slice_1D)
  2025. # print(f"Correlation Coefficient: {correlation_coefficient}")
  2026. # # print(f"P-value: {p_value}")
  2027. # global label2
  2028. # # label2 = label1 + " slope " + str(slope) + " R2 " + str(correlation_coefficient)
  2029. # label2 = label1 + r"$\mathrm{{{text}}}: {slope:.3e}, R^2: {R2:.2f}".format(text=', slope',slope=slope,R2=correlation_coefficient) + '$'
  2030. # # print(label1)
  2031. # # print(label2)
  2032. # - var: [[x_1D,phi_ele_1D]]
  2033. # file: poisson_iter
  2034. # func: plot_1D
  2035. # labels: [["$x ( \\unit{\\um})$", "$ \\text{Electrical potential} ~ (\\unit{V})$"]]
  2036. # linestyles: ['(0, (3, 6))' ] #,
  2037. # # '(3, (3, 6))', #"dashdot"
  2038. # # '(6, (3, 6))'] #"dotted" #['-']
  2039. # ticks: ['[0,20,40,60,80,100]', '[0,20,40,60,80,100]']
  2040. # linewidth: 0.5
  2041. # # plot_ref: '4* yml["flower"]["physics"]["v_inlet"]*x_1D*scale_x/(mesh["xmax"]-mesh["xmin"])*(1-x_1D*scale_x/(mesh["xmax"]-mesh["xmin"]))' #use "" not '' in ''
  2042. # macro_file_name: ['file_name+"_mesh"+str(nx)+ ".pdf"', 'file_name+"_mesh"+str(nx)+".svg"']
  2043. # macro_slice: "veci(reshape_data(data),nx,ny,field_index)[0,:]"
  2044. # # macro_show_slice: |
  2045. # # linewidth_points = 1
  2046. # # line, = inset_ax.plot([0, 1], [0.5, 0.5], ls='-',color='r',lw=linewidth_points)
  2047. # # # shift the object over 2 points, and down 2 points
  2048. # # dx, dy = 0, -linewidth_points/72.
  2049. # # offset = transforms.ScaledTranslation(dx, dy, fig.dpi_scale_trans)
  2050. # # shadow_transform = inset_ax.transData + offset
  2051. # # inset_ax.text(0.5,0.5, 'Slice',
  2052. # # va='top',
  2053. # # ha='center',
  2054. # # transform = shadow_transform,
  2055. # # color='r',
  2056. # # fontsize=fontsize,
  2057. # # )
  2058. # macro: |
  2059. # X = varx*scale_x
  2060. # Y = slice_1D
  2061. # # Add a column of ones to X to account for the intercept
  2062. # X = np.vstack([X, np.ones(len(X))]).T
  2063. # # Perform least squares fit
  2064. # coefficients, residuals, rank, s = np.linalg.lstsq(X, Y, rcond=None)
  2065. # # coefficients[0] is the slope, coefficients[1] is the intercept
  2066. # slope, intercept = coefficients
  2067. # # slope = slope/scale_x #rescale if X not resaled
  2068. # print(f"Slope: {slope}, Intercept: {intercept}")
  2069. # import numpy as np
  2070. # from scipy.stats import pearsonr
  2071. # # Calculate the correlation coefficient and p-value
  2072. # correlation_coefficient, p_value = pearsonr(varx*scale_x, slice_1D)
  2073. # print(f"Correlation Coefficient: {correlation_coefficient}")
  2074. # # print(f"P-value: {p_value}")
  2075. # label1 = str(file['poisson_iter'][()])
  2076. # global label2
  2077. # # label2 = label1 + " slope " + str(slope) + " R2 " + str(correlation_coefficient)
  2078. # # label2 = label1 + r"$\mathrm{{{text}}}: {slope:.3e}, R^2: {R2:.2f}".format(text=', slope',slope=slope,R2=correlation_coefficient) + '$'
  2079. # residual = file['residual_electrical_potential'][()]
  2080. # label2 = label1 + r"$\mathrm{{{text}}}: {slope:.3e}, \mathrm{{{textres}}}: {residual:.3e}".format(text=', slope',slope=slope,R2=correlation_coefficient,textres='res',residual=residual) + '$'
  2081. # # label2 = label2 + str(file['residual_electrical_potential'][()])
  2082. # # print(label1)
  2083. # # print(label2)
  2084. # # variation = file['variation_electrical_potential'][()]
  2085. - var: [[x_1D,phi_ele_1D]]
  2086. file: phi
  2087. func: plot_1D
  2088. labels: [["$x ( \\unit{\\um})$", "$ \\text{Electrical potential} ~ (\\unit{V})$"]]
  2089. linestyles: ['(0, (3, 6))' ] #,
  2090. # '(3, (3, 6))', #"dashdot"
  2091. # '(6, (3, 6))'] #"dotted" #['-']
  2092. ticks: ['[0,20,40,60,80,100]', '[0,20,40,60,80,100]']
  2093. linewidth: 0.5
  2094. # plot_ref: '4* yml["flower"]["physics"]["v_inlet"]*x_1D*scale_x/(mesh["xmax"]-mesh["xmin"])*(1-x_1D*scale_x/(mesh["xmax"]-mesh["xmin"]))' #use "" not '' in ''
  2095. macro_slice: "veci(reshape_data(data),nx,ny,field_index)[0,:]"
  2096. add_schematics: True
  2097. add_schematics_coords: [0,1,0,0.001]
  2098. schematics_width: 40%
  2099. schematics_height: 40%
  2100. schematics_loc: upper left
  2101. macro_show_slice: |
  2102. linewidth_points = 1
  2103. slice_pos = 0.0
  2104. line, = inset_ax.plot([0, 1], [slice_pos, slice_pos], ls='-',color='r',lw=linewidth_points,zorder=10)
  2105. # shift the object over 2 points, and down 2 points
  2106. dx, dy = 0, +linewidth_points/72.
  2107. offset = transforms.ScaledTranslation(dx, dy, fig.dpi_scale_trans)
  2108. shadow_transform = inset_ax.transData + offset
  2109. inset_ax.text(0.2,slice_pos, 'Slice',
  2110. va='bottom',
  2111. ha='center',
  2112. transform = shadow_transform,
  2113. color='r',
  2114. fontsize=fontsize,
  2115. )
  2116. macro: |
  2117. X = varx*scale_x
  2118. Y = slice_1D
  2119. # Add a column of ones to X to account for the intercept
  2120. X = np.vstack([X, np.ones(len(X))]).T
  2121. # Perform least squares fit
  2122. coefficients, residuals, rank, s = np.linalg.lstsq(X, Y, rcond=None)
  2123. # coefficients[0] is the slope, coefficients[1] is the intercept
  2124. slope, intercept = coefficients
  2125. # slope = slope/scale_x #rescale if X not resaled
  2126. print(f"Slope: {slope}, Intercept: {intercept}")
  2127. import numpy as np
  2128. from scipy.stats import pearsonr
  2129. # Calculate the correlation coefficient and p-value
  2130. correlation_coefficient, p_value = pearsonr(varx*scale_x, slice_1D)
  2131. print(f"Correlation Coefficient: {correlation_coefficient}")
  2132. # print(f"P-value: {p_value}")
  2133. global label2
  2134. # label2 = label1 + " slope " + str(slope) + " R2 " + str(correlation_coefficient)
  2135. label2 = label1 + r"$\mathrm{{{text}}}: {slope:.3e}, R^2: {R2:.2f}".format(text=', slope',slope=slope,R2=correlation_coefficient) + '$'
  2136. # print(label1)
  2137. # print(label2)
  2138. # - var: [[y_1D,phi_ele_1D]]
  2139. # file: phi_wall
  2140. # func: plot_1D
  2141. # labels: [["$y ( \\unit{\\um})$", "$ \\text{Electrical potential} ~ (\\unit{V})$"]]
  2142. # linestyles: ['(0, (3, 6))' ] #,
  2143. # # '(3, (3, 6))', #"dashdot"
  2144. # # '(6, (3, 6))'] #"dotted" #['-']
  2145. # ticks: ['[0,20,40,60,80,100]', '[0,20,40,60,80,100]']
  2146. # linewidth: 0.5
  2147. # # plot_ref: '4* yml["flower"]["physics"]["v_inlet"]*x_1D*scale_x/(mesh["xmax"]-mesh["xmin"])*(1-x_1D*scale_x/(mesh["xmax"]-mesh["xmin"]))' #use "" not '' in ''
  2148. # macro_slice: "vecb_L(reshape_data(data),nx,ny)" #"reshape_data_veci(data,nx,ny,field_index)[:,0]"
  2149. - var: [[y_1D,phi_ele_1D]]
  2150. file: phi_wall #_poisson_iter
  2151. func: plot_1D
  2152. fontsize: 10
  2153. labels: [["$y ( \\unit{\\um})$", "$ \\text{Electrical potential} ~ (\\unit{V})$"]]
  2154. linestyles: ['(0, (3, 6))' ] #,
  2155. # '(3, (3, 6))', #"dashdot"
  2156. # '(6, (3, 6))'] #"dotted" #['-']
  2157. ticks: ['[0,20,40,60,80,100]', '[0,20,40,60,80,100]']
  2158. linewidth: 0.5
  2159. # plot_ref: '4* yml["flower"]["physics"]["v_inlet"]*x_1D*scale_x/(mesh["xmax"]-mesh["xmin"])*(1-x_1D*scale_x/(mesh["xmax"]-mesh["xmin"]))' #use "" not '' in ''
  2160. # macro_file_name: ['file_name+"_"+str(mesh["nx"])+"_"+plotpar["theme"]+ ".pdf"', 'file_name+"_"+str(mesh["nx"])+ "_"+plotpar["theme"]+".svg"']
  2161. macro_file_name: ['file_name+"_"+plotpar["theme"]+ ".pdf"', 'file_name+"_"+plotpar["theme"]+".svg"']
  2162. macro_slice: "vecb_L(reshape_data(data),nx,ny)" #"reshape_data_veci(data,nx,ny,field_index)[:,0]"
  2163. add_schematics: True
  2164. add_schematics_coords: [0,1,0,0.001]
  2165. schematics_width: 40%
  2166. schematics_height: 40%
  2167. schematics_loc: center left
  2168. macro_show_slice: |
  2169. linewidth_points = 1
  2170. line, = inset_ax.plot([0, 0], [0, 1], ls='-',color='r',lw=linewidth_points)
  2171. # shift the object over 2 points, and down 2 points
  2172. dx, dy = +(linewidth_points/2)/72.,0
  2173. offset = transforms.ScaledTranslation(dx, dy, fig.dpi_scale_trans)
  2174. shadow_transform = inset_ax.transData + offset
  2175. inset_ax.text(0.0,0.2, 'Slice',
  2176. va='center',
  2177. ha='left',
  2178. transform = shadow_transform,
  2179. color='r',
  2180. fontsize=fontsize,
  2181. )
  2182. - var: [[y_1D,concentration_KOH_1DT]]
  2183. file: concentration_KOH_wall #_poisson_iter
  2184. func: plot_1D
  2185. fontsize: 10
  2186. labels: [["$y ( \\unit{\\um})$", "$ \\text{Concentration} ~ KOH$" ]]
  2187. linestyles: ['(0, (3, 6))' ] #,
  2188. # '(3, (3, 6))', #"dashdot"
  2189. # '(6, (3, 6))'] #"dotted" #['-']
  2190. ticks: ['[0,20,40,60,80,100]', '[0,20,40,60,80,100]']
  2191. linewidth: 0.5
  2192. # plot_ref: '4* yml["flower"]["physics"]["v_inlet"]*x_1D*scale_x/(mesh["xmax"]-mesh["xmin"])*(1-x_1D*scale_x/(mesh["xmax"]-mesh["xmin"]))' #use "" not '' in ''
  2193. # macro_file_name: ['file_name+"_"+str(mesh["nx"])+"_"+plotpar["theme"]+ ".pdf"', 'file_name+"_"+str(mesh["nx"])+ "_"+plotpar["theme"]+".svg"']
  2194. macro_file_name: ['file_name+"_"+plotpar["theme"]+ ".pdf"', 'file_name+"_"+plotpar["theme"]+".svg"']
  2195. macro_slice: "vecb_L(reshape_data(data),nx,ny)" #"reshape_data_veci(data,nx,ny,field_index)[:,0]"
  2196. add_schematics: True
  2197. add_schematics_coords: [0,1,0,0.001]
  2198. schematics_width: 40%
  2199. schematics_height: 40%
  2200. schematics_loc: center
  2201. macro_plot_BC: |
  2202. inset_ax.text(
  2203. 0,# xmin/2
  2204. 0.5, r'$\frac{\partial c_{\ce{KOH}} }{\partial n} = \frac{-i}{2FD}$',
  2205. fontsize=fontsize,color='w',ha='left',va='center')
  2206. inset_ax.text(0.65, 0.0, r'$c_{\ce{KOH},0} $', fontsize=fontsize,va='bottom',ha='center',color='w')
  2207. inset_ax.text(1.0, 0.5, r'$c_{\ce{KOH},0}$', fontsize=fontsize,va='center',ha='right',color='w')
  2208. inset_ax.text(0.65, 1.0, r'$\frac{\partial c_{\ce{KOH}} }{\partial n} = 0$', fontsize=fontsize,va='top',ha='center',color='w')
  2209. macro_show_slice: |
  2210. linewidth_points = 1
  2211. line, = inset_ax.plot([0, 0], [0, 1], ls='-',color='r',lw=linewidth_points)
  2212. # shift the object over 2 points, and down 2 points
  2213. dx, dy = +(linewidth_points/2)/72.,0
  2214. offset = transforms.ScaledTranslation(dx, dy, fig.dpi_scale_trans)
  2215. shadow_transform = inset_ax.transData + offset
  2216. inset_ax.text(0.0,0.2, 'Slice',
  2217. va='center',
  2218. ha='left',
  2219. transform = shadow_transform,
  2220. color='r',
  2221. fontsize=fontsize,
  2222. )
  2223. - var: [[y_1D,concentration_H2_1DT]]
  2224. file: concentration_H2_wall #_poisson_iter
  2225. func: plot_1D
  2226. fontsize: 10
  2227. labels: [["$y ( \\unit{\\um})$", "$ \\text{Concentration} ~ \\ce{H2}$" ]]
  2228. linestyles: ['(0, (3, 6))' ] #,
  2229. # '(3, (3, 6))', #"dashdot"
  2230. # '(6, (3, 6))'] #"dotted" #['-']
  2231. ticks: ['[0,20,40,60,80,100]', '[0,20,40,60,80,100]']
  2232. linewidth: 0.5
  2233. # plot_ref: '4* yml["flower"]["physics"]["v_inlet"]*x_1D*scale_x/(mesh["xmax"]-mesh["xmin"])*(1-x_1D*scale_x/(mesh["xmax"]-mesh["xmin"]))' #use "" not '' in ''
  2234. # macro_file_name: ['file_name+"_"+str(mesh["nx"])+"_"+plotpar["theme"]+ ".pdf"', 'file_name+"_"+str(mesh["nx"])+ "_"+plotpar["theme"]+".svg"']
  2235. macro_file_name: ['file_name+"_"+plotpar["theme"]+ ".pdf"', 'file_name+"_"+plotpar["theme"]+".svg"']
  2236. macro_slice: "vecb_L(reshape_data(data),nx,ny)" #"reshape_data_veci(data,nx,ny,field_index)[:,0]"
  2237. add_schematics: True
  2238. add_schematics_coords: [0,1,0,0.001]
  2239. schematics_width: 40%
  2240. schematics_height: 40%
  2241. schematics_loc: center
  2242. macro_plot_BC: |
  2243. inset_ax.text(
  2244. 0,# xmin/2
  2245. 0.5, r'$\frac{\partial c_{\ce{H2}} }{\partial n} = \frac{-i}{2FD}$',
  2246. fontsize=fontsize,color='w',ha='left',va='center')
  2247. inset_ax.text(0.65, 0.0, r'$c_{\ce{H2},0} $', fontsize=fontsize,va='bottom',ha='center',color='w')
  2248. inset_ax.text(1.0, 0.5, r'$c_{\ce{H2},0}$', fontsize=fontsize,va='center',ha='right',color='w')
  2249. inset_ax.text(0.65, 1.0, r'$\frac{\partial c_{\ce{H2}} }{\partial n} = 0$', fontsize=fontsize,va='top',ha='center',color='w')
  2250. macro_show_slice: |
  2251. linewidth_points = 1
  2252. line, = inset_ax.plot([0, 0], [0, 1], ls='-',color='r',lw=linewidth_points)
  2253. # shift the object over 2 points, and down 2 points
  2254. dx, dy = +(linewidth_points/2)/72.,0
  2255. offset = transforms.ScaledTranslation(dx, dy, fig.dpi_scale_trans)
  2256. shadow_transform = inset_ax.transData + offset
  2257. inset_ax.text(0.0,0.2, 'Slice',
  2258. va='center',
  2259. ha='left',
  2260. transform = shadow_transform,
  2261. color='r',
  2262. fontsize=fontsize,
  2263. )
  2264. # - var: [[y_1D,concentration_KOH_1DT]]
  2265. # file: concentration_KOH_wall
  2266. # func: plot_1D
  2267. # labels: [["$y ( \\unit{\\um})$", "$ \\text{Concentration} ~ KOH$" ]]
  2268. # linestyles: ['(0, (3, 6))' ] #,
  2269. # # '(3, (3, 6))', #"dashdot"
  2270. # # '(6, (3, 6))'] #"dotted" #['-']
  2271. # ticks: ['[0,20,40,60,80,100]', '[0,20,40,60,80,100]']
  2272. # linewidth: 0.5
  2273. # # plot_ref: '4* yml["flower"]["physics"]["v_inlet"]*x_1D*scale_x/(mesh["xmax"]-mesh["xmin"])*(1-x_1D*scale_x/(mesh["xmax"]-mesh["xmin"]))' #use "" not '' in ''
  2274. # # macro_file_name: ['file_name+"_"+str(mesh["nx"])+"_"+plotpar["theme"]+ ".pdf"', 'file_name+"_"+str(mesh["nx"])+ "_"+plotpar["theme"]+".svg"']
  2275. # macro_file_name: ['file_name+"_"+plotpar["theme"]+ ".pdf"', 'file_name+"_"+plotpar["theme"]+".svg"']
  2276. # macro_slice: "vecb_L(reshape_data(data),nx,ny)" #"reshape_data_veci(data,nx,ny,field_index)[:,0]"
  2277. # - var: concentration_H2_1DT
  2278. # func: plot_python_pdf_full2
  2279. # file: concentration_H2_zoom_no_bc
  2280. # cbarlabel: "$ \\text{Concentration} ~ \\ce{H2}$"
  2281. # img_format: pdf
  2282. # isocontour: False
  2283. # levels: 10
  2284. # range: np.linspace(48982,49000.001,11) #49000.001 for rounding errors, otherwise use extend parameter but we cannot check if c>>490000
  2285. # plot_bc: #True
  2286. # plot_grid: True
  2287. # plot_levelset: True
  2288. # plot_levelset_segments: False
  2289. # plot_mode: contourf
  2290. # xlim: [0,100]
  2291. # ylim: [0,100]
  2292. # zoom: [[0,10],[45,55]] #[[1,10],[45,55]] activates BC plot so no longer square
  2293. # zoom_mode: coord
  2294. # color_annot_bc: w
  2295. # color_annot_bulk: w
  2296. # linewidth: 1
  2297. # linestyle: None
  2298. # macro: |
  2299. # global label2
  2300. # label1 = str(file['poisson_iter'][()])
  2301. # label2 = label1 +" "+ r"$\phi_\mathrm{{{text}}}: {val:.3e}".format(text='wall',val=np.mean(slice_1D)) + '$'
  2302. # print(colored(label2,'red'))
  2303. # - var: [[poisson_iter,phi_ele_1D]]
  2304. # file: phi_wall_poisson_iter_log
  2305. # func: plot_1D
  2306. # fontsize: 10
  2307. # labels: [["Number of iterations", "$|\\phi-\\phi^e|/|\\phi^e|$"]]
  2308. # linestyles: ['(0, (3, 6))' ] #,
  2309. # # '(3, (3, 6))', #"dashdot"
  2310. # # '(6, (3, 6))'] #"dotted" #['-']
  2311. # ticks: ['[1,2,3,4,5]', '[0,20,40,60,80,100]']
  2312. # linewidth: 0.5
  2313. # # plot_ref: '4* yml["flower"]["physics"]["v_inlet"]*x_1D*scale_x/(mesh["xmax"]-mesh["xmin"])*(1-x_1D*scale_x/(mesh["xmax"]-mesh["xmin"]))' #use "" not '' in ''
  2314. # macro_slice: "abs((np.mean(vecb_L(reshape_data(data),nx,ny))-(-0.011655612832847977)))/0.011655612832847977"
  2315. # logplot: True
  2316. # logplot_x: False
  2317. # logplot_y: True
  2318. # slope_start: 2
  2319. # slope_stop: 10
  2320. # legend: False
  2321. # # add_schematics: True
  2322. # add_schematics_coords: [0,1,0,0.001]
  2323. # schematics_width: 40%
  2324. # schematics_height: 40%
  2325. # schematics_loc: upper left
  2326. # macro_show_slice: |
  2327. # linewidth_points = 1
  2328. # line, = inset_ax.plot([0, 0], [0, 1], ls='-',color='r',lw=linewidth_points)
  2329. # # shift the object over 2 points, and down 2 points
  2330. # dx, dy = +(linewidth_points/2)/72.,0
  2331. # offset = transforms.ScaledTranslation(dx, dy, fig.dpi_scale_trans)
  2332. # shadow_transform = inset_ax.transData + offset
  2333. # inset_ax.text(0.0,0.2, 'Slice',
  2334. # va='center',
  2335. # ha='left',
  2336. # transform = shadow_transform,
  2337. # color='r',
  2338. # fontsize=fontsize,
  2339. # )
  2340. # macro: |
  2341. # label1 = str(file['poisson_iter'][()])
  2342. # global label2
  2343. # label1 = str(file['poisson_iter'][()])
  2344. # label2 = label1 +" "+ r"$\phi_\mathrm{{{text}}}: {val:.3e}".format(text='wall',val=np.mean(slice_1D)) + '$'
  2345. # print(colored(label2,'red'))
  2346. # label2=None
  2347. - var: [l1_rel_error,l2_rel_error,linfty_rel_error]
  2348. func: plot_errors_from_h5
  2349. file: errors
  2350. slope_start: 32 #16
  2351. slope_stop: 256
  2352. xlim: [1e-3,1e-1]
  2353. - var: [l1_rel_error_full_cells,l2_rel_error_full_cells,linfty_rel_error_full_cells]
  2354. func: plot_errors_from_h5
  2355. file: errors_full_cells
  2356. slope_start: 32 #16
  2357. slope_stop: 256
  2358. xlim: [1e-3,1e-1]
  2359. - var: [l1_rel_error_partial_cells,l2_rel_error_partial_cells,linfty_rel_error_partial_cells]
  2360. func: plot_errors_from_h5
  2361. file: errors_partial_cells
  2362. slope_start: 32 #16
  2363. slope_stop: 256
  2364. xlim: [1e-3,1e-1]
  2365. - var: radius
  2366. file: radius
  2367. slope_start: 1.2e-4 #2e-4
  2368. slope_stop: 1e-3
  2369. # cbarlabel: H2 #'$Concentration H_2$'
  2370. # img_format: mp4
  2371. # isocontour: False
  2372. # levels: 10
  2373. # plot_bc: True
  2374. # plot_grid: True
  2375. # plot_levelset: True
  2376. # plot_levelset_segments: False
  2377. # plot_mode: contourf
  2378. # range: [0,1e-4]
  2379. # xlim: [0,100]
  2380. # ylim: [0,100]
  2381. # linewidth: 1
  2382. # linestyle: None
  2383. # zoom_mode: None
  2384. # - var: i_current_x
  2385. # file: current_wall
  2386. # func: plot_current_wall
  2387. schematics:
  2388. # - file: boundary_conditions_diffusion
  2389. # - file: boundary_conditions_diffusion
  2390. # func: plot_schematics_full
  2391. # fig_ratio: 0.5
  2392. - file: schematics_full_with_losses
  2393. func: plot_schematics_full_with_losses
  2394. fig_ratio: 0.5
  2395. - file: schematics_full
  2396. func: plot_schematics_full
  2397. font_size: 8
  2398. - file: schematics
  2399. func: plot_schematics
  2400. # fig_ratio: 0.5
  2401. - file: schematics_fluxes
  2402. func: plot_schematics_fluxes
  2403. # fig_ratio: 0.5
  2404. #TODO call compute_grad_phi_ele! only when needed
  2405. #TODO call us, vs interpolation only when needed
  2406. #TODO sparse data (H5 fill value or chunked ?)
  2407. #TODO LS could be sparse too
  2408. #TODO struct grid_u.LS[iLS].u[:,:] more difficult than [:,:,:]
  2409. #TODO fig size
  2410. pdi:
  2411. metadata: # type of small values for which PDI keeps a copy
  2412. nx: int64 #Domain size per proc
  2413. ny: int64 #Domain size per proc
  2414. mpi_max_coords_x: int64 #MPI decomposition
  2415. mpi_max_coords_y: int64 #MPI decomposition
  2416. mpi_coords_x: int64 #MPI coordinate of the current process
  2417. mpi_coords_y: int64 #MPI coordinate of the current process
  2418. time: double #Time
  2419. nstep: int64 #Index for naming files
  2420. nb_transported_scalars: int64
  2421. nb_levelsets: int64
  2422. radius: double
  2423. intfc_vtx_num: int64 # number of vertices to describe the interface
  2424. intfc_seg_num: int64 #number of segments
  2425. vtx_num: int64 # number of vertices for debugging phase-change
  2426. nb_Navier_slip_BC: int64 #number of Navier BC
  2427. timestep: double
  2428. rise_velocity_y: double
  2429. mean_phase_change_velocity: double
  2430. cell_length: double
  2431. data: # values for which PDI does not keep a copy
  2432. #in Flower: zeros((n.nLS + 1) * g.ny * g.nx + 2 * g.nx + 2 * g.ny)
  2433. #Field of the current subdomain
  2434. #Bulk, interface and border u velocity, ...
  2435. # u grid nx+1, ny
  2436. # v grid nx, ny
  2437. # p grid (scalar): nx, ny
  2438. # In Flower : vec "1D" bulk: 1:nx*ny, ith levelset: ...i*ny*nx
  2439. # stored in 1D
  2440. u_1D: { size: '($nb_levelsets + 1) * ($ny) * ($nx+1) + 2 * ($nx+1) + 2 * $ny', type: array, subtype: double }
  2441. v_1D: { size: '($nb_levelsets + 1) * ($ny+1) * ($nx) + 2 * ($nx) + 2 * ($ny+1)', type: array, subtype: double }
  2442. p_1D: { size: '($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * ($ny)', type: array, subtype: double }
  2443. # trans_scal_1D: { size: ['($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny','$nb_transported_scalars'], type: array, subtype: double }
  2444. trans_scal_1DT: { size: ['$nb_transported_scalars','($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny'], type: array, subtype: double }
  2445. phi_ele_1D: { size: '($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny', type: array, subtype: double }
  2446. rhs_1D: { size: '($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny', type: array, subtype: double }
  2447. # rhs_uv_1D:
  2448. # size: '($nb_levelsets - $nb_Navier_slip_BC + 1) * ($ny) * ($nx+1) + 2 * ($nx+1) + 2 * $ny + ($nb_levelsets -$nb_Navier_slip_BC + 1) * ($ny+1) * ($nx) + 2 * ($nx) + 2 * ($ny+1) +($nb_Navier_slip_BC + $nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * ($ny)'
  2449. # type: array
  2450. # subtype: double
  2451. rhs_uv_1D: { size: '$rhs_uv_len', type: array, subtype: double }
  2452. vec_1D: { size: '$vec_1D_len', type: array, subtype: double }
  2453. Auv_colptr_1D: { size: '$Auv_colptr_len', type: array, subtype: int64 }
  2454. Auv_rowval_1D: { size: '$Auv_rowval_len', type: array, subtype: int64 }
  2455. Auv_nzval_1D: { size: '$Auv_nzval_len', type: array, subtype: double }
  2456. Auv_colptr_len: int64
  2457. Auv_rowval_len: int64
  2458. Auv_nzval_len: int64
  2459. Auv_n: int64
  2460. Auv_m: int64
  2461. rhs_uv_len: int64
  2462. vec_1D_len: int64
  2463. elec_cond_1D: { size: '($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny', type: array, subtype: double }
  2464. mesh_x_1D: { size: '($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny', type: array, subtype: double }
  2465. mesh_y_1D: { size: '($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny', type: array, subtype: double }
  2466. residual_1D: { size: '($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny', type: array, subtype: double }
  2467. # for computations, to ignore small cells
  2468. mask_1D: { size: '($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny', type: array, subtype: double }
  2469. grad_x_1D: { size: ' ($ny) * ($nx+1) ', type: array, subtype: double }
  2470. grad_y_1D: { size: ' ($ny+1) * ($nx) ', type: array, subtype: double }
  2471. #BC
  2472. BC_phi_ele_left: { size: '$ny', type: array, subtype: double }
  2473. # trans_scal_1D_H2: { size: '($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny', type: array, subtype: double }
  2474. # trans_scal_1D_KOH: { size: '($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny', type: array, subtype: double }
  2475. # trans_scal_1D_H2O: { size: '($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny', type: array, subtype: double }
  2476. # stored in 1D: tests
  2477. l1_rel_error: { size: '$n_tests', type: array, subtype: double }
  2478. l2_rel_error: { size: '$n_tests', type: array, subtype: double }
  2479. linfty_rel_error: { size: '$n_tests', type: array, subtype: double }
  2480. l1_rel_error_full_cells: { size: '$n_tests', type: array, subtype: double }
  2481. l2_rel_error_full_cells: { size: '$n_tests', type: array, subtype: double }
  2482. linfty_rel_error_full_cells: { size: '$n_tests', type: array, subtype: double }
  2483. l1_rel_error_partial_cells: { size: '$n_tests', type: array, subtype: double }
  2484. l2_rel_error_partial_cells: { size: '$n_tests', type: array, subtype: double }
  2485. linfty_rel_error_partial_cells: { size: '$n_tests', type: array, subtype: double }
  2486. nx_list: { size: '$n_tests', type: array, subtype: int64 }
  2487. cell_volume_list: { size: '$n_tests', type: array, subtype: double }
  2488. n_tests: int64
  2489. domain_length: double
  2490. min_cell_volume: double
  2491. # Store segments of interface in 1D vectors
  2492. intfc_vtx_x: { size: '$intfc_vtx_num', type: array, subtype: double } #TODO vector x y fields all together in size: [ '$intfc_vtx_num', '$nscalars+2' ]
  2493. intfc_vtx_y: { size: '$intfc_vtx_num', type: array, subtype: double }
  2494. vtx_x: { size: '$vtx_num', type: array, subtype: double } #TODO vector x y fields all together in size: [ '$intfc_vtx_num', '$nscalars+2' ]
  2495. vtx_y: { size: '$vtx_num', type: array, subtype: double }
  2496. intfc_vtx_field: { size: '$intfc_vtx_num', type: array, subtype: double }
  2497. # intfc_vtx_connectivities: { size: '2*($intfc_vtx_num)', type: array, subtype: int64 }
  2498. intfc_vtx_connectivities: { size: '2*($intfc_seg_num)', type: array, subtype: int64 }
  2499. # stored in 2D
  2500. i_current_x: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2501. i_current_y: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2502. i_current_mag: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2503. levelset_iso: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2504. levelset_p: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2505. levelset_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2506. levelset_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2507. advection_velocity_p: { size: [ '$nx', '$ny' ], type: array, subtype: double }
  2508. advection_velocity_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double }
  2509. advection_velocity_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double }
  2510. advection_velocity_bulk_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double }
  2511. advection_velocity_bulk_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double }
  2512. advection_velocity_phase_change_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double }
  2513. advection_velocity_phase_change_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double }
  2514. advection_velocity_before_extension_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double }
  2515. advection_velocity_before_extension_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double }
  2516. mass_transfer_rate_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double }
  2517. mass_transfer_rate_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double }
  2518. normal_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double }
  2519. normal_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double }
  2520. #interpolated
  2521. advection_velocity_x: { size: [ '$nx', '$ny' ], type: array, subtype: double }
  2522. advection_velocity_y: { size: [ '$nx', '$ny' ], type: array, subtype: double }
  2523. advection_velocity_phase_change_x: { size: [ '$nx', '$ny' ], type: array, subtype: double }
  2524. advection_velocity_phase_change_y: { size: [ '$nx', '$ny' ], type: array, subtype: double }
  2525. advection_velocity_bulk_x: { size: [ '$nx', '$ny' ], type: array, subtype: double }
  2526. advection_velocity_bulk_y: { size: [ '$nx', '$ny' ], type: array, subtype: double }
  2527. advection_velocity_before_extension_x: { size: [ '$nx', '$ny' ], type: array, subtype: double }
  2528. advection_velocity_before_extension_y: { size: [ '$nx', '$ny' ], type: array, subtype: double }
  2529. normal_phase_change_velocity: { size: [ '$nx', '$ny' ], type: array, subtype: double }
  2530. levelset_p_wall: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2531. velocity_x: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2532. velocity_y: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2533. mass_transfer_rate: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2534. mass_transfer_rate_redistributed: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2535. mass_transfer_rate_before_redistribution: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2536. nb_gaz_acceptors: { size: [ '$nx', '$ny' ], type: array, subtype: int64 } #Field of the current subdomain
  2537. mass_transfer_rate_bulk: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2538. mass_transfer_rate_border: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2539. mass_transfer_rate_intfc: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2540. normal_angle: { size: [ '$nx', '$ny' ], type: array, subtype: double } # angle to compute normal (cos,sin) in 2D
  2541. normal_velocity_intfc: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2542. dcap_1: { size: [ '$nx', '$ny'], type: array, subtype: double } #Field of the current subdomain
  2543. dcap_2: { size: [ '$nx', '$ny'], type: array, subtype: double } #Field of the current subdomain
  2544. dcap_3: { size: [ '$nx', '$ny'], type: array, subtype: double } #Field of the current subdomain
  2545. dcap_4: { size: [ '$nx', '$ny'], type: array, subtype: double } #Field of the current subdomain
  2546. grad_x_coord: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2547. grad_y_coord: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2548. grad_x: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2549. grad_y: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2550. grad_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2551. grad_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2552. grad_pres_y: { size: [ '$nx', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2553. grav_y: { size: [ '$nx', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2554. conv_y: { size: [ '$nx', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2555. velocity_divergence: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2556. normalise_velocity_divergence: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2557. rho_one_fluid: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2558. mu_one_fluid: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2559. volume_cell: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2560. volume_fraction: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2561. smoothed_volume_fraction: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2562. levelset_surface_tension: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2563. levelset_heavyside: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2564. curvature_p: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2565. curvature_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2566. curvature_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2567. volumic_surface_tension_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2568. volumic_surface_tension_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2569. viscosity_coeff_for_du_dx: { size: [ '$nx+2', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2570. viscosity_coeff_for_dv_dy: { size: [ '$nx', '$ny+2' ], type: array, subtype: double } #Field of the current subdomain
  2571. viscosity_coeff_for_du_dy: { size: [ '$nx+1', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2572. viscosity_coeff_for_dv_dx: { size: [ '$nx+1', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2573. rho_one_fluid_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2574. rho_one_fluid_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2575. rhs_uv_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2576. rhs_uv_divergence: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2577. mesh_p_x: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2578. mesh_p_y: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2579. # stored in 3D
  2580. dcap: { size: [ 11,'$nx', '$ny'], type: array, subtype: double } #Field of the current subdomain
  2581. iscal: int64 #Index for naming files
  2582. poisson_iter: int64 #Index for naming files
  2583. # Convergence criteria
  2584. residual_electrical_potential: double
  2585. variation_electrical_potential: double
  2586. concentration_check_value: double
  2587. concentration_check_min: double
  2588. concentration_check_max: double
  2589. concentration_check_mean: double
  2590. conductivity_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2591. conductivity_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2592. #chi
  2593. # chi_1: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2594. # chi_2: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2595. # chi_3: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2596. # To save only bulk field, with u given in Flower
  2597. # u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2598. # v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2599. # trans_scal: { size: [ '$nx', '$ny','$nb_transported_scalars' ], type: array, subtype: double } #Field of the current subdomain
  2600. # phi_ele: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2601. # iu: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2602. # iv: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2603. plugins:
  2604. # trace: ~
  2605. pycall:
  2606. # logging: "debug"
  2607. on_event:
  2608. # close_pycall:
  2609. # exec: |
  2610. # Py_FinalizeEx()
  2611. # init_PDI:
  2612. # exec: |
  2613. # print('\n \033[93m'+'test init PDI','\033[0m')
  2614. # print('Py_IsInitialized',Py_IsInitialized)
  2615. # init_PDI2:
  2616. # exec: |
  2617. # print('\n \033[93m'+'test init PDI','\033[0m')
  2618. # print('Py_IsInitialized',Py_IsInitialized)
  2619. # - exec: print('nb levelsets',nLS)
  2620. # with: { nLS: $nb_levelsets }
  2621. check_pressure_velocity_end:
  2622. with:
  2623. nx: $nx
  2624. ny: $ny
  2625. u_1D: $u_1D
  2626. v_1D: $v_1D
  2627. p_1D: $p_1D
  2628. grad_x: $grad_x
  2629. grad_y: $grad_y
  2630. mu_cin1: *mu_cin1
  2631. rho1: *rho1
  2632. v_inlet: *v_inlet
  2633. xmin: *mesh_xmin
  2634. xmax: *mesh_xmax
  2635. ymin: *mesh_ymin
  2636. ymax: *mesh_ymax
  2637. exec: |
  2638. import numpy as np
  2639. print('\033[38;5;206m')
  2640. # print('\033[36m')
  2641. print('[check_pressure_velocity_end]')
  2642. print("min(u) {u:.2e} min(v) {v:.2e} min(p) {p:.2e}".format(u=np.min(u_1D),v=np.min(v_1D),p=np.min(p_1D)))
  2643. print("max(u) {u:.2e} max(v) {v:.2e} max(p) {p:.2e}".format(u=np.max(u_1D),v=np.max(v_1D),p=np.max(p_1D)))
  2644. print("mean(u) {u:.2e} mean(v) {v:.2e} mean(p) {p:.2e}".format(u=np.mean(u_1D),v=np.mean(v_1D),p=np.mean(p_1D)))
  2645. # print('\033[0m')
  2646. print("min(grad_x) {u:.2e} min(grad_y) {v:.2e} ".format(u=np.min(grad_x),v=np.min(grad_y)))
  2647. print("max(grad_x) {u:.2e} max(grad_y) {v:.2e} ".format(u=np.max(grad_x),v=np.max(grad_y)))
  2648. from debug_flower import veci
  2649. field_index = 1
  2650. # # slice_1D = veci(v_1D,nx,ny,field_index)[ny//2,:]
  2651. # # print('slice projection', slice_1D)
  2652. # # print('len',len(slice_1D))
  2653. # print('nx',nx,ny)
  2654. # slice_1D = veci(v_1D,nx,ny+1,field_index)[(ny+1)//2,:]
  2655. # print('slice projection', slice_1D)
  2656. # # print('len',len(slice_1D))
  2657. # # Print p and v
  2658. # # for j in range(0,ny):
  2659. # # slice_p = veci(p_1D,nx,ny,field_index)[j,:]
  2660. # # print('Slice p',j,slice_p)
  2661. # # slice_1D = veci(v_1D,nx,ny+1,field_index)[j,:]
  2662. # # print('Slice v',j,slice_1D)
  2663. pressure_equal_on_line = True
  2664. # Print v
  2665. for j in range(0,ny):
  2666. slice_p = veci(p_1D,nx,ny,field_index)[j,:]
  2667. if (max(slice_p)-min(slice_p))/min(slice_p) > 1.0e-10:
  2668. pressure_equal_on_line = False
  2669. print('Slice p',j,max(slice_p)-min(slice_p),(max(slice_p)-min(slice_p))/min(slice_p) )
  2670. # print('Slice p',j,slice_p)
  2671. slice_1D = veci(v_1D,nx,ny+1,field_index)[j,:]
  2672. # print('Slice v',j,slice_1D)
  2673. mu1 = mu_cin1 * rho1
  2674. # print('mu1',mu1)
  2675. x_1D = 0
  2676. y_1D = 0
  2677. # import numpy as np
  2678. xp = np.zeros(nx)
  2679. yp = np.zeros(ny)
  2680. # xp = np.linspace(float(mesh["xmin"]), float(mesh["xmax"]), int(mesh["nx"]))
  2681. # yp = np.linspace(float(mesh["ymin"]), float(mesh["ymax"]), int(mesh["ny"]))
  2682. dx = (xmax - xmin) / nx
  2683. dy = (ymax - ymin) / ny
  2684. # print('len(xp)',len(xp),len(yp))
  2685. xp[0] = xmin + dx/2
  2686. yp[0] = ymin + dy/2
  2687. for i in range(1,len(xp)):
  2688. xp[i] = xp[i-1]+dx
  2689. for i in range(1,len(yp)):
  2690. yp[i] = yp[i-1]+dx
  2691. yv = yp + dy / 2
  2692. yv = np.insert(yv, 0, yp[0] - dy / 2)
  2693. # print('xp',xp) #xv too
  2694. # print('yp',yp)
  2695. # print('yv',yv)
  2696. # p
  2697. from debug_flower import vecb, vecb_B,vecb_T,vecb_L,vecb_R
  2698. p_top = 0
  2699. p_bottom = p_top + 8*mu1/(xmax-xmin)*v_inlet
  2700. p_along_y = p_bottom + (yv - ymin)*(p_top-p_bottom)/(ymax - ymin)
  2701. print('p',p_along_y)
  2702. print('Bottom',vecb_B(p_1D,nx,ny))
  2703. print('Top',vecb_T(p_1D,nx,ny))
  2704. print('Left',vecb_L(p_1D,nx,ny))
  2705. print('Right',vecb_R(p_1D,nx,ny))
  2706. # v
  2707. slice_v_exact = 4* v_inlet * xp /(xmax-xmin)*(1-xp/(xmax-xmin))
  2708. print('slice v exact', slice_v_exact)
  2709. # def Poiseuille(v_inlet,xp_full,xmin,xmax):
  2710. # slice_v_exact = 4* v_inlet * xp_full /(xmax-xmin)*(1-xp_full/(xmax-xmin))
  2711. # return slice_v_exact
  2712. # xp_full = xmin
  2713. # print('Poiseuille',xp_full,Poiseuille(v_inlet,xp_full,xmin,xmax))
  2714. # xp_full = xmax
  2715. # print('Poiseuille',xp_full,Poiseuille(v_inlet,xp_full,xmin,xmax))
  2716. print('\033[0m')
  2717. write_initialization:
  2718. with: { phi_ele_1D_py: $phi_ele_1D, nx_py: $nx, ny_py: $ny, u_1D: $u_1D, v_1D: $v_1D, p_1D: $p_1D}
  2719. exec: |
  2720. import numpy as np
  2721. print('\033[93m')
  2722. # print('Initialization')
  2723. print("min(u) {u:.2e} min(v) {v:.2e} min(p) {p:.2e}".format(u=np.min(u_1D),v=np.min(v_1D),p=np.min(p_1D)))
  2724. print("max(u) {u:.2e} max(v) {v:.2e} max(p) {p:.2e}".format(u=np.max(u_1D),v=np.max(v_1D),p=np.max(p_1D)))
  2725. print("mean(u) {u:.2e} mean(v) {v:.2e} mean(p) {p:.2e}".format(u=np.mean(u_1D),v=np.mean(v_1D),p=np.mean(p_1D)))
  2726. # print("min(cH2) %.6e", minscal1L))\t$(@sprintf("min(KOH) %.6e", minscal2L))\t$(@sprintf("min(H2O) %.6e", minscal3L))\n")
  2727. # print("max(cH2) %.6e", maxscal1L))\t$(@sprintf("max(KOH) %.6e", maxscal2L))\t$(@sprintf("max(H2O) %.6e", maxscal3L))\n")
  2728. # print("moy(cH2) %.6e", moyscal1L))\t$(@sprintf("moy(KOH) %.6e", moyscal2L))\t$(@sprintf("moy(H2O) %.6e", moyscal3L))\n")
  2729. print('\033[0m')
  2730. # write_electrical_conductivity:
  2731. # with:
  2732. # elec_cond_1D: $elec_cond_1D
  2733. # conductivity_u: $conductivity_u
  2734. # conductivity_v: $conductivity_v
  2735. # nx_py: $nx
  2736. # ny_py: $ny
  2737. # exec: |
  2738. # from debug_flower import vecb
  2739. # # print('write_electrical_conductivity')
  2740. # # print('coeffD borders ',vecb(elec_cond_1D,nx_py,ny_py))
  2741. # # print('coeffDu border ',conductivity_u[:,ny_py//2])
  2742. # # print('coeffDv border ',conductivity_v[nx_py//2,:])
  2743. # # print('coeffDu border ',conductivity_u[ny_py//2,:])
  2744. # # print('coeffDv border ',conductivity_v[:,nx_py//2])
  2745. print_start_temporal_iteration:
  2746. with:
  2747. time: $time
  2748. nstep: $nstep
  2749. dcap: $dcap
  2750. exec: |
  2751. print('\033[93m')
  2752. print()
  2753. print('Iteration {nstep:d} time {time:.2e}'.format(nstep=nstep,time=time))
  2754. # print('Check cut-cell operators ',dcap[:,1,1])
  2755. print('\033[0m')
  2756. print_before_prediction:
  2757. with: { nx: $nx, ny: $ny, u_1D: $u_1D, v_1D: $v_1D, p_1D: $p_1D}
  2758. exec: |
  2759. import numpy as np
  2760. print('\033[36m')
  2761. print('[Before prediction]')
  2762. print("min(u) {u:.2e} min(v) {v:.2e} min(p) {p:.2e}".format(u=np.min(u_1D),v=np.min(v_1D),p=np.min(p_1D)))
  2763. print("max(u) {u:.2e} max(v) {v:.2e} max(p) {p:.2e}".format(u=np.max(u_1D),v=np.max(v_1D),p=np.max(p_1D)))
  2764. print("mean(u) {u:.2e} mean(v) {v:.2e} mean(p) {p:.2e}".format(u=np.mean(u_1D),v=np.mean(v_1D),p=np.mean(p_1D)))
  2765. print('\033[0m')
  2766. # from debug_flower import veci
  2767. # field_index = 1
  2768. # # slice_1D = veci(v_1D,nx,ny,field_index)[ny//2,:]
  2769. # # print('slice projection', slice_1D)
  2770. # # print('len',len(slice_1D))
  2771. # # print('nx',nx,ny)
  2772. # slice_1D = veci(v_1D,nx,ny+1,field_index)[(ny+1)//2,:]
  2773. # print('slice projection', slice_1D)
  2774. # # print('len',len(slice_1D))
  2775. # for j in range(0,ny):
  2776. # slice_p = veci(p_1D,nx,ny,field_index)[ny-1-j,:] #0: end (top), ny, 1
  2777. # print('Slice p',j,slice_p)
  2778. # # from plot_pdi import plot_profile; plot_profile(x,slice_1D,"Poiseuille_during_projection")
  2779. print_pressure_gradient_in_prediction:
  2780. with:
  2781. grad_x_1D: $grad_x_1D
  2782. grad_y_1D: $grad_y_1D
  2783. p_1D: $p_1D
  2784. nx: $nx
  2785. ny: $ny
  2786. # mu_cin1: *mu_cin1
  2787. # rho1: *rho1
  2788. # v_inlet: *v_inlet
  2789. xmin: *mesh_xmin
  2790. xmax: *mesh_xmax
  2791. ymin: *mesh_ymin
  2792. ymax: *mesh_ymax
  2793. exec: |
  2794. import numpy as np
  2795. print('\033[36m')
  2796. print('[print_pressure_gradient_in_prediction]')
  2797. dx = (xmax-xmin)/ nx
  2798. volume = dx**2
  2799. # grad_x = np.reshape(grad_x_1D, (nx, ny))
  2800. # grad_y = np.reshape(grad_y_1D, (nx, ny))
  2801. grad_x = np.reshape(grad_x_1D, (nx+1, ny))
  2802. grad_y = np.reshape(grad_y_1D, (nx, ny+1))
  2803. grad_x = grad_x.transpose()
  2804. grad_y = grad_y.transpose()
  2805. for j in range(0,ny):
  2806. slice_p = grad_x[j,:] #0: end (top), ny, 1
  2807. print('grad_x',j,slice_p)
  2808. for j in range(0,ny+1):
  2809. slice_p = grad_y[j,:] #0: end (top), ny, 1
  2810. print('grad_y',j,slice_p)
  2811. # # Select only useful part of vector, the actual gradient
  2812. # grad_x = grad_x[:,1:-1] #size ny, nx-1
  2813. # grad_y = grad_y[1:-1,:] #size ny-1, nx
  2814. print("min(u) {u:.2e} min(v) {v:.2e} min(v)/volume {p:.2e}".format(u=np.min(grad_x),v=np.min(grad_y),p=np.min(grad_y)/volume))
  2815. print("max(u) {u:.2e} max(v) {v:.2e} max(v)/volume {p:.2e}".format(u=np.max(grad_x),v=np.max(grad_y),p=np.max(grad_y)/volume))
  2816. print("mean(u) {u:.2e} mean(v) {v:.2e} mean(v)/volume {p:.2e}".format(u=np.mean(grad_x),v=np.mean(grad_y),p=np.mean(grad_y)/volume))
  2817. # for j in range(0,ny):
  2818. # slice_p = grad_x[j,:] #0: end (top), ny, 1
  2819. # print('grad_x',j,slice_p)
  2820. # for j in range(0,ny-1):
  2821. # slice_p = grad_y[j,:] #0: end (top), ny, 1
  2822. # print('grad_y',j,slice_p)
  2823. from debug_flower import vecb, vecb_B, vecb_T, vecb_L,vecb_R
  2824. print('bottom BC pressure',vecb_B(p_1D,nx,ny))
  2825. print('top BC pressure',vecb_T(p_1D,nx,ny))
  2826. print('left BC pressure',vecb_L(p_1D,nx,ny))
  2827. print('right BC pressure',vecb_R(p_1D,nx,ny))
  2828. # print('vecb pressure',vecb(p_1D,nx,ny))
  2829. print('\033[0m')
  2830. print_variables:
  2831. with:
  2832. phi_ele_1D_py: $phi_ele_1D
  2833. nx_py: $nx
  2834. ny_py: $ny
  2835. u_1D: $u_1D
  2836. v_1D: $v_1D
  2837. p_1D: $p_1D
  2838. trans_scal_1DT: $trans_scal_1DT
  2839. nb_transported_scalars: *nb_transported_scalars
  2840. exec: |
  2841. import numpy as np
  2842. print('\033[93m')
  2843. print('[print_variables]')
  2844. print("min(u) {u:.2e} min(v) {v:.2e} min(p) {p:.2e}".format(u=np.min(u_1D),v=np.min(v_1D),p=np.min(p_1D)))
  2845. print("max(u) {u:.2e} max(v) {v:.2e} max(p) {p:.2e}".format(u=np.max(u_1D),v=np.max(v_1D),p=np.max(p_1D)))
  2846. print("mean(u) {u:.2e} mean(v) {v:.2e} mean(p) {p:.2e}".format(u=np.mean(u_1D),v=np.mean(v_1D),p=np.mean(p_1D)))
  2847. if nb_transported_scalars>0:
  2848. print("min(cH2) {cH2:.2e} min(KOH) {KOH:.2e} min(H2O) {H2O:.2e}".format(cH2=np.min(trans_scal_1DT[0,:]),KOH=np.min(trans_scal_1DT[1,:]),H2O=np.min(trans_scal_1DT[2,:])))
  2849. print("max(cH2) {cH2:.2e} max(KOH) {KOH:.2e} max(H2O) {H2O:.2e}".format(cH2=np.max(trans_scal_1DT[0,:]),KOH=np.max(trans_scal_1DT[1,:]),H2O=np.max(trans_scal_1DT[2,:])))
  2850. print("mean(cH2) {cH2:.2e} mean(KOH) {KOH:.2e} mean(H2O) {H2O:.2e}".format(cH2=np.mean(trans_scal_1DT[0,:]),KOH=np.mean(trans_scal_1DT[1,:]),H2O=np.mean(trans_scal_1DT[2,:])))
  2851. print('\033[0m')
  2852. mesh:
  2853. with:
  2854. mesh_x_1D_py: $mesh_x_1D
  2855. grad_x_coord_py: $grad_x_coord
  2856. nx_py: $nx
  2857. ny_py: $ny
  2858. exec: |
  2859. from debug_flower import veci
  2860. # mesh in 1 line in x direction at j = 0
  2861. print('\n \033[93m'+'mesh x ',veci(mesh_x_1D_py,nx_py,ny_py,1)[0,:],'\033[0m')
  2862. print('\n \033[93m'+'corr x ',veci(grad_x_coord_py,nx_py+1,ny_py,1)[0,:],'\033[0m')
  2863. check_electrical_potential_convergence:
  2864. with:
  2865. # BC_phi_ele_left_py: $BC_phi_ele_left
  2866. residual_py: $residual_1D
  2867. phi_ele_1D_py: $phi_ele_1D
  2868. elec_cond_1D_py: $elec_cond_1D
  2869. rhs_1D: $rhs_1D
  2870. dcap_1: $dcap_1
  2871. # i_current_x_py: $i_current_x
  2872. nx_py: $nx
  2873. ny_py: $ny
  2874. # phi_ele1: $phi_ele1
  2875. alpha: *alpha
  2876. i0: *i0
  2877. phi_ele1: *phi_ele1
  2878. Faraday: *Faraday
  2879. Ru: *Ru
  2880. temperature0: *temperature0
  2881. concentration0_KOH: *concentration0_KOH
  2882. diffusion_coeff_KOH: *diffusion_coeff_KOH
  2883. mesh_xmax: *mesh_xmax
  2884. mesh_xmin: *mesh_xmin
  2885. domain_length: *domain_length
  2886. # with: { phi_ele_1D_py: $phi_ele_1D, nx_py: $nx, ny_py: $ny}
  2887. exec: |
  2888. import numpy as np
  2889. from debug_flower import butler_grad_phi,vecb_L,butler,veci
  2890. print('\n \033[93m')
  2891. print()
  2892. print('[check_electrical_potential_convergence]')
  2893. print('phi wall ',vecb_L(phi_ele_1D_py,nx_py,ny_py))
  2894. # print('F_residual ',vecb_L(residual_py,nx_py,ny_py)) #array at wall
  2895. # print('F_residual ',np.min(vecb_L(residual_py,nx_py,ny_py)), np.max(vecb_L(residual_py,nx_py,ny_py)))
  2896. # print('F_residual bulk', np.min(veci(residual_py,nx_py,ny_py,1)), np.max(veci(residual_py,nx_py,ny_py,1)) )
  2897. # print('len(dcap_1[1,:])',len(dcap_1[1,:]))
  2898. # print('dcap',dcap_1[1,:])
  2899. # print('F_residual /dx (homogeneous to a gradient of potential)',vecb_L(residual_py,nx_py,ny_py)/dcap_1[1,:])
  2900. # print('F_residual /dx * cond (homogeneous to a gradient of current) ',vecb_L(residual_py,nx_py,ny_py)/dcap_1[1,:]*vecb_L(elec_cond_1D_py,nx_py,ny_py))
  2901. # print('F_residual normalized (unitless)',vecb_L(residual_py,nx_py,ny_py)/dcap_1[1,:]/vecb_L(rhs_1D,nx_py,ny_py))
  2902. print('F_residual normalized infty',np.max(np.abs(vecb_L(residual_py,nx_py,ny_py)))/np.max(np.abs(vecb_L(rhs_1D,nx_py,ny_py))))
  2903. # print('vecb_L(rhs_1D,nx_py,ny_py)',vecb_L(rhs_1D,nx_py,ny_py))
  2904. print('\033[0m')
  2905. warning_scalar_transport:
  2906. with:
  2907. iscal: $iscal
  2908. trans_scal_1DT: $trans_scal_1DT
  2909. concentration_check_value: $concentration_check_value
  2910. nb_levelsets: *nb_levelsets
  2911. nb_transported_scalars: *nb_transported_scalars
  2912. activate_interface: *activate_interface
  2913. concentration_check_factor: *concentration_check_factor
  2914. concentration0_H2: *concentration0_H2
  2915. concentration0_KOH: *concentration0_KOH
  2916. concentration0_H2O: *concentration0_H2O
  2917. exec: |
  2918. print('\n \033[91m')
  2919. print()
  2920. concentration0 = [concentration0_H2,concentration0_KOH,concentration0_H2O]
  2921. if iscal == 1:
  2922. print("[warning_scalar_transport] H2 {iscal:d} {concentration_check_value:.2e} {check_threshold:.2e}".format(iscal=iscal,concentration_check_value=concentration_check_value,check_threshold=concentration0[iscal-1]*(1-concentration_check_factor)))
  2923. elif iscal == 2:
  2924. print("[warning_scalar_transport] KOH {iscal:d} {concentration_check_value:.2e} {check_threshold:.2e}".format(iscal=iscal,concentration_check_value=concentration_check_value,check_threshold=concentration0[iscal-1]*(1-concentration_check_factor)))
  2925. elif iscal == 3:
  2926. print("[warning_scalar_transport] H2O {iscal:d} {concentration_check_value:.2e} {check_threshold:.2e}".format(iscal=iscal,concentration_check_value=concentration_check_value,check_threshold=concentration0[iscal-1]*(1+concentration_check_factor)))
  2927. # concentration drop:(minimum(ph.trans_scal[:,:,iscal])-num.concentration0[iscal])/num.concentration0[iscal]*100)
  2928. print("concentration too low")
  2929. print('\033[0m')
  2930. check_scalar_transport_interface:
  2931. with:
  2932. iscal: $iscal
  2933. nb_levelsets: *nb_levelsets
  2934. nb_transported_scalars: *nb_transported_scalars
  2935. activate_interface: *activate_interface
  2936. # concentration_check_value: $concentration_check_value
  2937. concentration_check_min: $concentration_check_min
  2938. concentration_check_max: $concentration_check_max
  2939. concentration_check_mean: $concentration_check_mean
  2940. trans_scal_1DT: $trans_scal_1DT
  2941. concentration0_H2: *concentration0_H2
  2942. concentration0_KOH: *concentration0_KOH
  2943. concentration0_H2O: *concentration0_H2O
  2944. concentration_check_factor: *concentration_check_factor
  2945. # concentration0: $concentration0
  2946. # concentration0: << *concentration0
  2947. # <<: *concentration0
  2948. # <<: *concentration0
  2949. exec: |
  2950. print('\n \033[92m')
  2951. print()
  2952. print('[check_scalar_transport_interface]')
  2953. concentration0 = np.array([concentration0_H2,concentration0_KOH,concentration0_H2O])
  2954. print("[check_scalar_transport_interface] min {concentration_check_min:.2e} max {concentration_check_max:.2e} mean {concentration_check_mean:.2e}".format(concentration_check_min=concentration_check_min,concentration_check_max=concentration_check_max,concentration_check_mean=concentration_check_mean))
  2955. concentration_check_value = concentration_check_min
  2956. if iscal == 1:
  2957. print("[check_scalar_transport_interface] H2 {iscal:d} {concentration_check_value:.2e} {check_threshold:.2e}".format(iscal=iscal,concentration_check_value=concentration_check_value,check_threshold=concentration0[iscal-1]*(1-concentration_check_factor)))
  2958. elif iscal == 2:
  2959. print("[check_scalar_transport_interface] KOH {iscal:d} {concentration_check_value:.2e} {check_threshold:.2e}".format(iscal=iscal,concentration_check_value=concentration_check_value,check_threshold=concentration0[iscal-1]*(1-concentration_check_factor)))
  2960. elif iscal == 3:
  2961. print("[check_scalar_transport_interface] H2O {iscal:d} {concentration_check_value:.2e} {check_threshold:.2e}".format(iscal=iscal,concentration_check_value=concentration_check_value,check_threshold=concentration0[iscal-1]*(1+concentration_check_factor)))
  2962. print('\033[0m')
  2963. #Checks after resolution if the values are physical
  2964. check_scalar_transport:
  2965. with:
  2966. iscal: $iscal
  2967. nb_levelsets: *nb_levelsets
  2968. nb_transported_scalars: *nb_transported_scalars
  2969. activate_interface: *activate_interface
  2970. trans_scal_1DT: $trans_scal_1DT
  2971. # concentration0: $concentration0
  2972. # concentration0: *concentration0
  2973. # <<: *concentration0
  2974. concentration0_H2: *concentration0_H2
  2975. concentration0_KOH: *concentration0_KOH
  2976. concentration0_H2O: *concentration0_H2O
  2977. mask_1D: $mask_1D #mask containing volumes in bulk, and liquid heights on interfaces, and 0 when a cell is cut
  2978. # so that small cells are ignored when computing min, max, ...
  2979. exec: |
  2980. print('\n \033[92m')
  2981. print()
  2982. print('[check_scalar_transport]')
  2983. print("min(cH2) {cH2:.2e} min(KOH) {KOH:.2e} min(H2O) {H2O:.2e}".format(cH2=np.min(trans_scal_1DT[0,:]),KOH=np.min(trans_scal_1DT[1,:]),H2O=np.min(trans_scal_1DT[2,:])))
  2984. print("max(cH2) {cH2:.2e} max(KOH) {KOH:.2e} max(H2O) {H2O:.2e}".format(cH2=np.max(trans_scal_1DT[0,:]),KOH=np.max(trans_scal_1DT[1,:]),H2O=np.max(trans_scal_1DT[2,:])))
  2985. print("mean(cH2) {cH2:.2e} mean(KOH) {KOH:.2e} mean(H2O) {H2O:.2e}".format(cH2=np.mean(trans_scal_1DT[0,:]),KOH=np.mean(trans_scal_1DT[1,:]),H2O=np.mean(trans_scal_1DT[2,:])))
  2986. print('with mask')
  2987. scal0 = np.ma.masked_where(mask_1D <= 0.0, trans_scal_1DT[0,:])
  2988. scal1 = np.ma.masked_where(mask_1D <= 0.0, trans_scal_1DT[1,:])
  2989. scal2 = np.ma.masked_where(mask_1D <= 0.0, trans_scal_1DT[2,:])
  2990. print('with mask')
  2991. print("min(cH2) {cH2:.2e} min(KOH) {KOH:.2e} min(H2O) {H2O:.2e}".format(cH2=np.min(scal0), KOH=np.min(scal1), H2O=np.min(scal2)))
  2992. print("max(cH2) {cH2:.2e} max(KOH) {KOH:.2e} max(H2O) {H2O:.2e}".format(cH2=np.max(scal0), KOH=np.max(scal1), H2O=np.max(scal2)))
  2993. print("mean(cH2) {cH2:.2e} mean(KOH) {KOH:.2e} mean(H2O) {H2O:.2e}".format(cH2=np.mean(scal0),KOH=np.mean(scal1),H2O=np.mean(scal2)))
  2994. concentration0 = np.array([concentration0_H2,concentration0_KOH,concentration0_H2O])
  2995. # concentration0 = [concentration0_H2[0],concentration0_KOH[0],concentration0_H2O[0]]
  2996. # print("concentration0",concentration0)
  2997. # print('concentration0_H2',concentration0_H2)
  2998. # try:
  2999. # print('concentration0_H2',concentration0_H2[0])
  3000. # except:
  3001. # print('no ')
  3002. # print('types',type(iscal),type(concentration0_H2),type(concentration0))
  3003. # # print average value at interface
  3004. # if activate_interface !=0:
  3005. # iLS = 1
  3006. # # nonzero = mean_intfc_non_null(ph.trans_scalD,iscal,grid,iLS) #Value at interface
  3007. # index = iLS+1
  3008. # num=0
  3009. # nonzero = 0.0
  3010. # # cf veci @view a[g.ny*g.nx*(p-1)+1:g.ny*g.nx*p]
  3011. # for scal_intfc in veci(scalD):
  3012. # if abs(scal_intfc) >0.0:
  3013. # nonzero += scalD[i,iscal]
  3014. # num += 1
  3015. # if num == 0:
  3016. # print("no intfc in mean_intfc_non_null")
  3017. # else:
  3018. # nonzero /= num
  3019. # print("Mean value at interface {:.2e}".format(nonzero))
  3020. print('\033[0m')
  3021. check_electrical_potential:
  3022. with:
  3023. poisson_iter: $poisson_iter
  3024. BC_phi_ele_left_py: $BC_phi_ele_left
  3025. elec_cond_1D_py: $elec_cond_1D
  3026. phi_ele_1D_py: $phi_ele_1D
  3027. i_current_x_py: $i_current_x
  3028. nx_py: $nx
  3029. ny_py: $ny
  3030. variation_electrical_potential: $variation_electrical_potential
  3031. residual_electrical_potential: $residual_electrical_potential
  3032. residual_1D: $residual_1D
  3033. rhs_1D: $rhs_1D
  3034. # phi_ele1: $phi_ele1
  3035. alpha: *alpha
  3036. i0: *i0
  3037. phi_ele1: *phi_ele1
  3038. Faraday: *Faraday
  3039. Ru: *Ru
  3040. temperature0: *temperature0
  3041. concentration0_KOH: *concentration0_KOH
  3042. diffusion_coeff_KOH: *diffusion_coeff_KOH
  3043. mesh_xmax: *mesh_xmax
  3044. mesh_xmin: *mesh_xmin
  3045. domain_length: *domain_length
  3046. # with: { phi_ele_1D_py: $phi_ele_1D, nx_py: $nx, ny_py: $ny}
  3047. exec: |
  3048. import numpy as np
  3049. from debug_flower import butler_grad_phi,vecb_L,butler,veci
  3050. print('\n \033[93m')
  3051. print()
  3052. # print('check_electrical_potential')
  3053. print('[check_electrical_potential] Poisson iter',poisson_iter,'\033[0m')
  3054. print("Residual {:.2e} absolute variation {:.2e}".format(residual_electrical_potential,variation_electrical_potential))
  3055. # #num.electrical_potential_residual
  3056. # print('\n \033[93m'+'Pycall ','\033[0m')
  3057. min_phi = np.min(phi_ele_1D_py)
  3058. phi = veci(phi_ele_1D_py,nx_py,ny_py,1)
  3059. # print('\n \033[93m'+'phi ',np.min(phi_ele_1D_py),np.max(phi_ele_1D_py),'\033[0m')
  3060. # print('\n \033[93m'+'Conductivity min',np.min(elec_cond_1D_py),'max',np.max(elec_cond_1D_py),'\033[0m')
  3061. residual_electrical_potential_wall = np.max(abs(vecb_L(residual_1D,nx_py,ny_py))) / np.max(abs(vecb_L(rhs_1D,nx_py,ny_py)))
  3062. residual_electrical_potential_total = np.max(abs(residual_1D)) / np.max(abs(rhs_1D))
  3063. print("Residual wall {:.2e} whole {:.2e}".format(residual_electrical_potential_wall,residual_electrical_potential_total))
  3064. # print('\n \033[93m'+'BC_phi_ele_left ',np.min(BC_phi_ele_left_py),np.max(BC_phi_ele_left_py),'\033[0m')
  3065. # print('\n \033[93m'+'i_current_x min ',np.min(i_current_x_py),'max ',np.max(i_current_x_py),'\033[0m')
  3066. # print('\n \033[93m'+'i_current_x_py ',i_current_x_py[:,ny_py//2],'\033[0m')
  3067. # print('\n \033[93m'+'phi line ',phi[:,ny_py//2],'\033[0m') # vertical line
  3068. # print('\n \033[93m'+'phi line ',phi[ny_py//2,:],'\033[0m') #horizontal line
  3069. # min_phi = np.min(phi_ele_1D_py)
  3070. # print('\n \033[93m'+'sum ',-i_current_x_py[:,ny_py//2]+butler(min_phi,phi_ele1,Faraday,alpha,Ru,temperature0,i0),'\033[0m')
  3071. # print('\n \033[93m'+'Convergence Butler-Volmer ',np.max(np.abs(-i_current_x_py[:,ny_py//2]+butler(vecb_L(phi_ele_1D_py,nx_py,ny_py),phi_ele1,Faraday,alpha,Ru,temperature0,i0))),'\033[0m')
  3072. # print('\n \033[93m'+'ratio ',(-i_current_x_py[:,ny_py//2]+butler(vecb_L(phi_ele_1D_py,nx_py,ny_py),phi_ele1,Faraday,alpha,Ru,temperature0,i0)/butler(0,phi_ele1,Faraday,alpha,Ru,temperature0,i0),phi_ele1,Faraday,alpha,Ru,temperature0,i0),'\033[0m')
  3073. # print('\n \033[93m'+'sum ',butler(vecb_L(phi_ele_1D_py,nx_py,ny_py),phi_ele1,Faraday,alpha,Ru,temperature0,i0),'\033[0m')
  3074. # print('\n \033[93m'+'sum ',butler(0,phi_ele1,Faraday,alpha,Ru,temperature0,i0),'\033[0m')
  3075. # L = mesh_xmax-mesh_xmin
  3076. # print('\n \033[93m'+'phi ',min_phi,-L*butler_grad_phi(min_phi,phi_ele1,Faraday,alpha,Ru,temperature0,concentration0_KOH,diffusion_coeff_KOH,i0),'\033[0m')
  3077. # print('\n \033[93m'+'grad phi ',min_phi,butler_grad_phi(min_phi,phi_ele1,Faraday,alpha,Ru,temperature0,concentration0_KOH,diffusion_coeff_KOH,i0),'\033[0m')
  3078. # print(vecb_L(phi_ele_1D_py,nx_py,ny_py))
  3079. # from debug_flower import vecbprint,veci, butler
  3080. # # vecbprint(phi_ele_1D_py,nx_py,ny_py)
  3081. # phi = veci(phi_ele_1D_py,nx_py,ny_py,1)
  3082. # # print(phi[nx_py/2,:])
  3083. # # print(phi[:,nx_py/2])
  3084. # # a = 0.66
  3085. # a = 0.6608349877730476
  3086. # L= 1e-4
  3087. # npoints=2
  3088. # xplot_new = np.linspace(0, L, npoints)
  3089. # yplot_new = a * (xplot_new / L - 1)
  3090. print('\033[0m')
  3091. # print_electrical_potential:
  3092. # with:
  3093. # poisson_iter: $poisson_iter
  3094. # BC_phi_ele_left_py: $BC_phi_ele_left
  3095. # elec_cond_1D_py: $elec_cond_1D
  3096. # phi_ele_1D_py: $phi_ele_1D
  3097. # i_current_x_py: $i_current_x
  3098. # nx_py: $nx
  3099. # ny_py: $ny
  3100. # # variation_electrical_potential: $variation_electrical_potential
  3101. # # residual_electrical_potential: $residual_electrical_potential
  3102. # # phi_ele1: $phi_ele1
  3103. # alpha: *alpha
  3104. # i0: *i0
  3105. # phi_ele1: *phi_ele1
  3106. # Faraday: *Faraday
  3107. # Ru: *Ru
  3108. # temperature0: *temperature0
  3109. # concentration0_KOH: *concentration0_KOH
  3110. # diffusion_coeff_KOH: *diffusion_coeff_KOH
  3111. # mesh_xmax: *mesh_xmax
  3112. # mesh_xmin: *mesh_xmin
  3113. # domain_length: *domain_length
  3114. # # with: { phi_ele_1D_py: $phi_ele_1D, nx_py: $nx, ny_py: $ny}
  3115. # exec: |
  3116. # import numpy as np
  3117. # from debug_flower import butler_grad_phi,vecb_L,butler,veci
  3118. # print('\n \033[93m')
  3119. # print()
  3120. # print('[print_electrical_potential] Poisson iter',poisson_iter,'\033[0m')
  3121. # # print('\n \033[93m'+'Pycall ','\033[0m')
  3122. # phi = veci(phi_ele_1D_py,nx_py,ny_py,1)
  3123. # # print('\n \033[93m'+'phi ',np.min(phi_ele_1D_py),np.max(phi_ele_1D_py),'\033[0m')
  3124. # print('\n \033[93m'+'Conductivity min',np.min(elec_cond_1D_py),'max',np.max(elec_cond_1D_py),'\033[0m')
  3125. # # print('\n \033[93m'+'BC_phi_ele_left ',np.min(BC_phi_ele_left_py),np.max(BC_phi_ele_left_py),'\033[0m')
  3126. # # print('\n \033[93m'+'i_current_x min ',np.min(i_current_x_py),'max ',np.max(i_current_x_py),'\033[0m')
  3127. # # print('\n \033[93m'+'i_current_x_py ',i_current_x_py[:,ny_py//2],'\033[0m')
  3128. # # print('\n \033[93m'+'phi line ',phi[:,ny_py//2],'\033[0m') # vertical line
  3129. # # print('\n \033[93m'+'phi line ',phi[ny_py//2,:],'\033[0m') #horizontal line
  3130. # # min_phi = np.min(phi_ele_1D_py)
  3131. # # print('\n \033[93m'+'sum ',-i_current_x_py[:,ny_py//2]+butler(min_phi,phi_ele1,Faraday,alpha,Ru,temperature0,i0),'\033[0m')
  3132. # # print('\n \033[93m'+'Convergence Butler-Volmer ',np.max(np.abs(-i_current_x_py[:,ny_py//2]+butler(vecb_L(phi_ele_1D_py,nx_py,ny_py),phi_ele1,Faraday,alpha,Ru,temperature0,i0))),'\033[0m')
  3133. # # print('\n \033[93m'+'ratio ',(-i_current_x_py[:,ny_py//2]+butler(vecb_L(phi_ele_1D_py,nx_py,ny_py),phi_ele1,Faraday,alpha,Ru,temperature0,i0)/butler(0,phi_ele1,Faraday,alpha,Ru,temperature0,i0),phi_ele1,Faraday,alpha,Ru,temperature0,i0),'\033[0m')
  3134. # # print('\n \033[93m'+'sum ',butler(vecb_L(phi_ele_1D_py,nx_py,ny_py),phi_ele1,Faraday,alpha,Ru,temperature0,i0),'\033[0m')
  3135. # # print('\n \033[93m'+'sum ',butler(0,phi_ele1,Faraday,alpha,Ru,temperature0,i0),'\033[0m')
  3136. # # L = mesh_xmax-mesh_xmin
  3137. # # print('\n \033[93m'+'phi ',min_phi,-L*butler_grad_phi(min_phi,phi_ele1,Faraday,alpha,Ru,temperature0,concentration0_KOH,diffusion_coeff_KOH,i0),'\033[0m')
  3138. # # print('\n \033[93m'+'grad phi ',min_phi,butler_grad_phi(min_phi,phi_ele1,Faraday,alpha,Ru,temperature0,concentration0_KOH,diffusion_coeff_KOH,i0),'\033[0m')
  3139. # # print(vecb_L(phi_ele_1D_py,nx_py,ny_py))
  3140. # # from debug_flower import vecbprint,veci, butler
  3141. # # # vecbprint(phi_ele_1D_py,nx_py,ny_py)
  3142. # # phi = veci(phi_ele_1D_py,nx_py,ny_py,1)
  3143. # # # print(phi[nx_py/2,:])
  3144. # # # print(phi[:,nx_py/2])
  3145. # # # a = 0.66
  3146. # # a = 0.6608349877730476
  3147. # # L= 1e-4
  3148. # # npoints=2
  3149. # # xplot_new = np.linspace(0, L, npoints)
  3150. # # yplot_new = a * (xplot_new / L - 1)
  3151. # # print("Residual {:.2e} absolute variation {:.2e}".format(residual_electrical_potential,variation_electrical_potential))
  3152. # # #num.electrical_potential_residual
  3153. # print('\033[0m')
  3154. # - exec: import plot_flower; plot_flower.print_bc(phi_ele_1D_py) #TODO bug hdf5 so put debugging functions in debug_flower.py
  3155. # write_data_elec_ix_iy:
  3156. # with:
  3157. # ix: $i_current_x
  3158. # iy: $i_current_y
  3159. # exec: |
  3160. # import numpy as np
  3161. # print('\n \033[93m')
  3162. # print('Current i_x {:.2e} i_y {:.2e}'.format(np.max(ix),np.max(iy)))
  3163. # print('\033[0m')
  3164. # write_data_elec_imag:
  3165. # with: { imag: $i_current_mag }
  3166. # exec: |
  3167. # import numpy as np
  3168. # print('\033[93m')
  3169. # print('Current magnitude {:.2e} '.format( np.max(imag) ) )
  3170. # print('\033[0m')
  3171. write_data_elec_ix_iy:
  3172. with:
  3173. ix: $i_current_x
  3174. iy: $i_current_y
  3175. imag: $i_current_mag
  3176. exec: |
  3177. import numpy as np
  3178. print('\n \033[93m')
  3179. print('Current i_x {:.2e} i_y {:.2e} i_mag {:.2e}'.format(np.max(ix),np.max(iy),np.max(imag)))
  3180. print('\033[0m')
  3181. # write_data:
  3182. # - exec: print('Test nstep',nstep_py)
  3183. # with: { nstep_py: $nstep }
  3184. # - exec: from debug_flower import vecbprint; vecbprint(p_1D_py,nx_py,ny_py)
  3185. # with: { p_1D_py: $p_1D, nx_py: $nx, ny_py: $ny}
  3186. # - exec: import plot_flower; plot_flower.print_bc(p_1D_py) #TODO bug hdf5 so put debugging functions in debug_flower.py
  3187. # check_concentrations:
  3188. # - exec: print('Test nstep',nstep_py)
  3189. # write_scalar_transport:
  3190. # # CRED = '\033[91m'
  3191. # # CEND = '\033[0m'
  3192. # - exec: print('\033[91m Test iscal',iscal_py,'\033[0m')
  3193. # with: { iscal_py: $iscal }
  3194. testing: #python event to plot with matplotlib
  3195. exec: from plot_pdi import plot_bc2; plot_bc2()
  3196. # write_data:
  3197. # with: { iter_id: $nstep, source_field: $main_field }
  3198. # exec: |
  3199. # import numpy as np
  3200. # if 0 < iter_id < 4:
  3201. # transformed_field = np.sqrt(source_field[1:-1,1:-1])
  3202. # pdi.expose('transformed_field', transformed_field, pdi.OUT)
  3203. # mpi:
  3204. #TODO careful: when to update nstep so that stored in right file with multi expose
  3205. #TODO careful make first write overwrite so that old data does not remain
  3206. decl_hdf5: #Writing in hdf5
  3207. # - file: results/data_${nstep:08}_${mpi_coords_x:02}_${mpi_coords_y:02}.h5
  3208. - file: convergence_Butler.h5
  3209. collision_policy: replace #write_into overwrite old file #TODO
  3210. on_event: convergence_study
  3211. write: [nx_list,cell_volume_list,l1_rel_error,l2_rel_error,linfty_rel_error,l1_rel_error_full_cells,l2_rel_error_full_cells,linfty_rel_error_full_cells,l1_rel_error_partial_cells,l2_rel_error_partial_cells,linfty_rel_error_partial_cells,min_cell_volume]
  3212. #domain_length
  3213. # #write segments of interface
  3214. # - file: convergence_Poiseuille_${nstep:08}.h5
  3215. # collision_policy: write_into
  3216. # on_event: convergence_study_iter
  3217. # # write: [intfc_vtx_num,intfc_vtx_x,intfc_vtx_y,intfc_vtx_field,intfc_seg_num,intfc_vtx_connectivities]
  3218. # write: [nstep,levelset_p,normal_angle,phi_ele_1D,radius,intfc_vtx_num,intfc_vtx_x,intfc_vtx_y,intfc_vtx_field,intfc_seg_num,intfc_vtx_connectivities]
  3219. - file: flower_${nstep:08}.h5
  3220. collision_policy: replace #write_into overwrite old file #TODO
  3221. on_event: write_initialization
  3222. # datasets: #Dataset we are writing in: the whole solution
  3223. # data:
  3224. # type: array
  3225. # subtype: double
  3226. # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3227. # when: "$nstep = 0"
  3228. write: [levelset_p,levelset_u,levelset_v,radius,nstep,time,velocity_x,velocity_y]
  3229. #write: [levelset_p,levelset_u,levelset_v,levelset_p_wall,radius]
  3230. - file: flower_${nstep:08}.h5
  3231. collision_policy: replace #replace_and_warn #write_into overwrite old file #TODO
  3232. on_event: write_data_start_loop
  3233. # datasets: #Dataset we are writing in: the whole solution
  3234. # data:
  3235. # type: array
  3236. # subtype: double
  3237. # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3238. # when: "$nstep%50 = 0"
  3239. write: [levelset_p,levelset_u,levelset_v,radius,nstep,time] #,normal_angle]
  3240. - file: flower_${nstep:08}.h5
  3241. collision_policy: write_into #write_into overwrite old file #TODO
  3242. on_event: write_radius
  3243. write: [radius]
  3244. - file: flower_${nstep:08}.h5
  3245. collision_policy: write_into #write_into overwrite old file #TODO
  3246. on_event: write_normal_phase_change_velocity
  3247. write: [normal_phase_change_velocity] #,normal_an
  3248. - file: flower_${nstep:08}.h5
  3249. collision_policy: write_into #write_into overwrite old file #TODO
  3250. on_event: write_advection_velocity_before_extension
  3251. write: [advection_velocity_before_extension_u,advection_velocity_before_extension_v]
  3252. - file: flower_${nstep:08}.h5
  3253. collision_policy: write_into #write_into overwrite old file #TODO
  3254. on_event: write_mass_transfer_rate_uv
  3255. write: [mass_transfer_rate_u,mass_transfer_rate_v]
  3256. - file: flower_${nstep:08}.h5
  3257. collision_policy: write_into #write_into overwrite old file #TODO
  3258. on_event: write_normal_uv
  3259. write: [normal_u,normal_v]
  3260. - file: flower_${nstep:08}.h5
  3261. collision_policy: write_into #write_into overwrite old file #TODO
  3262. on_event: write_advection_velocity_phase_change
  3263. write: [advection_velocity_phase_change_u,advection_velocity_phase_change_v]
  3264. - file: flower_${nstep:08}.h5
  3265. collision_policy: write_into #write_into overwrite old file #TODO
  3266. on_event: write_advection_velocity_bulk
  3267. write: [advection_velocity_bulk_u,advection_velocity_bulk_v]
  3268. - file: flower_${nstep:08}.h5
  3269. collision_policy: write_into #write_into overwrite old file #TODO
  3270. on_event: write_advection
  3271. write: [advection_velocity_u,advection_velocity_v]
  3272. - file: flower_${nstep:08}.h5
  3273. collision_policy: write_into #write_into overwrite old file #TODO
  3274. on_event: write_interpolated_advection_velocity_before_extension
  3275. write: [advection_velocity_before_extension_x,advection_velocity_before_extension_y]
  3276. - file: flower_${nstep:08}.h5
  3277. collision_policy: write_into #write_into overwrite old file #TODO
  3278. on_event: write_interpolated_advection_velocity_phase_change
  3279. write: [advection_velocity_phase_change_x,advection_velocity_phase_change_y]
  3280. - file: flower_${nstep:08}.h5
  3281. collision_policy: write_into #write_into overwrite old file #TODO
  3282. on_event: write_interpolated_advection_velocity_bulk
  3283. write: [advection_velocity_bulk_x,advection_velocity_bulk_y]
  3284. - file: flower_${nstep:08}.h5
  3285. collision_policy: write_into #write_into overwrite old file #TODO
  3286. on_event: write_interpolated_advection_velocity
  3287. write: [advection_velocity_x,advection_velocity_y]
  3288. - file: flower_${nstep:08}.h5
  3289. collision_policy: write_into #write_into overwrite old file #TODO
  3290. on_event: write_advection_bulk_velocity
  3291. write: [advection_bulk_velocity] #,normal_an
  3292. - file: flower_${nstep:08}.h5
  3293. collision_policy: write_into #write_into overwrite old file #TODO
  3294. on_event: check_divergence
  3295. # datasets: #Dataset we are writing in: the whole solution
  3296. # data:
  3297. # type: array
  3298. # subtype: double
  3299. # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3300. # when: "$nstep%50 = 0"
  3301. write: [nstep,velocity_divergence] #,normal_angle]
  3302. - file: flower_${nstep:08}.h5
  3303. collision_policy: write_into #write_into overwrite old file #TODO
  3304. on_event: print_conservation
  3305. write: [nstep,conservation] #,normal_angle]
  3306. # #write segments of interface
  3307. # - file: flower_${nstep:08}.h5
  3308. # collision_policy: write_into
  3309. # on_event: write_data_start_loop
  3310. # write: [intfc_vtx_num,intfc_vtx_x,intfc_vtx_y,intfc_vtx_field,intfc_seg_num,intfc_vtx_connectivities]
  3311. #write mass flux used in phase change
  3312. - file: flower_${nstep:08}.h5
  3313. collision_policy: write_into
  3314. on_event: write_mass_transfer_rate
  3315. # datasets: #Dataset we are writing in: the whole solution
  3316. # data:
  3317. # type: array
  3318. # subtype: double
  3319. # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3320. # when: #"$nstep%50 = 0"
  3321. write: [mass_transfer_rate,mass_transfer_rate_bulk,mass_transfer_rate_border,mass_transfer_rate_intfc]
  3322. - file: flower_${nstep:08}.h5
  3323. collision_policy: write_into
  3324. on_event: write_mass_transfer_rate_redistributed
  3325. # datasets: #Dataset we are writing in: the whole solution
  3326. # data:
  3327. # type: array
  3328. # subtype: double
  3329. # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3330. # when: #"$nstep%50 = 0"
  3331. write: [mass_transfer_rate,mass_transfer_rate_before_redistribution,nb_gaz_acceptors]
  3332. - file: flower_${nstep:08}.h5
  3333. collision_policy: write_into
  3334. on_event: write_mass_transfer_rate_only
  3335. write: [mass_transfer_rate]
  3336. - file: flower_${nstep:08}.h5
  3337. collision_policy: write_into
  3338. on_event: write_interface_length
  3339. write: [interface_length]
  3340. # - file: flower_${nstep:08}.h5
  3341. # collision_policy: write_into
  3342. # on_event: write_electrical_potential
  3343. # # datasets: #Dataset we are writing in: the whole solution
  3344. # # data:
  3345. # # type: array
  3346. # # subtype: double
  3347. # # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3348. # # when: "$iscal = -1" #"$iscal = 1" #"$nstep%50 = 0"
  3349. # write: [rhs_1D,phi_ele_1D] #,trans_scal_1DT"] #chi_1,chi_2]
  3350. - file: flower_${nstep:08}.h5
  3351. collision_policy: write_into
  3352. on_event: write_scalar_transport
  3353. # datasets: #Dataset we are writing in: the whole solution
  3354. # data:
  3355. # type: array
  3356. # subtype: double
  3357. # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3358. when: "$iscal = 1" #2 #"$iscal = -1" #"$iscal = 1" #"$nstep%50 = 0"
  3359. write: [iscal,rhs_1D] #chi_1,chi_2]
  3360. - file: flower_${nstep:08}.h5
  3361. collision_policy: write_into
  3362. on_event: write_iso
  3363. write: [levelset_iso]
  3364. # - file: flower_${nstep:08}.h5
  3365. # collision_policy: write_into
  3366. # on_event: write_capacities
  3367. # # datasets: #Dataset we are writing in: the whole solution
  3368. # # data:
  3369. # # type: array
  3370. # # subtype: double
  3371. # # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3372. # # when: #"$nstep%50 = 0"
  3373. # write: [dcap] #chi_1,chi_2]
  3374. - file: flower_${nstep:08}.h5
  3375. collision_policy: write_into
  3376. on_event: write_capacities
  3377. # datasets: #Dataset we are writing in: the whole solution
  3378. # data:
  3379. # type: array
  3380. # subtype: double
  3381. # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3382. # when: #"$nstep%50 = 0"
  3383. write: [dcap_1,dcap_2,dcap_3,dcap_4]
  3384. # #write capacities
  3385. # - file: flower_${nstep:08}.h5
  3386. # collision_policy: write_into
  3387. # on_event: write_capacities
  3388. # datasets: # a list of datasets inside the file created on first access
  3389. # #*** define the datasets for main_field
  3390. # dcap_1: { type: array, subtype: double, size: [1, '$nx', '$ny'] }
  3391. # write:
  3392. # dcap: # the name of the data to write
  3393. # dataset: dcap_1
  3394. # memory_selection: #only H2O
  3395. # size: [1, '$nx', '$ny']
  3396. # start: [0,0,0]
  3397. # - file: flower_${nstep:08}.h5
  3398. # collision_policy: write_into
  3399. # on_event: write_capacities
  3400. # datasets: # a list of datasets inside the file created on first access
  3401. # #*** define the datasets for main_field
  3402. # dcap_2: { type: array, subtype: double, size: [1, '$nx', '$ny'] }
  3403. # write:
  3404. # dcap: # the name of the data to write
  3405. # dataset: dcap_2
  3406. # memory_selection: #only H2O
  3407. # size: [1, '$nx', '$ny']
  3408. # start: [1,0,0]
  3409. # - file: flower_${nstep:08}.h5
  3410. # collision_policy: write_into
  3411. # on_event: write_capacities
  3412. # datasets: # a list of datasets inside the file created on first access
  3413. # #*** define the datasets for main_field
  3414. # dcap_3: { type: array, subtype: double, size: [1, '$nx', '$ny'] }
  3415. # write:
  3416. # dcap: # the name of the data to write
  3417. # dataset: dcap_3
  3418. # memory_selection: #only H2O
  3419. # size: [1, '$nx', '$ny']
  3420. # start: [2,0,0]
  3421. # - file: flower_${nstep:08}.h5
  3422. # collision_policy: write_into
  3423. # on_event: write_capacities
  3424. # datasets: # a list of datasets inside the file created on first access
  3425. # #*** define the datasets for main_field
  3426. # dcap_4: { type: array, subtype: double, size: [1, '$nx', '$ny'] }
  3427. # write:
  3428. # dcap: # the name of the data to write
  3429. # dataset: dcap_4
  3430. # memory_selection: #only H2O
  3431. # size: [1, '$nx', '$ny']
  3432. # start: [3,0,0]
  3433. #write velocity for LS advection
  3434. - file: flower_${nstep:08}.h5
  3435. collision_policy: write_into
  3436. on_event: write_before_LS_adv
  3437. # datasets: #Dataset we are writing in: the whole solution
  3438. # data:
  3439. # type: array
  3440. # subtype: double
  3441. # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3442. # when: #"$nstep%50 = 0"
  3443. write: [normal_velocity_intfc]
  3444. # - file: flower_${nstep:08}.h5
  3445. # collision_policy: write_into
  3446. # on_event: write_data
  3447. # # datasets: #Dataset we are writing in: the whole solution
  3448. # # data:
  3449. # # type: array
  3450. # # subtype: double
  3451. # # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3452. # # when: "$nstep%50 = 0"
  3453. # write: [u_1D,v_1D,p_1D,time,nstep,velocity_x,velocity_y] #,phi_ele_1D,i_current_x,i_current_y,i_current_mag]
  3454. # #,trans_scal_1D_H2,trans_scal_1D_KOH,trans_scal_1D_H2O] #,levelset_p,levelset_u,levelset_v]
  3455. #write_data
  3456. # - file: mesh_${nx:08}.h5
  3457. # collision_policy: write_into
  3458. # on_event: write_data
  3459. # # datasets: #Dataset we are writing in: the whole solution
  3460. # # data:
  3461. # # type: array
  3462. # # subtype: double
  3463. # # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3464. # # when: "$nstep%50 = 0"
  3465. # write: [u_1D,v_1D,p_1D,time,nx,velocity_x,velocity_y,phi_ele_1D,levelset_p] #,i_current_x,i_current_y,i_current_mag]
  3466. # #,trans_scal_1D_H2,trans_scal_1D_KOH,trans_scal_1D_H2O] #,levelset_p,levelset_u,levelset_v]
  3467. - file: flower_${nstep:08}.h5
  3468. collision_policy: write_into
  3469. on_event: viscosity_coeff_for_du_dx
  3470. write: [viscosity_coeff_for_du_dx]
  3471. - file: flower_${nstep:08}.h5
  3472. collision_policy: write_into
  3473. on_event: viscosity_coeff_for_dv_dy
  3474. write: [viscosity_coeff_for_dv_dy]
  3475. - file: flower_${nstep:08}.h5
  3476. collision_policy: write_into
  3477. on_event: viscosity_coeff_for_du_dy
  3478. write: [viscosity_coeff_for_du_dy]
  3479. - file: flower_${nstep:08}.h5
  3480. collision_policy: write_into
  3481. on_event: viscosity_coeff_for_dv_dx
  3482. write: [viscosity_coeff_for_dv_dx]
  3483. - file: flower_${nstep:08}.h5
  3484. collision_policy: write_into
  3485. on_event: write_rhs_uv_v
  3486. write: [rhs_uv_v]
  3487. - file: flower_${nstep:08}.h5
  3488. collision_policy: write_into
  3489. on_event: rhs_uv_divergence
  3490. write: [rhs_uv_divergence]
  3491. # - file: flower_${nstep:08}.h5
  3492. # collision_policy: write_into
  3493. # on_event: grad_pres_y
  3494. # write: [grad_pres_y]
  3495. # - file: flower_${nstep:08}.h5
  3496. # collision_policy: write_into
  3497. # on_event: grav_y
  3498. # write: [grav_y]
  3499. - file: flower_${nstep:08}.h5
  3500. collision_policy: write_into
  3501. on_event: conv_y
  3502. write: [conv_y]
  3503. - file: flower_${nstep:08}.h5
  3504. collision_policy: write_into
  3505. on_event: write_data
  3506. # datasets: #Dataset we are writing in: the whole solution
  3507. # data:
  3508. # type: array
  3509. # subtype: double
  3510. # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3511. # when: "$nstep%50 = 0"
  3512. write: [u_1D,v_1D,p_1D,time,timestep,nx,ny,velocity_x,velocity_y,phi_ele_1D,levelset_p,levelset_u,levelset_v] #,i_current_x,i_current_y,i_current_mag]
  3513. #,trans_scal_1D_H2,trans_scal_1D_KOH,trans_scal_1D_H2O] #,levelset_p,levelset_u,levelset_v]
  3514. - file: flower_${nstep:08}.h5
  3515. collision_policy: write_into
  3516. on_event: write_velocity_prediction
  3517. write: [u_prediction,v_prediction]
  3518. - file: flower_${nstep:08}.h5
  3519. collision_policy: write_into
  3520. on_event: write_one_fluid
  3521. # datasets: #Dataset we are writing in: the whole solution
  3522. # data:
  3523. # type: array
  3524. # subtype: double
  3525. # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3526. # when: "$nstep%50 = 0"
  3527. write: [nstep,rho_one_fluid,rho_one_fluid_u,rho_one_fluid_v,volume_fraction] #mu_one_fluid
  3528. - file: flower_${nstep:08}.h5
  3529. collision_policy: write_into
  3530. on_event: write_one_fluid_surface_tension
  3531. # datasets: #Dataset we are writing in: the whole solution
  3532. # data:
  3533. # type: array
  3534. # subtype: double
  3535. # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3536. # when: "$nstep%50 = 0"
  3537. write: [volume_fraction,grad_u,grad_v,curvature_p,curvature_u,curvature_v,volumic_surface_tension_u,volumic_surface_tension_v,normal_x,normal_y,normal_angle]
  3538. - file: flower_${nstep:08}.h5
  3539. collision_policy: write_into
  3540. on_event: write_one_fluid_smoothed_volume_fraction
  3541. write: [smoothed_volume_fraction]
  3542. - file: flower_${nstep:08}.h5
  3543. collision_policy: write_into
  3544. on_event: write_one_fluid_levelset
  3545. write: [levelset_surface_tension,levelset_heavyside]
  3546. - file: poisson_${nx:08}_${poisson_iter:08}.h5
  3547. collision_policy: write_into
  3548. on_event: check_electrical_potential
  3549. write: [poisson_iter,nx,ny,phi_ele_1D,i_current_x,i_current_y,levelset_p,residual_electrical_potential,variation_electrical_potential]
  3550. # $BC_phi_ele_left,elec_cond_1D
  3551. # phi_ele_1D_py: $phi_ele_1D
  3552. # i_current_x_py: $i_current_x
  3553. # nx_py: $nx
  3554. # ny_py: $ny]
  3555. # write_data_elec_ix_iy
  3556. # - file: mesh_${nx:08}.h5 #flower_${nstep:08}.h5
  3557. # collision_policy: write_into
  3558. # on_event: write_data_elec_ix_iy
  3559. # write: [i_current_x,i_current_y,phi_ele_1D]
  3560. - file: flower_${nstep:08}.h5
  3561. collision_policy: write_into
  3562. on_event: write_data_elec_ix_iy
  3563. write: [i_current_x,i_current_y,phi_ele_1D]
  3564. - file: mesh_${nx:08}.h5 #flower_${nstep:08}.h5
  3565. collision_policy: write_into
  3566. on_event: write_data_elec_imag
  3567. write: [i_current_mag]
  3568. - file: flower_${nstep:08}.h5
  3569. collision_policy: write_into
  3570. on_event: debug_phase_change
  3571. write: [vtx_num,vtx_x,vtx_y]
  3572. #write concentration for H2 only : data selection
  3573. # - file: flower_${nstep:08}.h5 #Name of the file
  3574. - file: flower_${nstep:08}.h5 #mesh_${nx:08}.h5
  3575. collision_policy: write_into
  3576. when: "$nb_transported_scalars>0"
  3577. on_event: write_data
  3578. datasets: # a list of datasets inside the file created on first access
  3579. #*** define the datasets for main_field
  3580. concentration_H2_1DT: { type: array, subtype: double, size: [1,'($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny'] }
  3581. write:
  3582. trans_scal_1DT: # the name of the data to write
  3583. dataset: concentration_H2_1DT
  3584. memory_selection: #only H2O
  3585. size: [1,'($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny']
  3586. start: [0,0]
  3587. # - file: flower_${nstep:08}.h5 #Name of the file
  3588. - file: flower_${nstep:08}.h5
  3589. collision_policy: write_into
  3590. when: "$nb_transported_scalars>0"
  3591. on_event: write_data
  3592. datasets: # a list of datasets inside the file created on first access
  3593. #*** define the datasets for main_field
  3594. concentration_KOH_1DT: { type: array, subtype: double, size: [1,'($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny'] }
  3595. write:
  3596. trans_scal_1DT: # the name of the data to write
  3597. dataset: concentration_KOH_1DT
  3598. memory_selection: #only H2O
  3599. size: [1,'($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny']
  3600. start: [1,0]
  3601. # - file: flower_${nstep:08}.h5 #Name of the file test.h5
  3602. - file: flower_${nstep:08}.h5
  3603. collision_policy: write_into
  3604. when: "$nb_transported_scalars>0"
  3605. on_event: write_data
  3606. datasets: # a list of datasets inside the file created on first access
  3607. #*** define the datasets for main_field
  3608. concentration_H2O_1DT: { type: array, subtype: double, size: [1,'($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny'] }
  3609. write:
  3610. trans_scal_1DT: # the name of the data to write
  3611. dataset: concentration_H2O_1DT
  3612. memory_selection: #only H2O
  3613. size: [1,'($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny']
  3614. start: [2,0]