Commit 4eb0d56e authored by Frédéric Dubois's avatar Frédéric Dubois
Browse files

wip lmgc90 interface

parent 48c8aaf5
......@@ -53,7 +53,7 @@ class FluidProblem :
g -- gravity (scalar)
viscosity -- list of fluid phases viscosities (this should be a vector whom dimension specify if there is one or two fluid)
density -- list of fluid phases densities (this should be a vector whom dimension specify if there is one or two fluid)
coeff_stab -- optional argument used as coefficient for axtra diffusivity added to stabilise the advection of concentration (only for two fluid problem)
coeff_stab -- optional argument used as coefficient for extra diffusivity added to stabilise the advection of concentration (only for two fluid problem)
petsc_solver_type -- optional argument to specify solver option (only when petsc is used)
Raises:
......
......@@ -23,6 +23,7 @@ from pylmgc90 import chipy
import numpy as np
import os
import math
import sys
class ParticleProblem(object):
"""
......@@ -143,9 +144,9 @@ class ParticleProblem(object):
tag = chipy.RBDY3_GetContactorColor(i+1,1).rstrip('_')
self._tag2id.setdefault(tag, []).append(i)
else :
chipy.utilities_logMes('dim must be 2 or 3')
sys.exit()
else :
chipy.utilities_logMes('dim must be 2 or 3')
sys.exit()
self._freq_detect = 1
self._solver_params = { 'type' :'Stored_Delassus_Loops ',
......
......@@ -3,6 +3,7 @@ L = 0.014;
H = 0.076;
P = 0.01675;
y = 0;
lc= 2e-3;
SetFactory("OpenCASCADE");
Box(1) = {-L,-H,-P,2*L,2*H,2*P};
......
......@@ -20,9 +20,9 @@
# see <http://www.gnu.org/licenses/>.
#!/usr/bin/env python
from marblesbag import fluid3 as fluid
from marblesbag import scontact3
from marblesbag import lmgc3Interface
from migflow import fluid
from migflow import scontact
from migflow import lmgc90Interface
import numpy as np
import os
......@@ -31,7 +31,7 @@ import shutil
import random
def genInitialPosition(filename, rM, rm, ly, lxz, rhop) :
p = scontact3.ParticleProblem()
p = scontact.ParticleProblem(3)
p.load_msh_boundaries("mesh.msh", ["Top","Bottom","Z","X"])
for x in np.arange(-lxz+rM, lxz-rM, 2*rM):
for y in np.arange(0.015+rM, 0.015+ly-rM, 2*rM):
......@@ -50,7 +50,7 @@ g = -9.81
rho = 1000
rhop = 2500
nu = 1e-8
V = 0.5 # todo : estimate V base on limit velocity
V = 0.5 # todo : estimate V base on limit velocity
print('V',V)
tEnd = 5.
......@@ -66,22 +66,28 @@ lxz = 0.025
genInitialPosition(outputdir, rM, rm, ly, lxz, rhop)
friction = 0.1
lmgc3Interface.scontactToLmgc90(outputdir,0,friction,assume_box=True)
p = lmgc3Interface.LmgcInterface()
lmgc90Interface.scontactTolmgc90(outputdir,3,0,friction,assume_box=True)
p = lmgc90Interface.ParticleProblem(3)
#numerical parameters
lcmin = 0.001 # mesh size
dt = 1e-4 # time step
alpha = 2.5e-4 # stabilization coefficient
epsilon = alpha*lcmin**2 /nu # stabilization parametre
fluid = fluid.FluidProblem(3,g,[nu*rho],[rho])
fluid.load_msh("mesh.msh")
fluid.set_strong_boundary("Top",0,0.)
fluid.set_strong_boundary("Top",1,0.)
fluid.set_strong_boundary("Top",2,0.)
fluid.set_strong_boundary("X",1,0.)
fluid.set_strong_boundary("X",2,0.)
fluid.set_strong_boundary("X",0,0.)
fluid.set_strong_boundary("Z",1,0.)
fluid.set_strong_boundary("Z",2,0.)
fluid.set_strong_boundary("Z",0,0.)
fluid.set_strong_boundary("Bottom",0,0.)
fluid.set_strong_boundary("Bottom",1,0.)
fluid.set_strong_boundary("Bottom",2,0.)
fluid.set_strong_boundary("PtFix",3,0.)
strong_boundaries = [("Top",0,0.),("Top",1,0.),("Top",2,0.),("PtFix",3,0.),
("X",0,0.),("X",1,0.),("X",2,0.),
("Z",0,0.),("Z",1,0.),("Z",2,0.),
("Bottom",0,0.),("Bottom",1,0.),("Bottom",2,0.)]
fluid = fluid.fluid_problem("mesh.msh",g,nu*rho,rho,epsilon,strong_boundaries)
fluid.set_particles(p.mass(), p.volume(), p.position(), p.velocity())
fluid.export_vtk(outputdir,0,0)
......
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