Commit c6f2bcc2 authored by Matthieu Constant's avatar Matthieu Constant
Browse files

2D drops wk bnd

parent ee327e0f
......@@ -116,16 +116,12 @@ tEnd1 = 0.2
#
# FLUID PROBLEM
#
fluid = fluid.FluidProblem(2,g,[nu*rho],[rho])
fluid = fluid.FluidProblem(2,g,[nu*rho],[rho],petsc_solver_type="-pc_type ilu -ksp_max_it 30")
# Set the mesh geometry for the fluid computation
fluid.load_msh("mesh.msh")
fluid.set_strong_boundary("Top",2,0)
fluid.set_strong_boundary("Top",1,0)
fluid.set_strong_boundary("Bottom",1,0)
fluid.set_strong_boundary("Lateral",0,0)
fluid.set_weak_boundary("Top","Wall")
fluid.set_weak_boundary("Bottom","Wall")
fluid.set_weak_boundary("Lateral","Wall")
fluid.set_wall_boundary("Top", pressure=0)
fluid.set_wall_boundary("Bottom")
fluid.set_wall_boundary("Lateral")
# Set location of the particles in the mesh and compute the porosity in each computation cell
fluid.set_particles(p.mass(), p.volume(), p.position(), p.velocity())
......
......@@ -116,16 +116,12 @@ tEnd1 = 0.2
#
# FLUID PROBLEM
#
fluid = fluid.FluidProblem(2,g,[nu*rho],[rho])
fluid = fluid.FluidProblem(2,g,[nu*rho],[rho],petsc_solver_type="-pc_type ilu -ksp_max_it 30")
# Set the mesh geometry for the fluid computation
fluid.load_msh("mesh.msh")
fluid.set_strong_boundary("Top",2,0)
fluid.set_strong_boundary("Top",1,0)
fluid.set_strong_boundary("Bottom",1,0)
fluid.set_strong_boundary("Lateral",0,0)
fluid.set_weak_boundary("Top","Wall")
fluid.set_weak_boundary("Bottom","Wall")
fluid.set_weak_boundary("Lateral","Wall")
fluid.set_wall_boundary("Top", pressure=0)
fluid.set_wall_boundary("Bottom")
fluid.set_wall_boundary("Lateral")
# Set location of the particles in the mesh and compute the porosity in each computation cell
fluid.set_particles(p.mass(), p.volume(), p.position(), p.velocity())
......
......@@ -111,13 +111,10 @@ tEnd1 = 0.2
#
# FLUID PROBLEM
#
fluid = fluid.FluidProblem(2,g,[nu*rho],[rho])
fluid = fluid.FluidProblem(2,g,[nu*rho],[rho],petsc_solver_type="-pc_type ilu -ksp_max_it 30")
# Set the mesh geometry for the fluid computation
fluid.load_msh("mesh.msh")
fluid.set_strong_boundary("Top",1,0)
fluid.set_strong_boundary("Bottom",1,0)
fluid.set_strong_boundary("Lateral",0,0)
fluid.set_wall_boundary("Top",pressure=0)
fluid.set_wall_boundary("Top", pressure=0)
fluid.set_wall_boundary("Bottom")
fluid.set_wall_boundary("Lateral")
# Set location of the particles in the mesh and compute the porosity in each computation cell
......
......@@ -22,7 +22,8 @@
#!/usr/bin/env python
# TESTCASE DESCRIPTION
# This tescase presents the fall of a cloud made of particles in a viscous fluid (Stokes cloud).
# Example of reload
# This tescase presents the fall of a cloud made of particles in a viscous fluid (Stokes cloud) reloaded from drop.py test case.
# Physical parameters for the drops are the ones presented by Metzger et al. (2007)
# "Falling clouds of particles in viscous fluids"
......@@ -33,42 +34,6 @@ import numpy as np
import os
import time
import shutil
import random
def genInitialPosition(filename, r, rout, rhop, compacity) :
"""Set all the particles centre positions and create the particles objects to add in the computing structure
Keyword arguments:
filename -- name of the output file
r -- max radius of the particles
rout -- outer radius of the cloud
rhop -- particles density
compacity -- initial compacity in the cloud
"""
# Particles structure builder
p = scontact.ParticleProblem(2)
# Load mesh.msh file specifying physical boundaries names
p.load_msh_boundaries("mesh.msh", ["Top", "Bottom","Lateral"])
# Space between the particles to obtain the expected compacity
N = compacity*4*rout**2/(np.pi*r**2)
e = 2*rout/(N)**(1./2.)
# Definition of the points where the particles are located
x = np.arange(rout, -rout, -e)
x, y = np.meshgrid(x, x)
R2 = x**2 + y**2
keep = R2 < (rout - r)**2
x = x[keep]
y = y[keep]
for i in range(x.shape[0]) :
# Add particles object with properties defined above
p.add_particle((x[i]+2*random.uniform(-e/2+r,e/2-r), y[i]+2*random.uniform(-e/2+r,e/2-r)), r, r**2 * np.pi * rhop)
# Vertical shift of the particles to the top of the box
p.position()[:, 1] += 0.52
p.write_vtk(filename,0,0)
# Define output directory
outputdir = "output1"
......@@ -109,15 +74,12 @@ tEnd1 = 0.2
#
# FLUID PROBLEM
#
fluid = fluid.FluidProblem(2,g,[nu*rho],[rho])
fluid = fluid.FluidProblem(2,g,[nu*rho],[rho],petsc_solver_type="-pc_type ilu -ksp_max_it 30")
# Set the mesh geometry for the fluid computation
fluid.set_strong_boundary("Top",2,0)
fluid.set_strong_boundary("Top",1,0)
fluid.set_strong_boundary("Bottom",1,0)
fluid.set_strong_boundary("Lateral",0,0)
fluid.set_weak_boundary("Top","Wall")
fluid.set_weak_boundary("Bottom","Wall")
fluid.set_weak_boundary("Lateral","Wall")
fluid.load_msh("mesh.msh")
fluid.set_wall_boundary("Top", pressure=0)
fluid.set_wall_boundary("Bottom")
fluid.set_wall_boundary("Lateral")
fluid.import_vtk(outputrel+"/fluid_%05d.vtu"%iReload)
fluid.set_particles(p.mass(), p.volume(), p.position(), p.velocity(),reload=1)
......
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