Error using unsat.getCellPorosity

Asked by Mithushan Soundaranathan

Hi

I am using following code to calculate porosity of compacts (sphere packed in a cylinder):

       unsat=TwoPhaseFlowEngine()
        unsat.initialization()
        por=unsat.getCellPorosity(20)

I am getting the error message:
“WARNING rmin>rmax. Rmin=5.0e-05 ,rmax=1e-10”
“negative volume for an ordinary pore (temp warning, should still be safe”

Best,
Mithu

Here is my code:

from __future__ import print_function
from yade import utils, plot, timing
from yade import pack
import pandas as pd

o = Omega()

o.dt = 1.0e-8

Tab_rad=0.0017
Tab_height=0.0075
Comp_press=3e8

cross_area=math.pi*(Tab_rad**2)
Comp_force=Comp_press*cross_area

#*************************************

# Add material
mat1 = O.materials.append(LudingMat(frictionAngle=fr, density=rho, k1=k1, kp=kp, ks=ks, kc=kc, PhiF=PhiF1, G0 = 0.0))

# Spheres for compression

sp=pack.SpherePack()
sp.makeCloud((-15.0*Diameter,-15.0*Diameter,-40*Diameter),(15.0*Diameter,15.0*Diameter,40.0*Diameter), rMean=Diameter/2.0,rRelFuzz=.18)
#cyl = pack.inCylinder((0,0,0),(0,0,40*Diameter),40*Diameter-0.006)
#sp = pack.filterSpherePack(cyl,sp,True,material=mat1)
sp.toSimulation(material=mat1)

######################################################################
#O.bodies.append(geom.facetBox((0,0,0), (4.0*Diameter,4.0*Diameter,4.0*Diameter), wallMask=63-32, material=mat1))
walls=O.bodies.append(yade.geom.facetCylinder((0,0,0),radius=Tab_rad,height=Tab_height,segmentsNumber=20,wallMask=6,material=mat1))

# Add engines
o.engines = [
  ForceResetter(),
  InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1.05),
                         Bo1_Wall_Aabb(),
                         Bo1_Facet_Aabb()
                         ]),
  InteractionLoop(
    [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=1.05),
     Ig2_Facet_Sphere_ScGeom(),
     Ig2_Wall_Sphere_ScGeom()],
    [Ip2_LudingMat_LudingMat_LudingPhys()],
    [Law2_ScGeom_LudingPhys_Basic()]
  ),
  NewtonIntegrator(damping=0.1, gravity=[0, 0, -9.81]),
  #VTKRecorder(fileName='vtk-',recorders=['all'],iterPeriod=10000),
  PyRunner(command='checkForce()', realPeriod=1, label="fCheck"),
  DeformControl(label="DefControl")
]

def checkForce():
    # at the very start, unbalanced force can be low as there is only few
    # contacts, but it does not mean the packing is stable
    if O.iter < 1000:
        return
    # the rest will be run only if unbalanced is < .1 (stabilized packing)
    timing.reset()
    #if unbalancedForce() > 0.2:
    # return
    # add plate at upper box side

    highSphere = 0.0
    for b in O.bodies:
        if highSphere < b.state.pos[2] and isinstance(b.shape, Sphere):
            highSphere = b.state.pos[2]
        else:
            pass

    O.bodies.append(wall(highSphere+0.5*Diameter, axis=2, sense=-1, material=mat1))
    # without this line, the plate variable would only exist inside this
    # function
    global plate
    plate = O.bodies[-1] # the last particles is the plate
    # Wall objects are "fixed" by default, i.e. not subject to forces
    # prescribing a velocity will therefore make it move at constant velocity
    # (downwards)
    plate.state.vel = (0, 0, -30)
    # start plotting the data now, it was not interesting before
    O.engines = O.engines + [PyRunner(command='addPlotData()', iterPeriod=1000)]
    # next time, do not call this function anymore, but the next one
    # (unloadPlate) instead
    fCheck.command = 'unloadPlate()'

def unloadPlate():
    # if the force on plate exceeds maximum load, start unloading
    # if abs(O.forces.f(plate.id)[2]) > 5e-2:
    if abs(O.forces.f(plate.id)[2]) > Comp_force:
        plate.state.vel *= -1
        # next time, do not call this function anymore, but the next one
        # (stopUnloading) instead
        fCheck.command = 'stopUnloading()'

def stopUnloading():
    if abs(O.forces.f(plate.id)[2]) < Comp_force:
        # O.tags can be used to retrieve unique identifiers of the simulation
        # if running in batch, subsequent simulation would overwrite each other's output files otherwise
        # d (or description) is simulation description (composed of parameter values)
        # while the id is composed of time and process number
        # plot.saveDataTxt(O.tags['d.id'] + '.txt')
        plot.saveDataTxt('data'+ O.tags['id'] +'.txt')
        print(timing.stats())
        O.pause()
        unsat=TwoPhaseFlowEngine()
        unsat.initialization()
        por=unsat.getCellPorosity(10)

Question information

Language:
English Edit question
Status:
Expired
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Robert Caulk (rcaulk) said :
#1

Hello,

>“WARNING rmin>rmax. Rmin=5.0e-05 ,rmax=1e-10”
>“negative volume for an ordinary pore (temp warning, should still be safe”

These are warnings, not errors. Is there reason to believe something is wrong? Are you having issues with the simulation? If so what are the issues and how do you observe them?

Cheers,

Robert

Revision history for this message
Mithushan Soundaranathan (mithushan93) said :
#2

Hi Robert,

I doesn't observe any issue with my simulation, everything works fine. The "WARNING rmin>rmax. Rmin=5.0e-05 ,rmax=1e-10” disperse when remove rRelFuzz. But the “negative volume for an ordinary pore (temp warning, should still be safe” is still therer.
Have experienced similar warning.

Best,
Mithu

Revision history for this message
Mithushan Soundaranathan (mithushan93) said :
#3

Sorry typo error, is not disperse, but disappears.

Revision history for this message
Launchpad Janitor (janitor) said :
#4

This question was expired because it remained in the 'Open' state without activity for the last 15 days.