Skip to content

Commit

Permalink
Applied Bruno's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
OGaboriault committed Dec 11, 2024
1 parent 8796898 commit d1c8b88
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions examples/dem/3d-rotating-drum/post_processing_rotating_drum.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
# SPDX-FileCopyrightText: Copyright (c) 2024 The Lethe Authors
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import argparse
from lethe_pyvista_tools import *
from numpy.ma.core import arctan
from numpy.ma.extras import average

parser = argparse.ArgumentParser(description='Arguments for calculation of the velocity profile in the rotating drum')
parser.add_argument("-f", "--folder", type=str, help="Folder path", required=True)
parser.add_argument("-i", "--input", type=str, help="Name of the input file", required=True)
args, leftovers=parser.parse_known_args()

folder=args.folder
filename=args.input

# Experimental date extracted using Web plot digitizer
df_x_zero_exp = pd.read_csv("./data_exp.csv", header=None,
df_x_zero_exp = pd.read_csv(folder + "/" +filename, header=None,
names=['Column1', 'Column2'])

# Path where the parameter file and the output folder is
path = "."

# Starting vtu id. Here, we are interested in the last 100 vtu
start = 900

# Load lethe data
pvd_name = 'out.pvd'
ignore_data = ['type', 'volumetric contribution', 'torque', 'fem_torque',
'fem_force']
particle = lethe_pyvista_tools(path, "rotating-drum.prm",
particle = lethe_pyvista_tools("./", "rotating-drum.prm",
pvd_name, ignore_data=ignore_data)
time = particle.time_list

Expand Down Expand Up @@ -98,7 +107,3 @@
plt.title(f"Average velocity parallel to the free surface \ndepending on the depth from the center of the cylinder")
plt.show()

for i in range(len(vel_value_x)):
if vel_value_x[i] > 0.:
print(y_graph[i])
break

0 comments on commit d1c8b88

Please sign in to comment.