convergence_diffusion_constant_conductivity_bubble_wall_Newton.yml 159 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388
  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. i_current_x: { size: '($ny) * ($nx)', type: array, subtype: double }
  2477. i_current_y: { size: '($ny) * ($nx)', type: array, subtype: double }
  2478. i_current_mag: { size: '($ny) * ($nx)', type: array, subtype: double }
  2479. # stored in 1D: tests
  2480. l1_rel_error: { size: '$n_tests', type: array, subtype: double }
  2481. l2_rel_error: { size: '$n_tests', type: array, subtype: double }
  2482. linfty_rel_error: { size: '$n_tests', type: array, subtype: double }
  2483. l1_rel_error_full_cells: { size: '$n_tests', type: array, subtype: double }
  2484. l2_rel_error_full_cells: { size: '$n_tests', type: array, subtype: double }
  2485. linfty_rel_error_full_cells: { size: '$n_tests', type: array, subtype: double }
  2486. l1_rel_error_partial_cells: { size: '$n_tests', type: array, subtype: double }
  2487. l2_rel_error_partial_cells: { size: '$n_tests', type: array, subtype: double }
  2488. linfty_rel_error_partial_cells: { size: '$n_tests', type: array, subtype: double }
  2489. nx_list: { size: '$n_tests', type: array, subtype: int64 }
  2490. cell_volume_list: { size: '$n_tests', type: array, subtype: double }
  2491. n_tests: int64
  2492. domain_length: double
  2493. min_cell_volume: double
  2494. # Store segments of interface in 1D vectors
  2495. 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' ]
  2496. intfc_vtx_y: { size: '$intfc_vtx_num', type: array, subtype: double }
  2497. vtx_x: { size: '$vtx_num', type: array, subtype: double } #TODO vector x y fields all together in size: [ '$intfc_vtx_num', '$nscalars+2' ]
  2498. vtx_y: { size: '$vtx_num', type: array, subtype: double }
  2499. intfc_vtx_field: { size: '$intfc_vtx_num', type: array, subtype: double }
  2500. # intfc_vtx_connectivities: { size: '2*($intfc_vtx_num)', type: array, subtype: int64 }
  2501. intfc_vtx_connectivities: { size: '2*($intfc_seg_num)', type: array, subtype: int64 }
  2502. # stored in 2D
  2503. i_current_x: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2504. i_current_y: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2505. i_current_mag: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2506. levelset_iso: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2507. levelset_p: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2508. levelset_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2509. levelset_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2510. advection_velocity_p: { size: [ '$nx', '$ny' ], type: array, subtype: double }
  2511. advection_velocity_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double }
  2512. advection_velocity_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double }
  2513. advection_velocity_bulk_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double }
  2514. advection_velocity_bulk_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double }
  2515. advection_velocity_phase_change_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double }
  2516. advection_velocity_phase_change_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double }
  2517. advection_velocity_before_extension_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double }
  2518. advection_velocity_before_extension_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double }
  2519. mass_transfer_rate_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double }
  2520. mass_transfer_rate_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double }
  2521. normal_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double }
  2522. normal_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double }
  2523. #interpolated
  2524. advection_velocity_x: { size: [ '$nx', '$ny' ], type: array, subtype: double }
  2525. advection_velocity_y: { size: [ '$nx', '$ny' ], type: array, subtype: double }
  2526. advection_velocity_phase_change_x: { size: [ '$nx', '$ny' ], type: array, subtype: double }
  2527. advection_velocity_phase_change_y: { size: [ '$nx', '$ny' ], type: array, subtype: double }
  2528. advection_velocity_bulk_x: { size: [ '$nx', '$ny' ], type: array, subtype: double }
  2529. advection_velocity_bulk_y: { size: [ '$nx', '$ny' ], type: array, subtype: double }
  2530. advection_velocity_before_extension_x: { size: [ '$nx', '$ny' ], type: array, subtype: double }
  2531. advection_velocity_before_extension_y: { size: [ '$nx', '$ny' ], type: array, subtype: double }
  2532. normal_phase_change_velocity: { size: [ '$nx', '$ny' ], type: array, subtype: double }
  2533. levelset_p_wall: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2534. velocity_x: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2535. velocity_y: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2536. mass_transfer_rate: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2537. mass_transfer_rate_redistributed: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2538. mass_transfer_rate_before_redistribution: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2539. nb_gaz_acceptors: { size: [ '$nx', '$ny' ], type: array, subtype: int64 } #Field of the current subdomain
  2540. mass_transfer_rate_bulk: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2541. mass_transfer_rate_border: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2542. mass_transfer_rate_intfc: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2543. normal_angle: { size: [ '$nx', '$ny' ], type: array, subtype: double } # angle to compute normal (cos,sin) in 2D
  2544. normal_velocity_intfc: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2545. dcap_1: { size: [ '$nx', '$ny'], type: array, subtype: double } #Field of the current subdomain
  2546. dcap_2: { size: [ '$nx', '$ny'], type: array, subtype: double } #Field of the current subdomain
  2547. dcap_3: { size: [ '$nx', '$ny'], type: array, subtype: double } #Field of the current subdomain
  2548. dcap_4: { size: [ '$nx', '$ny'], type: array, subtype: double } #Field of the current subdomain
  2549. grad_x_coord: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2550. grad_y_coord: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2551. grad_x: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2552. grad_y: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2553. grad_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2554. grad_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2555. grad_pres_y: { size: [ '$nx', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2556. grav_y: { size: [ '$nx', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2557. conv_y: { size: [ '$nx', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2558. velocity_divergence: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2559. normalise_velocity_divergence: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2560. rho_one_fluid: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2561. mu_one_fluid: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2562. volume_cell: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2563. volume_fraction: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2564. smoothed_volume_fraction: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2565. levelset_surface_tension: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2566. levelset_heavyside: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2567. curvature_p: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2568. curvature_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2569. curvature_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2570. volumic_surface_tension_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2571. volumic_surface_tension_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2572. viscosity_coeff_for_du_dx: { size: [ '$nx+2', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2573. viscosity_coeff_for_dv_dy: { size: [ '$nx', '$ny+2' ], type: array, subtype: double } #Field of the current subdomain
  2574. viscosity_coeff_for_du_dy: { size: [ '$nx+1', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2575. viscosity_coeff_for_dv_dx: { size: [ '$nx+1', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2576. rho_one_fluid_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2577. rho_one_fluid_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2578. rhs_uv_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2579. rhs_uv_divergence: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2580. mesh_p_x: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2581. mesh_p_y: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2582. # stored in 3D
  2583. dcap: { size: [ 11,'$nx', '$ny'], type: array, subtype: double } #Field of the current subdomain
  2584. iscal: int64 #Index for naming files
  2585. poisson_iter: int64 #Index for naming files
  2586. # Convergence criteria
  2587. residual_electrical_potential: double
  2588. variation_electrical_potential: double
  2589. concentration_check_value: double
  2590. concentration_check_min: double
  2591. concentration_check_max: double
  2592. concentration_check_mean: double
  2593. conductivity_u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2594. conductivity_v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2595. #chi
  2596. # chi_1: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2597. # chi_2: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2598. # chi_3: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2599. # To save only bulk field, with u given in Flower
  2600. # u: { size: [ '$nx+1', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2601. # v: { size: [ '$nx', '$ny+1' ], type: array, subtype: double } #Field of the current subdomain
  2602. # trans_scal: { size: [ '$nx', '$ny','$nb_transported_scalars' ], type: array, subtype: double } #Field of the current subdomain
  2603. # phi_ele: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2604. # iu: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2605. # iv: { size: [ '$nx', '$ny' ], type: array, subtype: double } #Field of the current subdomain
  2606. plugins:
  2607. # trace: ~
  2608. pycall:
  2609. # logging: "debug"
  2610. on_event:
  2611. # close_pycall:
  2612. # exec: |
  2613. # Py_FinalizeEx()
  2614. # init_PDI:
  2615. # exec: |
  2616. # print('\n \033[93m'+'test init PDI','\033[0m')
  2617. # print('Py_IsInitialized',Py_IsInitialized)
  2618. # init_PDI2:
  2619. # exec: |
  2620. # print('\n \033[93m'+'test init PDI','\033[0m')
  2621. # print('Py_IsInitialized',Py_IsInitialized)
  2622. # - exec: print('nb levelsets',nLS)
  2623. # with: { nLS: $nb_levelsets }
  2624. check_pressure_velocity_end:
  2625. with:
  2626. nx: $nx
  2627. ny: $ny
  2628. u_1D: $u_1D
  2629. v_1D: $v_1D
  2630. p_1D: $p_1D
  2631. grad_x: $grad_x
  2632. grad_y: $grad_y
  2633. mu_cin1: *mu_cin1
  2634. rho1: *rho1
  2635. v_inlet: *v_inlet
  2636. xmin: *mesh_xmin
  2637. xmax: *mesh_xmax
  2638. ymin: *mesh_ymin
  2639. ymax: *mesh_ymax
  2640. exec: |
  2641. import numpy as np
  2642. print('\033[38;5;206m')
  2643. # print('\033[36m')
  2644. print('[check_pressure_velocity_end]')
  2645. 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)))
  2646. 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)))
  2647. 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)))
  2648. # print('\033[0m')
  2649. print("min(grad_x) {u:.2e} min(grad_y) {v:.2e} ".format(u=np.min(grad_x),v=np.min(grad_y)))
  2650. print("max(grad_x) {u:.2e} max(grad_y) {v:.2e} ".format(u=np.max(grad_x),v=np.max(grad_y)))
  2651. from debug_flower import veci
  2652. field_index = 1
  2653. # # slice_1D = veci(v_1D,nx,ny,field_index)[ny//2,:]
  2654. # # print('slice projection', slice_1D)
  2655. # # print('len',len(slice_1D))
  2656. # print('nx',nx,ny)
  2657. # slice_1D = veci(v_1D,nx,ny+1,field_index)[(ny+1)//2,:]
  2658. # print('slice projection', slice_1D)
  2659. # # print('len',len(slice_1D))
  2660. # # Print p and v
  2661. # # for j in range(0,ny):
  2662. # # slice_p = veci(p_1D,nx,ny,field_index)[j,:]
  2663. # # print('Slice p',j,slice_p)
  2664. # # slice_1D = veci(v_1D,nx,ny+1,field_index)[j,:]
  2665. # # print('Slice v',j,slice_1D)
  2666. pressure_equal_on_line = True
  2667. # Print v
  2668. for j in range(0,ny):
  2669. slice_p = veci(p_1D,nx,ny,field_index)[j,:]
  2670. if (max(slice_p)-min(slice_p))/min(slice_p) > 1.0e-10:
  2671. pressure_equal_on_line = False
  2672. print('Slice p',j,max(slice_p)-min(slice_p),(max(slice_p)-min(slice_p))/min(slice_p) )
  2673. # print('Slice p',j,slice_p)
  2674. slice_1D = veci(v_1D,nx,ny+1,field_index)[j,:]
  2675. # print('Slice v',j,slice_1D)
  2676. mu1 = mu_cin1 * rho1
  2677. # print('mu1',mu1)
  2678. x_1D = 0
  2679. y_1D = 0
  2680. # import numpy as np
  2681. xp = np.zeros(nx)
  2682. yp = np.zeros(ny)
  2683. # xp = np.linspace(float(mesh["xmin"]), float(mesh["xmax"]), int(mesh["nx"]))
  2684. # yp = np.linspace(float(mesh["ymin"]), float(mesh["ymax"]), int(mesh["ny"]))
  2685. dx = (xmax - xmin) / nx
  2686. dy = (ymax - ymin) / ny
  2687. # print('len(xp)',len(xp),len(yp))
  2688. xp[0] = xmin + dx/2
  2689. yp[0] = ymin + dy/2
  2690. for i in range(1,len(xp)):
  2691. xp[i] = xp[i-1]+dx
  2692. for i in range(1,len(yp)):
  2693. yp[i] = yp[i-1]+dx
  2694. yv = yp + dy / 2
  2695. yv = np.insert(yv, 0, yp[0] - dy / 2)
  2696. # print('xp',xp) #xv too
  2697. # print('yp',yp)
  2698. # print('yv',yv)
  2699. # p
  2700. from debug_flower import vecb, vecb_B,vecb_T,vecb_L,vecb_R
  2701. p_top = 0
  2702. p_bottom = p_top + 8*mu1/(xmax-xmin)*v_inlet
  2703. p_along_y = p_bottom + (yv - ymin)*(p_top-p_bottom)/(ymax - ymin)
  2704. print('p',p_along_y)
  2705. print('Bottom',vecb_B(p_1D,nx,ny))
  2706. print('Top',vecb_T(p_1D,nx,ny))
  2707. print('Left',vecb_L(p_1D,nx,ny))
  2708. print('Right',vecb_R(p_1D,nx,ny))
  2709. # v
  2710. slice_v_exact = 4* v_inlet * xp /(xmax-xmin)*(1-xp/(xmax-xmin))
  2711. print('slice v exact', slice_v_exact)
  2712. # def Poiseuille(v_inlet,xp_full,xmin,xmax):
  2713. # slice_v_exact = 4* v_inlet * xp_full /(xmax-xmin)*(1-xp_full/(xmax-xmin))
  2714. # return slice_v_exact
  2715. # xp_full = xmin
  2716. # print('Poiseuille',xp_full,Poiseuille(v_inlet,xp_full,xmin,xmax))
  2717. # xp_full = xmax
  2718. # print('Poiseuille',xp_full,Poiseuille(v_inlet,xp_full,xmin,xmax))
  2719. print('\033[0m')
  2720. write_initialization:
  2721. 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}
  2722. exec: |
  2723. import numpy as np
  2724. print('\033[93m')
  2725. # print('Initialization')
  2726. 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)))
  2727. 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)))
  2728. 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)))
  2729. # print("min(cH2) %.6e", minscal1L))\t$(@sprintf("min(KOH) %.6e", minscal2L))\t$(@sprintf("min(H2O) %.6e", minscal3L))\n")
  2730. # print("max(cH2) %.6e", maxscal1L))\t$(@sprintf("max(KOH) %.6e", maxscal2L))\t$(@sprintf("max(H2O) %.6e", maxscal3L))\n")
  2731. # print("moy(cH2) %.6e", moyscal1L))\t$(@sprintf("moy(KOH) %.6e", moyscal2L))\t$(@sprintf("moy(H2O) %.6e", moyscal3L))\n")
  2732. print('\033[0m')
  2733. # write_electrical_conductivity:
  2734. # with:
  2735. # elec_cond_1D: $elec_cond_1D
  2736. # conductivity_u: $conductivity_u
  2737. # conductivity_v: $conductivity_v
  2738. # nx_py: $nx
  2739. # ny_py: $ny
  2740. # exec: |
  2741. # from debug_flower import vecb
  2742. # # print('write_electrical_conductivity')
  2743. # # print('coeffD borders ',vecb(elec_cond_1D,nx_py,ny_py))
  2744. # # print('coeffDu border ',conductivity_u[:,ny_py//2])
  2745. # # print('coeffDv border ',conductivity_v[nx_py//2,:])
  2746. # # print('coeffDu border ',conductivity_u[ny_py//2,:])
  2747. # # print('coeffDv border ',conductivity_v[:,nx_py//2])
  2748. print_start_temporal_iteration:
  2749. with:
  2750. time: $time
  2751. nstep: $nstep
  2752. dcap: $dcap
  2753. exec: |
  2754. print('\033[93m')
  2755. print()
  2756. print('Iteration {nstep:d} time {time:.2e}'.format(nstep=nstep,time=time))
  2757. # print('Check cut-cell operators ',dcap[:,1,1])
  2758. print('\033[0m')
  2759. print_before_prediction:
  2760. with: { nx: $nx, ny: $ny, u_1D: $u_1D, v_1D: $v_1D, p_1D: $p_1D}
  2761. exec: |
  2762. import numpy as np
  2763. print('\033[36m')
  2764. print('[Before prediction]')
  2765. 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)))
  2766. 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)))
  2767. 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)))
  2768. print('\033[0m')
  2769. # from debug_flower import veci
  2770. # field_index = 1
  2771. # # slice_1D = veci(v_1D,nx,ny,field_index)[ny//2,:]
  2772. # # print('slice projection', slice_1D)
  2773. # # print('len',len(slice_1D))
  2774. # # print('nx',nx,ny)
  2775. # slice_1D = veci(v_1D,nx,ny+1,field_index)[(ny+1)//2,:]
  2776. # print('slice projection', slice_1D)
  2777. # # print('len',len(slice_1D))
  2778. # for j in range(0,ny):
  2779. # slice_p = veci(p_1D,nx,ny,field_index)[ny-1-j,:] #0: end (top), ny, 1
  2780. # print('Slice p',j,slice_p)
  2781. # # from plot_pdi import plot_profile; plot_profile(x,slice_1D,"Poiseuille_during_projection")
  2782. print_pressure_gradient_in_prediction:
  2783. with:
  2784. grad_x_1D: $grad_x_1D
  2785. grad_y_1D: $grad_y_1D
  2786. p_1D: $p_1D
  2787. nx: $nx
  2788. ny: $ny
  2789. # mu_cin1: *mu_cin1
  2790. # rho1: *rho1
  2791. # v_inlet: *v_inlet
  2792. xmin: *mesh_xmin
  2793. xmax: *mesh_xmax
  2794. ymin: *mesh_ymin
  2795. ymax: *mesh_ymax
  2796. exec: |
  2797. import numpy as np
  2798. print('\033[36m')
  2799. print('[print_pressure_gradient_in_prediction]')
  2800. dx = (xmax-xmin)/ nx
  2801. volume = dx**2
  2802. # grad_x = np.reshape(grad_x_1D, (nx, ny))
  2803. # grad_y = np.reshape(grad_y_1D, (nx, ny))
  2804. grad_x = np.reshape(grad_x_1D, (nx+1, ny))
  2805. grad_y = np.reshape(grad_y_1D, (nx, ny+1))
  2806. grad_x = grad_x.transpose()
  2807. grad_y = grad_y.transpose()
  2808. for j in range(0,ny):
  2809. slice_p = grad_x[j,:] #0: end (top), ny, 1
  2810. print('grad_x',j,slice_p)
  2811. for j in range(0,ny+1):
  2812. slice_p = grad_y[j,:] #0: end (top), ny, 1
  2813. print('grad_y',j,slice_p)
  2814. # # Select only useful part of vector, the actual gradient
  2815. # grad_x = grad_x[:,1:-1] #size ny, nx-1
  2816. # grad_y = grad_y[1:-1,:] #size ny-1, nx
  2817. 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))
  2818. 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))
  2819. 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))
  2820. # for j in range(0,ny):
  2821. # slice_p = grad_x[j,:] #0: end (top), ny, 1
  2822. # print('grad_x',j,slice_p)
  2823. # for j in range(0,ny-1):
  2824. # slice_p = grad_y[j,:] #0: end (top), ny, 1
  2825. # print('grad_y',j,slice_p)
  2826. from debug_flower import vecb, vecb_B, vecb_T, vecb_L,vecb_R
  2827. print('bottom BC pressure',vecb_B(p_1D,nx,ny))
  2828. print('top BC pressure',vecb_T(p_1D,nx,ny))
  2829. print('left BC pressure',vecb_L(p_1D,nx,ny))
  2830. print('right BC pressure',vecb_R(p_1D,nx,ny))
  2831. # print('vecb pressure',vecb(p_1D,nx,ny))
  2832. print('\033[0m')
  2833. print_variables:
  2834. with:
  2835. phi_ele_1D_py: $phi_ele_1D
  2836. nx_py: $nx
  2837. ny_py: $ny
  2838. u_1D: $u_1D
  2839. v_1D: $v_1D
  2840. p_1D: $p_1D
  2841. trans_scal_1DT: $trans_scal_1DT
  2842. nb_transported_scalars: *nb_transported_scalars
  2843. exec: |
  2844. import numpy as np
  2845. print('\033[93m')
  2846. print('[print_variables]')
  2847. 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)))
  2848. 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)))
  2849. 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)))
  2850. if nb_transported_scalars>0:
  2851. 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,:])))
  2852. 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,:])))
  2853. 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,:])))
  2854. print('\033[0m')
  2855. mesh:
  2856. with:
  2857. mesh_x_1D_py: $mesh_x_1D
  2858. grad_x_coord_py: $grad_x_coord
  2859. nx_py: $nx
  2860. ny_py: $ny
  2861. exec: |
  2862. from debug_flower import veci
  2863. # mesh in 1 line in x direction at j = 0
  2864. print('\n \033[93m'+'mesh x ',veci(mesh_x_1D_py,nx_py,ny_py,1)[0,:],'\033[0m')
  2865. print('\n \033[93m'+'corr x ',veci(grad_x_coord_py,nx_py+1,ny_py,1)[0,:],'\033[0m')
  2866. check_electrical_potential_convergence:
  2867. with:
  2868. # BC_phi_ele_left_py: $BC_phi_ele_left
  2869. residual_py: $residual_1D
  2870. phi_ele_1D_py: $phi_ele_1D
  2871. elec_cond_1D_py: $elec_cond_1D
  2872. rhs_1D: $rhs_1D
  2873. dcap_1: $dcap_1
  2874. # i_current_x_py: $i_current_x
  2875. nx_py: $nx
  2876. ny_py: $ny
  2877. # phi_ele1: $phi_ele1
  2878. alpha: *alpha
  2879. i0: *i0
  2880. phi_ele1: *phi_ele1
  2881. Faraday: *Faraday
  2882. Ru: *Ru
  2883. temperature0: *temperature0
  2884. concentration0_KOH: *concentration0_KOH
  2885. diffusion_coeff_KOH: *diffusion_coeff_KOH
  2886. mesh_xmax: *mesh_xmax
  2887. mesh_xmin: *mesh_xmin
  2888. domain_length: *domain_length
  2889. # with: { phi_ele_1D_py: $phi_ele_1D, nx_py: $nx, ny_py: $ny}
  2890. exec: |
  2891. import numpy as np
  2892. from debug_flower import butler_grad_phi,vecb_L,butler,veci
  2893. print('\n \033[93m')
  2894. print()
  2895. print('[check_electrical_potential_convergence]')
  2896. print('phi wall ',vecb_L(phi_ele_1D_py,nx_py,ny_py))
  2897. # print('F_residual ',vecb_L(residual_py,nx_py,ny_py)) #array at wall
  2898. # print('F_residual ',np.min(vecb_L(residual_py,nx_py,ny_py)), np.max(vecb_L(residual_py,nx_py,ny_py)))
  2899. # print('F_residual bulk', np.min(veci(residual_py,nx_py,ny_py,1)), np.max(veci(residual_py,nx_py,ny_py,1)) )
  2900. # print('len(dcap_1[1,:])',len(dcap_1[1,:]))
  2901. # print('dcap',dcap_1[1,:])
  2902. # print('F_residual /dx (homogeneous to a gradient of potential)',vecb_L(residual_py,nx_py,ny_py)/dcap_1[1,:])
  2903. # 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))
  2904. # print('F_residual normalized (unitless)',vecb_L(residual_py,nx_py,ny_py)/dcap_1[1,:]/vecb_L(rhs_1D,nx_py,ny_py))
  2905. 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))))
  2906. # print('vecb_L(rhs_1D,nx_py,ny_py)',vecb_L(rhs_1D,nx_py,ny_py))
  2907. print('\033[0m')
  2908. warning_scalar_transport:
  2909. with:
  2910. iscal: $iscal
  2911. trans_scal_1DT: $trans_scal_1DT
  2912. concentration_check_value: $concentration_check_value
  2913. nb_levelsets: *nb_levelsets
  2914. nb_transported_scalars: *nb_transported_scalars
  2915. activate_interface: *activate_interface
  2916. concentration_check_factor: *concentration_check_factor
  2917. concentration0_H2: *concentration0_H2
  2918. concentration0_KOH: *concentration0_KOH
  2919. concentration0_H2O: *concentration0_H2O
  2920. exec: |
  2921. print('\n \033[91m')
  2922. print()
  2923. concentration0 = [concentration0_H2,concentration0_KOH,concentration0_H2O]
  2924. if iscal == 1:
  2925. 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)))
  2926. elif iscal == 2:
  2927. 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)))
  2928. elif iscal == 3:
  2929. 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)))
  2930. # concentration drop:(minimum(ph.trans_scal[:,:,iscal])-num.concentration0[iscal])/num.concentration0[iscal]*100)
  2931. print("concentration too low")
  2932. print('\033[0m')
  2933. check_scalar_transport_interface:
  2934. with:
  2935. iscal: $iscal
  2936. nb_levelsets: *nb_levelsets
  2937. nb_transported_scalars: *nb_transported_scalars
  2938. activate_interface: *activate_interface
  2939. # concentration_check_value: $concentration_check_value
  2940. concentration_check_min: $concentration_check_min
  2941. concentration_check_max: $concentration_check_max
  2942. concentration_check_mean: $concentration_check_mean
  2943. trans_scal_1DT: $trans_scal_1DT
  2944. concentration0_H2: *concentration0_H2
  2945. concentration0_KOH: *concentration0_KOH
  2946. concentration0_H2O: *concentration0_H2O
  2947. concentration_check_factor: *concentration_check_factor
  2948. # concentration0: $concentration0
  2949. # concentration0: << *concentration0
  2950. # <<: *concentration0
  2951. # <<: *concentration0
  2952. exec: |
  2953. print('\n \033[92m')
  2954. print()
  2955. print('[check_scalar_transport_interface]')
  2956. concentration0 = np.array([concentration0_H2,concentration0_KOH,concentration0_H2O])
  2957. 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))
  2958. concentration_check_value = concentration_check_min
  2959. if iscal == 1:
  2960. 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)))
  2961. elif iscal == 2:
  2962. 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)))
  2963. elif iscal == 3:
  2964. 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)))
  2965. print('\033[0m')
  2966. #Checks after resolution if the values are physical
  2967. check_scalar_transport:
  2968. with:
  2969. iscal: $iscal
  2970. nb_levelsets: *nb_levelsets
  2971. nb_transported_scalars: *nb_transported_scalars
  2972. activate_interface: *activate_interface
  2973. trans_scal_1DT: $trans_scal_1DT
  2974. # concentration0: $concentration0
  2975. # concentration0: *concentration0
  2976. # <<: *concentration0
  2977. concentration0_H2: *concentration0_H2
  2978. concentration0_KOH: *concentration0_KOH
  2979. concentration0_H2O: *concentration0_H2O
  2980. mask_1D: $mask_1D #mask containing volumes in bulk, and liquid heights on interfaces, and 0 when a cell is cut
  2981. # so that small cells are ignored when computing min, max, ...
  2982. exec: |
  2983. print('\n \033[92m')
  2984. print()
  2985. print('[check_scalar_transport]')
  2986. 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,:])))
  2987. 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,:])))
  2988. 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,:])))
  2989. print('with mask')
  2990. scal0 = np.ma.masked_where(mask_1D <= 0.0, trans_scal_1DT[0,:])
  2991. scal1 = np.ma.masked_where(mask_1D <= 0.0, trans_scal_1DT[1,:])
  2992. scal2 = np.ma.masked_where(mask_1D <= 0.0, trans_scal_1DT[2,:])
  2993. print('with mask')
  2994. 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)))
  2995. 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)))
  2996. 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)))
  2997. concentration0 = np.array([concentration0_H2,concentration0_KOH,concentration0_H2O])
  2998. # concentration0 = [concentration0_H2[0],concentration0_KOH[0],concentration0_H2O[0]]
  2999. # print("concentration0",concentration0)
  3000. # print('concentration0_H2',concentration0_H2)
  3001. # try:
  3002. # print('concentration0_H2',concentration0_H2[0])
  3003. # except:
  3004. # print('no ')
  3005. # print('types',type(iscal),type(concentration0_H2),type(concentration0))
  3006. # # print average value at interface
  3007. # if activate_interface !=0:
  3008. # iLS = 1
  3009. # # nonzero = mean_intfc_non_null(ph.trans_scalD,iscal,grid,iLS) #Value at interface
  3010. # index = iLS+1
  3011. # num=0
  3012. # nonzero = 0.0
  3013. # # cf veci @view a[g.ny*g.nx*(p-1)+1:g.ny*g.nx*p]
  3014. # for scal_intfc in veci(scalD):
  3015. # if abs(scal_intfc) >0.0:
  3016. # nonzero += scalD[i,iscal]
  3017. # num += 1
  3018. # if num == 0:
  3019. # print("no intfc in mean_intfc_non_null")
  3020. # else:
  3021. # nonzero /= num
  3022. # print("Mean value at interface {:.2e}".format(nonzero))
  3023. print('\033[0m')
  3024. check_electrical_potential:
  3025. with:
  3026. poisson_iter: $poisson_iter
  3027. BC_phi_ele_left_py: $BC_phi_ele_left
  3028. elec_cond_1D_py: $elec_cond_1D
  3029. phi_ele_1D_py: $phi_ele_1D
  3030. i_current_x_py: $i_current_x
  3031. i_current_x: $i_current_x
  3032. i_current_y: $i_current_y
  3033. i_current_mag: $i_current_mag
  3034. nx_py: $nx
  3035. ny_py: $ny
  3036. variation_electrical_potential: $variation_electrical_potential
  3037. residual_electrical_potential: $residual_electrical_potential
  3038. residual_1D: $residual_1D
  3039. rhs_1D: $rhs_1D
  3040. # phi_ele1: $phi_ele1
  3041. alpha: *alpha
  3042. i0: *i0
  3043. phi_ele1: *phi_ele1
  3044. Faraday: *Faraday
  3045. Ru: *Ru
  3046. temperature0: *temperature0
  3047. concentration0_KOH: *concentration0_KOH
  3048. diffusion_coeff_KOH: *diffusion_coeff_KOH
  3049. mesh_xmax: *mesh_xmax
  3050. mesh_xmin: *mesh_xmin
  3051. domain_length: *domain_length
  3052. # with: { phi_ele_1D_py: $phi_ele_1D, nx_py: $nx, ny_py: $ny}
  3053. exec: |
  3054. import numpy as np
  3055. from debug_flower import butler_grad_phi,vecb_L,butler,veci
  3056. print('\n \033[93m')
  3057. print()
  3058. # print('check_electrical_potential')
  3059. print('[check_electrical_potential] Poisson iter',poisson_iter,'\033[0m')
  3060. print("Residual {:.2e} absolute variation {:.2e}".format(residual_electrical_potential,variation_electrical_potential))
  3061. # #num.electrical_potential_residual
  3062. # print('\n \033[93m'+'Pycall ','\033[0m')
  3063. min_phi = np.min(phi_ele_1D_py)
  3064. phi = veci(phi_ele_1D_py,nx_py,ny_py,1)
  3065. # print('\n \033[93m'+'phi ',np.min(phi_ele_1D_py),np.max(phi_ele_1D_py),'\033[0m')
  3066. # print('\n \033[93m'+'Conductivity min',np.min(elec_cond_1D_py),'max',np.max(elec_cond_1D_py),'\033[0m')
  3067. 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)))
  3068. residual_electrical_potential_total = np.max(abs(residual_1D)) / np.max(abs(rhs_1D))
  3069. print("Residual wall {:.2e} whole {:.2e}".format(residual_electrical_potential_wall,residual_electrical_potential_total))
  3070. # print('\n \033[93m'+'BC_phi_ele_left ',np.min(BC_phi_ele_left_py),np.max(BC_phi_ele_left_py),'\033[0m')
  3071. # print('\n \033[93m'+'i_current_x min ',np.min(i_current_x_py),'max ',np.max(i_current_x_py),'\033[0m')
  3072. # print('\n \033[93m'+'i_current_x_py ',i_current_x_py[:,ny_py//2],'\033[0m')
  3073. # print('\n \033[93m'+'phi line ',phi[:,ny_py//2],'\033[0m') # vertical line
  3074. # print('\n \033[93m'+'phi line ',phi[ny_py//2,:],'\033[0m') #horizontal line
  3075. # min_phi = np.min(phi_ele_1D_py)
  3076. # print('\n \033[93m'+'sum ',-i_current_x_py[:,ny_py//2]+butler(min_phi,phi_ele1,Faraday,alpha,Ru,temperature0,i0),'\033[0m')
  3077. # 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')
  3078. # 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')
  3079. # 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')
  3080. # print('\n \033[93m'+'sum ',butler(0,phi_ele1,Faraday,alpha,Ru,temperature0,i0),'\033[0m')
  3081. # L = mesh_xmax-mesh_xmin
  3082. # 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')
  3083. # 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')
  3084. # print(vecb_L(phi_ele_1D_py,nx_py,ny_py))
  3085. # from debug_flower import vecbprint,veci, butler
  3086. # # vecbprint(phi_ele_1D_py,nx_py,ny_py)
  3087. # phi = veci(phi_ele_1D_py,nx_py,ny_py,1)
  3088. # # print(phi[nx_py/2,:])
  3089. # # print(phi[:,nx_py/2])
  3090. # # a = 0.66
  3091. # a = 0.6608349877730476
  3092. # L= 1e-4
  3093. # npoints=2
  3094. # xplot_new = np.linspace(0, L, npoints)
  3095. # yplot_new = a * (xplot_new / L - 1)
  3096. print('\033[0m')
  3097. # print_electrical_potential:
  3098. # with:
  3099. # poisson_iter: $poisson_iter
  3100. # BC_phi_ele_left_py: $BC_phi_ele_left
  3101. # elec_cond_1D_py: $elec_cond_1D
  3102. # phi_ele_1D_py: $phi_ele_1D
  3103. # i_current_x_py: $i_current_x
  3104. # nx_py: $nx
  3105. # ny_py: $ny
  3106. # # variation_electrical_potential: $variation_electrical_potential
  3107. # # residual_electrical_potential: $residual_electrical_potential
  3108. # # phi_ele1: $phi_ele1
  3109. # alpha: *alpha
  3110. # i0: *i0
  3111. # phi_ele1: *phi_ele1
  3112. # Faraday: *Faraday
  3113. # Ru: *Ru
  3114. # temperature0: *temperature0
  3115. # concentration0_KOH: *concentration0_KOH
  3116. # diffusion_coeff_KOH: *diffusion_coeff_KOH
  3117. # mesh_xmax: *mesh_xmax
  3118. # mesh_xmin: *mesh_xmin
  3119. # domain_length: *domain_length
  3120. # # with: { phi_ele_1D_py: $phi_ele_1D, nx_py: $nx, ny_py: $ny}
  3121. # exec: |
  3122. # import numpy as np
  3123. # from debug_flower import butler_grad_phi,vecb_L,butler,veci
  3124. # print('\n \033[93m')
  3125. # print()
  3126. # print('[print_electrical_potential] Poisson iter',poisson_iter,'\033[0m')
  3127. # # print('\n \033[93m'+'Pycall ','\033[0m')
  3128. # phi = veci(phi_ele_1D_py,nx_py,ny_py,1)
  3129. # # print('\n \033[93m'+'phi ',np.min(phi_ele_1D_py),np.max(phi_ele_1D_py),'\033[0m')
  3130. # print('\n \033[93m'+'Conductivity min',np.min(elec_cond_1D_py),'max',np.max(elec_cond_1D_py),'\033[0m')
  3131. # # print('\n \033[93m'+'BC_phi_ele_left ',np.min(BC_phi_ele_left_py),np.max(BC_phi_ele_left_py),'\033[0m')
  3132. # # print('\n \033[93m'+'i_current_x min ',np.min(i_current_x_py),'max ',np.max(i_current_x_py),'\033[0m')
  3133. # # print('\n \033[93m'+'i_current_x_py ',i_current_x_py[:,ny_py//2],'\033[0m')
  3134. # # print('\n \033[93m'+'phi line ',phi[:,ny_py//2],'\033[0m') # vertical line
  3135. # # print('\n \033[93m'+'phi line ',phi[ny_py//2,:],'\033[0m') #horizontal line
  3136. # # min_phi = np.min(phi_ele_1D_py)
  3137. # # print('\n \033[93m'+'sum ',-i_current_x_py[:,ny_py//2]+butler(min_phi,phi_ele1,Faraday,alpha,Ru,temperature0,i0),'\033[0m')
  3138. # # 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')
  3139. # # 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')
  3140. # # 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')
  3141. # # print('\n \033[93m'+'sum ',butler(0,phi_ele1,Faraday,alpha,Ru,temperature0,i0),'\033[0m')
  3142. # # L = mesh_xmax-mesh_xmin
  3143. # # 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')
  3144. # # 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')
  3145. # # print(vecb_L(phi_ele_1D_py,nx_py,ny_py))
  3146. # # from debug_flower import vecbprint,veci, butler
  3147. # # # vecbprint(phi_ele_1D_py,nx_py,ny_py)
  3148. # # phi = veci(phi_ele_1D_py,nx_py,ny_py,1)
  3149. # # # print(phi[nx_py/2,:])
  3150. # # # print(phi[:,nx_py/2])
  3151. # # # a = 0.66
  3152. # # a = 0.6608349877730476
  3153. # # L= 1e-4
  3154. # # npoints=2
  3155. # # xplot_new = np.linspace(0, L, npoints)
  3156. # # yplot_new = a * (xplot_new / L - 1)
  3157. # # print("Residual {:.2e} absolute variation {:.2e}".format(residual_electrical_potential,variation_electrical_potential))
  3158. # # #num.electrical_potential_residual
  3159. # print('\033[0m')
  3160. # - exec: import plot_flower; plot_flower.print_bc(phi_ele_1D_py) #TODO bug hdf5 so put debugging functions in debug_flower.py
  3161. # write_data_elec_ix_iy:
  3162. # with:
  3163. # ix: $i_current_x
  3164. # iy: $i_current_y
  3165. # exec: |
  3166. # import numpy as np
  3167. # print('\n \033[93m')
  3168. # print('Current i_x {:.2e} i_y {:.2e}'.format(np.max(ix),np.max(iy)))
  3169. # print('\033[0m')
  3170. # write_data_elec_imag:
  3171. # with: { imag: $i_current_mag }
  3172. # exec: |
  3173. # import numpy as np
  3174. # print('\033[93m')
  3175. # print('Current magnitude {:.2e} '.format( np.max(imag) ) )
  3176. # print('\033[0m')
  3177. write_data_elec_ix_iy:
  3178. with:
  3179. ix: $i_current_x
  3180. iy: $i_current_y
  3181. imag: $i_current_mag
  3182. exec: |
  3183. import numpy as np
  3184. print('\n \033[93m')
  3185. print('Current i_x {:.2e} i_y {:.2e} i_mag {:.2e}'.format(np.max(ix),np.max(iy),np.max(imag)))
  3186. print('\033[0m')
  3187. # write_data:
  3188. # - exec: print('Test nstep',nstep_py)
  3189. # with: { nstep_py: $nstep }
  3190. # - exec: from debug_flower import vecbprint; vecbprint(p_1D_py,nx_py,ny_py)
  3191. # with: { p_1D_py: $p_1D, nx_py: $nx, ny_py: $ny}
  3192. # - exec: import plot_flower; plot_flower.print_bc(p_1D_py) #TODO bug hdf5 so put debugging functions in debug_flower.py
  3193. # check_concentrations:
  3194. # - exec: print('Test nstep',nstep_py)
  3195. # write_scalar_transport:
  3196. # # CRED = '\033[91m'
  3197. # # CEND = '\033[0m'
  3198. # - exec: print('\033[91m Test iscal',iscal_py,'\033[0m')
  3199. # with: { iscal_py: $iscal }
  3200. testing: #python event to plot with matplotlib
  3201. exec: from plot_pdi import plot_bc2; plot_bc2()
  3202. # write_data:
  3203. # with: { iter_id: $nstep, source_field: $main_field }
  3204. # exec: |
  3205. # import numpy as np
  3206. # if 0 < iter_id < 4:
  3207. # transformed_field = np.sqrt(source_field[1:-1,1:-1])
  3208. # pdi.expose('transformed_field', transformed_field, pdi.OUT)
  3209. # mpi:
  3210. #TODO careful: when to update nstep so that stored in right file with multi expose
  3211. #TODO careful make first write overwrite so that old data does not remain
  3212. decl_hdf5: #Writing in hdf5
  3213. # - file: results/data_${nstep:08}_${mpi_coords_x:02}_${mpi_coords_y:02}.h5
  3214. - file: convergence_Butler.h5
  3215. collision_policy: replace #write_into overwrite old file #TODO
  3216. on_event: convergence_study
  3217. 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]
  3218. #domain_length
  3219. # #write segments of interface
  3220. # - file: convergence_Poiseuille_${nstep:08}.h5
  3221. # collision_policy: write_into
  3222. # on_event: convergence_study_iter
  3223. # # write: [intfc_vtx_num,intfc_vtx_x,intfc_vtx_y,intfc_vtx_field,intfc_seg_num,intfc_vtx_connectivities]
  3224. # 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]
  3225. - file: flower_${nstep:08}.h5
  3226. collision_policy: replace #write_into overwrite old file #TODO
  3227. on_event: write_initialization
  3228. # datasets: #Dataset we are writing in: the whole solution
  3229. # data:
  3230. # type: array
  3231. # subtype: double
  3232. # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3233. # when: "$nstep = 0"
  3234. write: [levelset_p,levelset_u,levelset_v,radius,nstep,time,velocity_x,velocity_y, i_current_x, i_current_y ,i_current_mag]
  3235. #write: [levelset_p,levelset_u,levelset_v,levelset_p_wall,radius]
  3236. - file: flower_${nstep:08}.h5
  3237. collision_policy: replace #replace_and_warn #write_into overwrite old file #TODO
  3238. on_event: write_data_start_loop
  3239. # datasets: #Dataset we are writing in: the whole solution
  3240. # data:
  3241. # type: array
  3242. # subtype: double
  3243. # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3244. # when: "$nstep%50 = 0"
  3245. write: [levelset_p,levelset_u,levelset_v,radius,nstep,time] #,normal_angle]
  3246. - file: flower_${nstep:08}.h5
  3247. collision_policy: write_into #write_into overwrite old file #TODO
  3248. on_event: write_radius
  3249. write: [radius]
  3250. - file: flower_${nstep:08}.h5
  3251. collision_policy: write_into #write_into overwrite old file #TODO
  3252. on_event: write_normal_phase_change_velocity
  3253. write: [normal_phase_change_velocity] #,normal_an
  3254. - file: flower_${nstep:08}.h5
  3255. collision_policy: write_into #write_into overwrite old file #TODO
  3256. on_event: write_advection_velocity_before_extension
  3257. write: [advection_velocity_before_extension_u,advection_velocity_before_extension_v]
  3258. - file: flower_${nstep:08}.h5
  3259. collision_policy: write_into #write_into overwrite old file #TODO
  3260. on_event: write_mass_transfer_rate_uv
  3261. write: [mass_transfer_rate_u,mass_transfer_rate_v]
  3262. - file: flower_${nstep:08}.h5
  3263. collision_policy: write_into #write_into overwrite old file #TODO
  3264. on_event: write_normal_uv
  3265. write: [normal_u,normal_v]
  3266. - file: flower_${nstep:08}.h5
  3267. collision_policy: write_into #write_into overwrite old file #TODO
  3268. on_event: write_advection_velocity_phase_change
  3269. write: [advection_velocity_phase_change_u,advection_velocity_phase_change_v]
  3270. - file: flower_${nstep:08}.h5
  3271. collision_policy: write_into #write_into overwrite old file #TODO
  3272. on_event: write_advection_velocity_bulk
  3273. write: [advection_velocity_bulk_u,advection_velocity_bulk_v]
  3274. - file: flower_${nstep:08}.h5
  3275. collision_policy: write_into #write_into overwrite old file #TODO
  3276. on_event: write_advection
  3277. write: [advection_velocity_u,advection_velocity_v]
  3278. - file: flower_${nstep:08}.h5
  3279. collision_policy: write_into #write_into overwrite old file #TODO
  3280. on_event: write_interpolated_advection_velocity_before_extension
  3281. write: [advection_velocity_before_extension_x,advection_velocity_before_extension_y]
  3282. - file: flower_${nstep:08}.h5
  3283. collision_policy: write_into #write_into overwrite old file #TODO
  3284. on_event: write_interpolated_advection_velocity_phase_change
  3285. write: [advection_velocity_phase_change_x,advection_velocity_phase_change_y]
  3286. - file: flower_${nstep:08}.h5
  3287. collision_policy: write_into #write_into overwrite old file #TODO
  3288. on_event: write_interpolated_advection_velocity_bulk
  3289. write: [advection_velocity_bulk_x,advection_velocity_bulk_y]
  3290. - file: flower_${nstep:08}.h5
  3291. collision_policy: write_into #write_into overwrite old file #TODO
  3292. on_event: write_interpolated_advection_velocity
  3293. write: [advection_velocity_x,advection_velocity_y]
  3294. - file: flower_${nstep:08}.h5
  3295. collision_policy: write_into #write_into overwrite old file #TODO
  3296. on_event: write_advection_bulk_velocity
  3297. write: [advection_bulk_velocity] #,normal_an
  3298. - file: flower_${nstep:08}.h5
  3299. collision_policy: write_into #write_into overwrite old file #TODO
  3300. on_event: check_divergence
  3301. # datasets: #Dataset we are writing in: the whole solution
  3302. # data:
  3303. # type: array
  3304. # subtype: double
  3305. # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3306. # when: "$nstep%50 = 0"
  3307. write: [nstep,velocity_divergence] #,normal_angle]
  3308. - file: flower_${nstep:08}.h5
  3309. collision_policy: write_into #write_into overwrite old file #TODO
  3310. on_event: print_conservation
  3311. write: [nstep,conservation] #,normal_angle]
  3312. # #write segments of interface
  3313. # - file: flower_${nstep:08}.h5
  3314. # collision_policy: write_into
  3315. # on_event: write_data_start_loop
  3316. # write: [intfc_vtx_num,intfc_vtx_x,intfc_vtx_y,intfc_vtx_field,intfc_seg_num,intfc_vtx_connectivities]
  3317. #write mass flux used in phase change
  3318. - file: flower_${nstep:08}.h5
  3319. collision_policy: write_into
  3320. on_event: write_mass_transfer_rate
  3321. # datasets: #Dataset we are writing in: the whole solution
  3322. # data:
  3323. # type: array
  3324. # subtype: double
  3325. # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3326. # when: #"$nstep%50 = 0"
  3327. write: [mass_transfer_rate,mass_transfer_rate_bulk,mass_transfer_rate_border,mass_transfer_rate_intfc]
  3328. - file: flower_${nstep:08}.h5
  3329. collision_policy: write_into
  3330. on_event: write_mass_transfer_rate_redistributed
  3331. # datasets: #Dataset we are writing in: the whole solution
  3332. # data:
  3333. # type: array
  3334. # subtype: double
  3335. # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3336. # when: #"$nstep%50 = 0"
  3337. write: [mass_transfer_rate,mass_transfer_rate_before_redistribution,nb_gaz_acceptors]
  3338. - file: flower_${nstep:08}.h5
  3339. collision_policy: write_into
  3340. on_event: write_mass_transfer_rate_only
  3341. write: [mass_transfer_rate]
  3342. - file: flower_${nstep:08}.h5
  3343. collision_policy: write_into
  3344. on_event: write_interface_length
  3345. write: [interface_length]
  3346. # - file: flower_${nstep:08}.h5
  3347. # collision_policy: write_into
  3348. # on_event: write_electrical_potential
  3349. # # datasets: #Dataset we are writing in: the whole solution
  3350. # # data:
  3351. # # type: array
  3352. # # subtype: double
  3353. # # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3354. # # when: "$iscal = -1" #"$iscal = 1" #"$nstep%50 = 0"
  3355. # write: [rhs_1D,phi_ele_1D] #,trans_scal_1DT"] #chi_1,chi_2]
  3356. - file: flower_${nstep:08}.h5
  3357. collision_policy: write_into
  3358. on_event: write_scalar_transport
  3359. # datasets: #Dataset we are writing in: the whole solution
  3360. # data:
  3361. # type: array
  3362. # subtype: double
  3363. # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3364. when: "$iscal = 1" #2 #"$iscal = -1" #"$iscal = 1" #"$nstep%50 = 0"
  3365. write: [iscal,rhs_1D] #chi_1,chi_2]
  3366. - file: flower_${nstep:08}.h5
  3367. collision_policy: write_into
  3368. on_event: write_iso
  3369. write: [levelset_iso]
  3370. # - file: flower_${nstep:08}.h5
  3371. # collision_policy: write_into
  3372. # on_event: write_capacities
  3373. # # datasets: #Dataset we are writing in: the whole solution
  3374. # # data:
  3375. # # type: array
  3376. # # subtype: double
  3377. # # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3378. # # when: #"$nstep%50 = 0"
  3379. # write: [dcap] #chi_1,chi_2]
  3380. - file: flower_${nstep:08}.h5
  3381. collision_policy: write_into
  3382. on_event: write_capacities
  3383. # datasets: #Dataset we are writing in: the whole solution
  3384. # data:
  3385. # type: array
  3386. # subtype: double
  3387. # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3388. # when: #"$nstep%50 = 0"
  3389. write: [dcap_1,dcap_2,dcap_3,dcap_4]
  3390. # #write capacities
  3391. # - file: flower_${nstep:08}.h5
  3392. # collision_policy: write_into
  3393. # on_event: write_capacities
  3394. # datasets: # a list of datasets inside the file created on first access
  3395. # #*** define the datasets for main_field
  3396. # dcap_1: { type: array, subtype: double, size: [1, '$nx', '$ny'] }
  3397. # write:
  3398. # dcap: # the name of the data to write
  3399. # dataset: dcap_1
  3400. # memory_selection: #only H2O
  3401. # size: [1, '$nx', '$ny']
  3402. # start: [0,0,0]
  3403. # - file: flower_${nstep:08}.h5
  3404. # collision_policy: write_into
  3405. # on_event: write_capacities
  3406. # datasets: # a list of datasets inside the file created on first access
  3407. # #*** define the datasets for main_field
  3408. # dcap_2: { type: array, subtype: double, size: [1, '$nx', '$ny'] }
  3409. # write:
  3410. # dcap: # the name of the data to write
  3411. # dataset: dcap_2
  3412. # memory_selection: #only H2O
  3413. # size: [1, '$nx', '$ny']
  3414. # start: [1,0,0]
  3415. # - file: flower_${nstep:08}.h5
  3416. # collision_policy: write_into
  3417. # on_event: write_capacities
  3418. # datasets: # a list of datasets inside the file created on first access
  3419. # #*** define the datasets for main_field
  3420. # dcap_3: { type: array, subtype: double, size: [1, '$nx', '$ny'] }
  3421. # write:
  3422. # dcap: # the name of the data to write
  3423. # dataset: dcap_3
  3424. # memory_selection: #only H2O
  3425. # size: [1, '$nx', '$ny']
  3426. # start: [2,0,0]
  3427. # - file: flower_${nstep:08}.h5
  3428. # collision_policy: write_into
  3429. # on_event: write_capacities
  3430. # datasets: # a list of datasets inside the file created on first access
  3431. # #*** define the datasets for main_field
  3432. # dcap_4: { type: array, subtype: double, size: [1, '$nx', '$ny'] }
  3433. # write:
  3434. # dcap: # the name of the data to write
  3435. # dataset: dcap_4
  3436. # memory_selection: #only H2O
  3437. # size: [1, '$nx', '$ny']
  3438. # start: [3,0,0]
  3439. #write velocity for LS advection
  3440. - file: flower_${nstep:08}.h5
  3441. collision_policy: write_into
  3442. on_event: write_before_LS_adv
  3443. # datasets: #Dataset we are writing in: the whole solution
  3444. # data:
  3445. # type: array
  3446. # subtype: double
  3447. # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3448. # when: #"$nstep%50 = 0"
  3449. write: [normal_velocity_intfc]
  3450. # - file: flower_${nstep:08}.h5
  3451. # collision_policy: write_into
  3452. # on_event: write_data
  3453. # # datasets: #Dataset we are writing in: the whole solution
  3454. # # data:
  3455. # # type: array
  3456. # # subtype: double
  3457. # # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3458. # # when: "$nstep%50 = 0"
  3459. # 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]
  3460. # #,trans_scal_1D_H2,trans_scal_1D_KOH,trans_scal_1D_H2O] #,levelset_p,levelset_u,levelset_v]
  3461. #write_data
  3462. # - file: mesh_${nx:08}.h5
  3463. # collision_policy: write_into
  3464. # on_event: write_data
  3465. # # datasets: #Dataset we are writing in: the whole solution
  3466. # # data:
  3467. # # type: array
  3468. # # subtype: double
  3469. # # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3470. # # when: "$nstep%50 = 0"
  3471. # 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]
  3472. # #,trans_scal_1D_H2,trans_scal_1D_KOH,trans_scal_1D_H2O] #,levelset_p,levelset_u,levelset_v]
  3473. - file: flower_${nstep:08}.h5
  3474. collision_policy: write_into
  3475. on_event: viscosity_coeff_for_du_dx
  3476. write: [viscosity_coeff_for_du_dx]
  3477. - file: flower_${nstep:08}.h5
  3478. collision_policy: write_into
  3479. on_event: viscosity_coeff_for_dv_dy
  3480. write: [viscosity_coeff_for_dv_dy]
  3481. - file: flower_${nstep:08}.h5
  3482. collision_policy: write_into
  3483. on_event: viscosity_coeff_for_du_dy
  3484. write: [viscosity_coeff_for_du_dy]
  3485. - file: flower_${nstep:08}.h5
  3486. collision_policy: write_into
  3487. on_event: viscosity_coeff_for_dv_dx
  3488. write: [viscosity_coeff_for_dv_dx]
  3489. - file: flower_${nstep:08}.h5
  3490. collision_policy: write_into
  3491. on_event: write_rhs_uv_v
  3492. write: [rhs_uv_v]
  3493. - file: flower_${nstep:08}.h5
  3494. collision_policy: write_into
  3495. on_event: rhs_uv_divergence
  3496. write: [rhs_uv_divergence]
  3497. # - file: flower_${nstep:08}.h5
  3498. # collision_policy: write_into
  3499. # on_event: grad_pres_y
  3500. # write: [grad_pres_y]
  3501. # - file: flower_${nstep:08}.h5
  3502. # collision_policy: write_into
  3503. # on_event: grav_y
  3504. # write: [grav_y]
  3505. - file: flower_${nstep:08}.h5
  3506. collision_policy: write_into
  3507. on_event: conv_y
  3508. write: [conv_y]
  3509. - file: flower_${nstep:08}.h5
  3510. collision_policy: write_into
  3511. on_event: write_data
  3512. # datasets: #Dataset we are writing in: the whole solution
  3513. # data:
  3514. # type: array
  3515. # subtype: double
  3516. # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3517. # when: "$nstep%50 = 0"
  3518. 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]
  3519. #,trans_scal_1D_H2,trans_scal_1D_KOH,trans_scal_1D_H2O] #,levelset_p,levelset_u,levelset_v]
  3520. - file: flower_${nstep:08}.h5
  3521. collision_policy: write_into
  3522. on_event: write_velocity_prediction
  3523. write: [u_prediction,v_prediction]
  3524. - file: flower_${nstep:08}.h5
  3525. collision_policy: write_into
  3526. on_event: write_one_fluid
  3527. # datasets: #Dataset we are writing in: the whole solution
  3528. # data:
  3529. # type: array
  3530. # subtype: double
  3531. # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3532. # when: "$nstep%50 = 0"
  3533. write: [nstep,rho_one_fluid,rho_one_fluid_u,rho_one_fluid_v,volume_fraction] #mu_one_fluid
  3534. - file: flower_${nstep:08}.h5
  3535. collision_policy: write_into
  3536. on_event: write_one_fluid_surface_tension
  3537. # datasets: #Dataset we are writing in: the whole solution
  3538. # data:
  3539. # type: array
  3540. # subtype: double
  3541. # size: ['$nx*$mpi_max_coords_x', '$ny*$mpi_max_coords_y']
  3542. # when: "$nstep%50 = 0"
  3543. 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]
  3544. - file: flower_${nstep:08}.h5
  3545. collision_policy: write_into
  3546. on_event: write_one_fluid_smoothed_volume_fraction
  3547. write: [smoothed_volume_fraction]
  3548. - file: flower_${nstep:08}.h5
  3549. collision_policy: write_into
  3550. on_event: write_one_fluid_levelset
  3551. write: [levelset_surface_tension,levelset_heavyside]
  3552. - file: poisson_${nx:08}_${poisson_iter:08}.h5
  3553. collision_policy: write_into
  3554. on_event: check_electrical_potential
  3555. write: [poisson_iter,nx,ny,phi_ele_1D,i_current_x,i_current_y,levelset_p,residual_electrical_potential,variation_electrical_potential]
  3556. # $BC_phi_ele_left,elec_cond_1D
  3557. # phi_ele_1D_py: $phi_ele_1D
  3558. # i_current_x_py: $i_current_x
  3559. # nx_py: $nx
  3560. # ny_py: $ny]
  3561. # write_data_elec_ix_iy
  3562. # - file: mesh_${nx:08}.h5 #flower_${nstep:08}.h5
  3563. # collision_policy: write_into
  3564. # on_event: write_data_elec_ix_iy
  3565. # write: [i_current_x,i_current_y,phi_ele_1D]
  3566. - file: flower_${nstep:08}.h5
  3567. collision_policy: write_into
  3568. on_event: write_data_elec_ix_iy
  3569. write: [i_current_x,i_current_y,phi_ele_1D]
  3570. - file: mesh_${nx:08}.h5 #flower_${nstep:08}.h5
  3571. collision_policy: write_into
  3572. on_event: write_data_elec_imag
  3573. write: [i_current_mag]
  3574. - file: flower_${nstep:08}.h5
  3575. collision_policy: write_into
  3576. on_event: debug_phase_change
  3577. write: [vtx_num,vtx_x,vtx_y]
  3578. #write concentration for H2 only : data selection
  3579. # - file: flower_${nstep:08}.h5 #Name of the file
  3580. - file: flower_${nstep:08}.h5 #mesh_${nx:08}.h5
  3581. collision_policy: write_into
  3582. when: "$nb_transported_scalars>0"
  3583. on_event: write_data
  3584. datasets: # a list of datasets inside the file created on first access
  3585. #*** define the datasets for main_field
  3586. concentration_H2_1DT: { type: array, subtype: double, size: [1,'($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny'] }
  3587. write:
  3588. trans_scal_1DT: # the name of the data to write
  3589. dataset: concentration_H2_1DT
  3590. memory_selection: #only H2O
  3591. size: [1,'($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny']
  3592. start: [0,0]
  3593. # - file: flower_${nstep:08}.h5 #Name of the file
  3594. - file: flower_${nstep:08}.h5
  3595. collision_policy: write_into
  3596. when: "$nb_transported_scalars>0"
  3597. on_event: write_data
  3598. datasets: # a list of datasets inside the file created on first access
  3599. #*** define the datasets for main_field
  3600. concentration_KOH_1DT: { type: array, subtype: double, size: [1,'($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny'] }
  3601. write:
  3602. trans_scal_1DT: # the name of the data to write
  3603. dataset: concentration_KOH_1DT
  3604. memory_selection: #only H2O
  3605. size: [1,'($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny']
  3606. start: [1,0]
  3607. # - file: flower_${nstep:08}.h5 #Name of the file test.h5
  3608. - file: flower_${nstep:08}.h5
  3609. collision_policy: write_into
  3610. when: "$nb_transported_scalars>0"
  3611. on_event: write_data
  3612. datasets: # a list of datasets inside the file created on first access
  3613. #*** define the datasets for main_field
  3614. concentration_H2O_1DT: { type: array, subtype: double, size: [1,'($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny'] }
  3615. write:
  3616. trans_scal_1DT: # the name of the data to write
  3617. dataset: concentration_H2O_1DT
  3618. memory_selection: #only H2O
  3619. size: [1,'($nb_levelsets + 1) * ($ny) * ($nx) + 2 * ($nx) + 2 * $ny']
  3620. start: [2,0]