Commit e66b7127 authored by Nathan Coppin's avatar Nathan Coppin
Browse files

well

parent 87352c56
Pipeline #6497 passed with stage
in 2 minutes and 7 seconds
......@@ -33,7 +33,7 @@ import shutil
import random
# Physical parameters
vit = -0.01 #stream velocity
vit = -0.02 #stream velocity
rhop = 2500 #particles density
rho = 1000 #fluid density
nu = 1e-6 #fluid kinematic viscosity
......@@ -45,12 +45,15 @@ ii = 0 #iteration number
outf = 50 #iterations between data frames
# Define output directory
outputdir = "again6"
outputdir = "again8"
if not os.path.isdir(outputdir) :
os.makedirs(outputdir)
filename = outputdir + "/Drag.csv"
if os.path.exists(filename):
os.remove(filename)
print("Remove old results? (y/n)\n")
decision = input()
if decision.lower() == 'y':
os.remove(filename)
#
# PARTICLE PROBLEM
......@@ -114,7 +117,7 @@ while t < tEnd :
p2.remove_particles_flag( (p2.position()[:,1] + p2.r()[:,0] >-0.1))
time_integration.particle_changed(fluid,p2)
time_integration.iterate(fluid,p2,dt,min_nsub=5,contact_tol=8e-9,momentum=momentum)
time_integration.iterate(fluid,p2,dt,min_nsub=5,contact_tol=5e-9,momentum=momentum)
momentum += fluid.boundary_force()
p2.forced_flag()[p2.position()[:,1] + 2*p2.r()[:,0] < 0.2] = 0
with open(filename,"a") as file1:
......
......@@ -6,7 +6,7 @@ import random
import csv
import matplotlib.pyplot as plt
filename = "again4/Drag.csv"
filename = "again7/Drag.csv"
with open(filename) as file1:
reader = csv.reader(file1,delimiter = ";",quoting=csv.QUOTE_NONNUMERIC)
data = [r for r in reader]
......@@ -34,8 +34,8 @@ for i in range(len(react)):
#prod3[i] = np.sum(react3[i-ranges:i+ranges])/(2*ranges)
ProdToMean = prod#[5500:15000]
print(np.mean(ProdToMean[15000:50000]))
mean = np.ones_like(ProdToMean)*np.mean(ProdToMean[15000:50000])
print(np.mean(ProdToMean[30000:50000]))
mean = np.ones_like(ProdToMean)*np.mean(ProdToMean[30000:50000])
TimeVel = data[:, 3]
plt.plot(data[:,2],-prod,color='black')
#plt.plot(data[:,6],-prod2, color = 'purple')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment