Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tutorial corrections #185

Merged
merged 5 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/docker-stacks
Submodule docker-stacks updated 215 files
12 changes: 7 additions & 5 deletions tutorials/Py/plot_depth2DPipelineScour.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from pylab import mlab
import matplotlib.pyplot as plt
import fluidfoam
from scipy.interpolate import griddata


# Function reading the mesh dimensions
Expand All @@ -12,7 +13,7 @@ def readxy(case):

# Function returning the bed profile
def max_depth(case, t0, tfinal, dt, xi, yi):
ybed = np.zeros(len(xi))
ybed = np.zeros(ngridx)
arr_size = int((tfinal - t0) / dt + 0.01)
yscour = np.zeros(arr_size)
time = np.zeros(arr_size)
Expand All @@ -26,10 +27,10 @@ def max_depth(case, t0, tfinal, dt, xi, yi):
timename = str(int(t)) + "/"
else:
timename = str(t) + "/"
a = fluidfoam.readscalar(case, timename, "alpha_a")
ai = mlab.griddata(x, y, a, xi, yi, interp="linear")
a = fluidfoam.readscalar(case, timename, "alpha.a")
ai = griddata((x, y), a, (xi, yi), method="linear")
for j in range(ngridx):
ybed[j] = yi[np.max((np.where(ai[:, j] > 0.5)))]
ybed[j] = np.max(yi[(np.where(ai[:, j] > 0.5))])
yscour[i] = np.min(ybed[:])
time[i] = t
return yscour, time
Expand All @@ -51,13 +52,14 @@ def max_depth(case, t0, tfinal, dt, xi, yi):
# Interpolation grid
xi = np.linspace(xinterpmin, xinterpmax, ngridx)
yi = np.linspace(yinterpmin, yinterpmax, ngridy)
xinterp, yinterp = np.meshgrid(xi, yi)

# Maximum depth calculation
x, y = readxy(case)
t0 = 0
tfinal = 30
dt = 0.5
max_depth, time = max_depth(case, t0, tfinal, dt, xi, yi)
max_depth, time = max_depth(case, t0, tfinal, dt, xinterp, yinterp)

# Experimental data collection
expe = "DATA/Mao_depth_expe.txt"
Expand Down
2 changes: 1 addition & 1 deletion tutorials/Py/plot_profiles2DPipelineScour.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def depth(sol, t, x, y, xi, yi):
timename = str(int(t)) + "/"
else:
timename = str(t) + "/"
alpha = fluidfoam.readscalar(sol, timename, "alpha_a")
alpha = fluidfoam.readscalar(sol, timename, "alpha.a")
alphai = griddata((x, y), alpha, (xi, yi))
for j in range(Nx - 1):
tab = np.where(alphai[:, j + 1] > 0.5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

kineticTheory on;
kineticTheory off;

limitProduction off;

Expand Down
Loading