# Wet Top Scenario Felicien import os import matplotlib.pyplot as plt from vtk_tools import * import van_genuchten as vg # go to the right place path = os.path.dirname(os.path.realpath(__file__)) os.chdir(path) os.chdir("../../../build-cmake/rosi_benchmarking/soil") np_ = 8 # number of processors # run dumux if np_ == 1: os.system("./richards3d benchmarks_3d/swtop.input") else: os.system("mpirun -n " + str(np_) + " ./richards3d benchmarks_3d/swtop.input -Grid.Overlap 0") # Figure s_, p_, z1_ = read3D_vtp("swtop-00001", np_) h1_ = vg.pa2head(p_) plt.plot(h1_, (z1_ - 1.26) * 100, "r+") plt.xlabel('$\psi$ (cm)') plt.ylabel('Depth (cm)') plt.show()
"./rootsystem input/b1.input -RootSystem.Grid.File grids/singlerootH.dgf -Problem.Name benchmark1b" ) p2_ = read1D_vtp_data("benchmark1b-00001.vtp", False) # !!!! Box = False, CCTpfa = True os.system( "./rootsystem input/b1.input -RootSystem.Collar.Transpiration 17.28 -Problem.Name benchmark1c" ) p3_ = read1D_vtp_data("benchmark1c-00001.vtp", False) # !!!! Box = False, CCTpfa = True # plot fig, (ax1, ax2, ax3) = plt.subplots(1, 3) # benchmark 1 z_ = np.linspace(0, -0.5, len(p_)) h_ = vg.pa2head(p_) ax1.plot(h_, z_, "r+") ax1.plot(pr, za_, "b") ax1.set_ylabel("Depth (m)") ax1.set_xlabel("Xylem pressure (cm)") ax1.set_title("Benchmark 1") # benchmark without gravity h_ = vg.pa2head(p2_) ax2.plot(h_, z_, "r+") ax2.plot(pr, za_, "c") ax2.plot(pr2, za_, "b") ax2.set_ylabel("Depth (m)") ax2.set_xlabel("Xylem pressure (cm)") ax2.set_title("Benchmark 1 - neglecting gravitation")
from vtk_tools import * import van_genuchten as vg # go to the right place path = os.path.dirname(os.path.realpath(__file__)) os.chdir(path) os.chdir("../../../build-cmake/rosi_benchmarking/soil") # run dumux os.system("./richards1d benchmarks_1d/b1a.input") os.system("./richards1d benchmarks_1d/b1b.input") os.system("./richards1d benchmarks_1d/b1c.input") # Figure 2a s_, p_, z1_ = read1D_vtp_data("benchmark1d_1a-00001.vtp", False) h1_ = vg.pa2head(p_) ax1.plot(h1_, z1_ * 100, "r+") # Figure 2b s_, p_, z2_ = read1D_vtp_data("benchmark1d_1b-00001.vtp", False) h2_ = vg.pa2head(p_) ax2.plot(h2_, z2_ * 100, "r+") # Figure 2c s_, p_, z3_ = read1D_vtp_data("benchmark1d_1c-00001.vtp", False) h3_ = vg.pa2head(p_) ax3.plot(h3_, z3_ * 100, "r+") np.savetxt("dumux1d_b1", np.vstack((z1_, h1_, z2_, h2_, z3_, h3_)), delimiter = ",") plt.show()
os.system("./richards3d benchmarks_3d/b3c.input") else: pass os.system("mpirun -n " + str(np_) + " ./richards3d benchmarks_3d/b3a.input -Grid.Overlap 0") os.system("mpirun -n " + str(np_) + " ./richards3d benchmarks_3d/b3b.input -Grid.Overlap 0") os.system("mpirun -n " + str(np_) + " ./richards3d benchmarks_3d/b3c.input -Grid.Overlap 0") ex = [] # list for data for export # result (Figure 4a) for i in range(0, 3): s_, p_, z_ = read3D_vtp("benchmark3d_3a-0000" + str(i + 1), np_) h_ = vg.pa2head(p_) theta_ = vg.water_content(h_, sand) ax1.plot(theta_, (z_ - 2) * 100, "r+") ex.append(z_ - 2) ex.append(theta_) # result (Figure 4b) for i in range(0, 3): s_, p_, z_ = read3D_vtp("benchmark3d_3b-0000" + str(i + 1), np_) h_ = vg.pa2head(p_) theta_ = vg.water_content(h_, loam) ax2.plot(theta_, (z_ - 2) * 100, "r+") ex.append(z_ - 2) ex.append(theta_) # result (Figure 4c)