update piston displacement example
This commit is contained in:
29
example/Piston/Piston.py
Normal file
29
example/Piston/Piston.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import numpy
|
||||
|
||||
nx=96
|
||||
ny=24
|
||||
nz=24
|
||||
N=nx*ny*nz
|
||||
|
||||
mesh=(nx,ny,nz)
|
||||
data=numpy.ones(mesh,dtype=numpy.int8)
|
||||
|
||||
#print(data)
|
||||
print("Writing piston")
|
||||
print("Mesh size: "+repr(mesh))
|
||||
|
||||
radius = 8
|
||||
# assign a bubble in the middle
|
||||
for x in range(0,nx):
|
||||
for y in range(0,ny):
|
||||
for z in range(0,nz):
|
||||
Y = y - ny/2
|
||||
Z = z - nz/2
|
||||
if Y*Y+Z*Z > radius*radius:
|
||||
data[x,y,z]=0
|
||||
elif x < 12:
|
||||
data[x,y,z]=1
|
||||
else:
|
||||
data[x,y,z]=2
|
||||
|
||||
data.tofile("Piston.raw")
|
||||
@@ -1,37 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Lines assigning various pressure BC for Color.in
|
||||
echo "0 1 1.01 0.99" > Color.in.pressures
|
||||
echo "0 1 1.0125 0.9875" >> Color.in.pressures
|
||||
echo "0 1 1.015 0.985" >> Color.in.pressures
|
||||
echo "0 1 1.02 0.98" >> Color.in.pressures
|
||||
echo "0 1 1.025 0.975" >> Color.in.pressures
|
||||
echo "0 1 1.03 0.97" >> Color.in.pressures
|
||||
LBPM_DIR=../../tests
|
||||
|
||||
for i in `seq 1 6`; do
|
||||
# Set up cases for each boundary pressure pair
|
||||
dir="Case"$i
|
||||
echo $dir
|
||||
mkdir -p $dir
|
||||
# copy the domain file
|
||||
cp Domain.in $dir
|
||||
|
||||
# set up each case -- parameters are fixed in Color.in, with multiple cases to set the boundary pressure
|
||||
sed -n '1p' Color.in > $dir/Color.in
|
||||
sed -n '2p' Color.in >> $dir/Color.in
|
||||
sed -n '3p' Color.in >> $dir/Color.in
|
||||
sed -n '4p' Color.in >> $dir/Color.in
|
||||
# sed -n '5p' Color.in >> $dir/Color.in
|
||||
# print the pressure values into the input file
|
||||
sed -n "${i}p" Color.in.pressures >> $dir/Color.in
|
||||
sed -n '6p' Color.in >> $dir/Color.in
|
||||
|
||||
done
|
||||
|
||||
# simulations should be run using the following syntax
|
||||
# PRE-PROCESSOR - set the radius to 18 voxel lengths
|
||||
#mpirun -np 10 ~/install-LBPM-WIA/bin/lbpm_captube_pp 18 1
|
||||
# RUN THE SIMULAUTION
|
||||
#mpirun -np 10 ~/install-LBPM-WIA/bin/lbpm_color_simulator
|
||||
|
||||
exit;
|
||||
python Piston.py
|
||||
mpirun -np 1 $LBPM_DIR/lbpm_serial_decomp input.db
|
||||
mpirun -np 4 $LBPM_DIR/lbpm_color_simulator input.db
|
||||
|
||||
@@ -1,34 +1,42 @@
|
||||
Color {
|
||||
tau = 1.0;
|
||||
alpha = 1e-2;
|
||||
tauA = 0.7;
|
||||
tauB = 0.7;
|
||||
rhoA = 1.0;
|
||||
rhoB = 1.0;
|
||||
alpha = 1e-3;
|
||||
beta = 0.95;
|
||||
phi_s = 0.8;
|
||||
wp_saturation = 0.7
|
||||
F = 0, 0, 0
|
||||
Restart = false
|
||||
pBC = 0
|
||||
din = 1.0
|
||||
dout = 1.0
|
||||
timestepMax = 200
|
||||
timestepMax = 3000
|
||||
interval = 1000
|
||||
tol = 1e-5;
|
||||
das = 0.1
|
||||
dbs = 0.9
|
||||
flux = 2.0
|
||||
ComponentLabels = 0
|
||||
ComponentAffinity = -1.0;
|
||||
}
|
||||
|
||||
Domain {
|
||||
nproc = 1, 1, 1 // Number of processors (Npx,Npy,Npz)
|
||||
n = 16, 16, 16 // Size of local domain (Nx,Ny,Nz)
|
||||
Filename = "Piston.raw"
|
||||
nproc = 1, 1, 4 // Number of processors (Npx,Npy,Npz)
|
||||
n = 24, 24, 24 // Size of local domain (Nx,Ny,Nz)
|
||||
N = 24, 24, 96 // size of the input image
|
||||
n_spheres = 1 // Number of spheres
|
||||
L = 1, 1, 1 // Length of domain (x,y,z)
|
||||
BC = 0 // Boundary condition type
|
||||
BC = 4 // Boundary condition type
|
||||
ReadValues = 0, 1, 2
|
||||
WriteValues = 0, 1, 2
|
||||
}
|
||||
|
||||
Analysis {
|
||||
blobid_interval = 1000 // Frequency to perform blob identification
|
||||
analysis_interval = 1000 // Frequency to perform analysis
|
||||
restart_interval = 20000 // Frequency to write restart data
|
||||
vis_interval = 20000 // Frequency to write visualization data
|
||||
restart_interval = 1000 // Frequency to write restart data
|
||||
visualization_interval = 1000 // Frequency to write visualization data
|
||||
restart_file = "Restart" // Filename to use for restart file (will append rank)
|
||||
N_threads = 4 // Number of threads to use
|
||||
load_balance = "independent" // Load balance method to use: "none", "default", "independent"
|
||||
|
||||
Reference in New Issue
Block a user