@@ -822,7 +822,8 @@ def getBoundaryLayers(self, which=["uRMS", "bRMS"], profiles=None,
822822
823823 for name in which :
824824 values = profiles [name ]
825- opt = sco .minimize_scalar (lambda z : - approx (z , fValues = values ), bounds = [0 , 0.5 ])
825+ opt = sco .minimize_scalar (
826+ lambda z : - approx (z , fValues = values ), bounds = [0 , 0.5 ])
826827 deltas [name ] = opt .x
827828
828829 return deltas
@@ -1225,46 +1226,48 @@ def fun(coeffs):
12251226 import matplotlib .pyplot as plt
12261227
12271228 # dirName = "run_3D_A4_M0.5_R1_Ra1e6"
1228- dirName = "run_3D_A4_M0.5_R1_Ra5e3 "
1229+ dirName = "run_3D_A4_M1_R1_Ra1.5e5 "
12291230 # dirName = "run_M4_R2"
12301231 # dirName = "test_M4_R2"
12311232 OutputFiles .VERBOSE = True
12321233 output = OutputFiles (dirName )
12331234
1234- if False :
1235+ if True :
12351236 series = output .getTimeSeries (which = ["ke" , "keH" , "keV" , "NuV" ])
12361237
12371238 plt .figure ("series" )
1238- plt .plot (output .times , series ["NuV" ], label = dirName )
1239+ plt .plot (output .times , series ["NuV" ], label = f"NuV ( { dirName } )" )
12391240 plt .legend ()
1241+ plt .xlabel ("Time" )
1242+ plt .tight_layout ()
12401243
12411244 start = 20
12421245
1243- if False :
1246+ if True :
12441247 which = ["bRMS" , "uRMS" , "uMean" ]
12451248
12461249 Nu = series ["NuV" ][start :].mean ()
12471250
12481251 profiles = output .getProfiles (
1249- which , start = start , batchSize = None )
1250- deltas = output .getBoundaryLayers (
1251- which , start = start , profiles = profiles )
1252+ which , start = start , stop = 51 , batchSize = None )
1253+ deltas = output .getBoundaryLayers (which , profiles = profiles )
12521254
12531255 for name , p in profiles .items ():
12541256 if "Mean" in name :
12551257 plt .figure ("Mean profiles" )
1256- plt .plot (p , output .z , label = name )
1258+ plt .plot (p , output .z , label = f" { name } ( { dirName } )" )
12571259 if "RMS" in name :
12581260 plt .figure ("RMS profiles" )
1259- plt .plot (p , output .z , label = name )
1261+ plt .plot (p , output .z , label = f" { name } ( { dirName } )" )
12601262 if name in deltas :
12611263 plt .hlines (deltas [name ], p .min (), p .max (), linestyles = "--" , colors = "black" )
12621264
12631265 for pType in ["Mean" , "RMS" ]:
12641266 plt .figure (f"{ pType } profiles" )
12651267 plt .legend ()
12661268 plt .xlabel ("profile" )
1267- plt .ylabel ("z coord" )
1269+ plt .ylabel ("$z$" )
1270+ plt .tight_layout ()
12681271
12691272 zLog = np .logspace (np .log10 (1 / (100 * Nu )), np .log10 (0.5 ), num = 200 )
12701273 approx = LagrangeApproximation (output .z )
@@ -1273,32 +1276,32 @@ def fun(coeffs):
12731276 bMean = (profiles ["bMean" ] + (1 - profiles ["bMean" ][- 1 ::- 1 ]))/ 2
12741277 bMean = mPz @ bMean
12751278
1276- bRMS = (profiles ["bRMS" ] + profiles ["bRMS" ][- 1 ::- 1 ])/ 2
1277- bRMS = mPz @ bRMS
1278-
12791279 plt .figure ("bmean-log" )
1280- plt .semilogx (zLog * Nu , bMean , label = dirName )
1281- plt .legend ()
1282-
1283- plt .figure ("RMS-log" )
1284- plt .semilogx (zLog * Nu , bRMS , label = dirName )
1280+ plt .semilogx (zLog * Nu , bMean , label = f"bMean ({ dirName } )" )
1281+ plt .xlabel ("$zNu$" )
12851282 plt .legend ()
1283+ plt .tight_layout ()
12861284
1285+ bRMS = (profiles ["bRMS" ] + profiles ["bRMS" ][- 1 ::- 1 ])/ 2
1286+ bRMS = mPz @ bRMS
12871287 uRMS = (profiles ["uRMS" ] + profiles ["uRMS" ][- 1 ::- 1 ])/ 2
12881288 uRMS = mPz @ uRMS
12891289
12901290 plt .figure ("RMS-log" )
1291- plt .semilogx (zLog * Nu , uRMS , label = dirName )
1291+ plt .semilogx (zLog * Nu , bRMS , label = f"bRMS ({ dirName } )" )
1292+ plt .semilogx (zLog * Nu , uRMS , label = f"uRMS({ dirName } )" )
12921293 plt .legend ()
1294+ plt .xlabel ("$zNu$" )
1295+ plt .tight_layout ()
12931296
12941297 if True :
12951298 spectrum = output .getSpectrum (
12961299 which = "all" , zVal = "all" ,
1297- start = start , batchSize = None )
1300+ start = start , stop = 51 , batchSize = None )
12981301
12991302 kappa = output .kappa
13001303 plt .figure ("spectrum" )
1301- for name in ["u" , "uv" , "uh" , "b" , "p" ]:
1304+ for name in ["u" ]:
13021305 vals = spectrum [name ]
13031306 check = checkDNS (vals , kappa )
13041307 a , b , c = check ["coeffs" ]
@@ -1307,7 +1310,7 @@ def fun(coeffs):
13071310 kTail = check ["kTail" ]
13081311 sTail = check ["sTail" ]
13091312
1310- plt .loglog (kappa [1 :], vals [1 :], label = name )
1313+ plt .loglog (kappa [1 :], vals [1 :], label = f" { name } ( { dirName } )" )
13111314
13121315 plt .loglog (kTail , sTail , '.' , c = "black" )
13131316 kTL = np .log (kTail )
0 commit comments