download
raw
1.29 kB
from fluidsim import load_sim_for_plot
import matplotlib.pyplot as plt
# Charger la simulation
sim = load_sim_for_plot("/root/Sim_data/NS2D_48x48_S8x8_2026-01-08_19-25-12")
print("Simulation chargée. Paramètres:")
print(f"Lx = {sim.oper.Lx}, Ly = {sim.oper.Ly}")
# Calculer la position pour la coupe
x_slice = sim.oper.Lx / 4
print(f"Coupe transversale à x = {x_slice}")
# Obtenir les données de la coupe
rot_slice = sim.output.phys_fields.get_field_to_plot(key='rot', equation=f'x={x_slice}')
ux_slice = sim.output.phys_fields.get_field_to_plot(key='ux', equation=f'x={x_slice}')
uy_slice = sim.output.phys_fields.get_field_to_plot(key='uy', equation=f'x={x_slice}')
# Tracer
fig, axes = plt.subplots(1, 3, figsize=(15, 5))
axes[0].plot(sim.oper.y, rot_slice)
axes[0].set_title(f'Vorticité à x = {x_slice}')
axes[0].set_xlabel('y')
axes[0].set_ylabel('rot')
axes[1].plot(sim.oper.y, ux_slice)
axes[1].set_title(f'Vitesse Ux à x = {x_slice}')
axes[1].set_xlabel('y')
axes[1].set_ylabel('ux')
axes[2].plot(sim.oper.y, uy_slice)
axes[2].set_title(f'Vitesse Uy à x = {x_slice}')
axes[2].set_xlabel('y')
axes[2].set_ylabel('uy')
plt.tight_layout()
plt.savefig('cross_section_plot.png', dpi=150, bbox_inches='tight')
print("Image sauvegardée: cross_section_plot.png")
plt.show()

Xet Storage Details

Size:
1.29 kB
·
Xet hash:
7a37471b5708c9f2a630c5204dec4eda9f577c69bbf62d1b01cb924e9c4f026b

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.