← Back to team overview

yade-users team mailing list archive

Re: [Question #701012]: DFN and Thermal engine

 

Question #701012 on Yade changed:
https://answers.launchpad.net/yade/+question/701012

ahmad mostafa posted a new comment:
from yade import pack, ymport
from yade import timing
import numpy as np
import shutil
pFactor=1 # to scale the permeability of the rock matrix (test on sample without fracture -> permeametre.py)

#### fracture aperture
jointAperture=1e-3

timeStr = time.strftime('%m-%d-%Y')
num_spheres=1000# number of spheres
young=1e9
rad=0.003

mn,mx=Vector3(0,0,0),Vector3(0.05,0.05,0.05) # corners of the initial
packing

thermalCond = 2. #W/(mK)
heatCap = 710. #J(kg K) 
t0 = 0 #K

# micro properties
r = rad
k = 2.0   # 2*k*r 
Cp = 710.
rho = 2600.
D = 2.*r
m = 4./3.*np.pi*r**2/rho
# macro diffusivity


O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(3),density=2600,label='spheres'))
O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0,label='walls'))
walls=aabbWalls([mn,mx],thickness=0,material='walls')
wallIds=O.bodies.append(walls)

sp = O.bodies.append(ymport.textExt('5cmEdge_1mm.spheres',
'x_y_z_r',color=(0.1,0.1,0.9), material='spheres'))

print('num bodies ', len(O.bodies))

triax=TriaxialStressController(
	maxMultiplier=1.+2e4/young, 
	finalMaxMultiplier=1.+2e3/young, 
	thickness = 0,
	stressMask = 7,
	internalCompaction=True,
)

ThermalEngine = ThermalEngine(dead=1,label='thermal');

newton=NewtonIntegrator(damping=0.2)
intRadius = 1
flow=DFNFlowEngine(
        isActivated=1
        ## choose solver to use (0: Gauss Seidel, 1: Taucs, 2: Pardiso, 3: CHOLMOD)
        ,useSolver=3 # 3 should be used by default
        ,fluidBulkModulus=2.2e9
        
        ## DFN related
        ,clampKValues=False
        ,updatePositions=False
        ,meshUpdateInterval=100
        # controls the size scaling between YADE fracture and real one
        ,jointsResidualAperture=jointAperture
        #,apertureFactor=hFactor
)
O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=intRadius),Bo1_Box_Aabb()]),
	InteractionLoop(
		[Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=intRadius),Ig2_Box_Sphere_ScGeom()],
		[Ip2_FrictMat_FrictMat_FrictPhys()],
		[Law2_ScGeom_FrictPhys_CundallStrack()],label="iloop"
	),
	#FlowEngine(dead=1,label="flow",multithread=False),
	flow,
	ThermalEngine,	
	GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
	triax,
	newton
]

for b in O.bodies:
	if isinstance(b.shape, Sphere): 
		b.dynamic=False # mechanically static

flow.defTolerance=-1 #0.3
flow.permeabilityFactor= 1
flow.viscosity= 0.001
flow.bndCondIsPressure=[1,1,0,0,0,0]
flow.bndCondValue=[10,0,0,0,0,0]
flow.thermalEngine=True
flow.debug=False
flow.fluidRho = 997
flow.fluidCp = 4181.7
flow.getCHOLMODPerfTimings=True
flow.bndCondIsTemperature=[1,1,1,1,1,1]
flow.thermalEngine=True
flow.thermalBndCondValue=[343.15,343.15,343.15,343.15,343.15,343.15]
flow.tZero=t0
flow.pZero=0
flow.maxKdivKmean=1
flow.minKdivmean=0.0001;


thermal.dead=0
thermal.debug=False
thermal.fluidConduction=True
thermal.ignoreFictiousConduction=True
thermal.conduction=True
thermal.thermoMech=False
thermal.solidThermoMech = False
thermal.fluidThermoMech = False
thermal.advection=True
thermal.bndCondIsTemperature=[0,0,0,0,0,0]
thermal.thermalBndCondValue=[0,0,0,0,0,0]
thermal.fluidK = 0.6069 #0.650
thermal.fluidConductionAreaFactor=1.
thermal.particleT0 = t0
thermal.particleDensity=2600.
thermal.particleK = thermalCond
thermal.particleCp = heatCap
thermal.useKernMethod=True
#thermal.useHertzMethod=False
timing.reset()

O.dt=0.1e-7
O.dynDt=False
O.run(1,1)


Here is the script i am running.

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.