DFN and Thermal engine
Hello,
Can we combine between thermal engine and DFNengine, example : If i want to include a fracture in a sample and run temperature inside the whole sample excluding the fracture i inserted (in the fracture i want to run the single phase flow which is already implemented " trickpermeability " ) , Is that possible ?
cheers
Question information
 Language:
 English Edit question
 Status:
 Answered
 For:
 Yade Edit question
 Assignee:
 No assignee Edit question
 Last query:
 Last reply:
Revision history for this message

#1 
Hello,
>> Can we combine between thermal engine and DFNengine,
Yes.
>> If i want to include a fracture in a sample and run temperature inside the whole sample excluding the fracture i inserted
What does "run temperature" mean? Why don't you want heat advection in the fracture?
Cheers,
Robert
Revision history for this message

#2 
Thank you for responding and Sorry for the unscientific description " run temperature ", I should reread your paper to remember what have you done .
However currently I am developing Mass transport engine and I am following the steps you followed in the thermal engine. I exactly need a diffusion single phase flow in the matrix which i have already done and validated it and a advection diffusion multiphase flow in the cleat system. As a first step I am trying to combine the Mass transport engine with the DFN engine.
You already answered my question , and concerning your second question I need to run as a first step single phase advection flow in fractures with single phase diffusive flow in the matrix then develop it to advection diffusion two phase flow in the fractures.
Can I find a python script that combines the DFN and the thermal engine ?
Cheers,
Revision history for this message

#3 
>>Can I find a python script that combines the DFN and the thermal engine ?
I do not know of such a script. But as for code it is simply adding the two engines to the engine list. Of course you need to know how to handle DFNFlowEngine and ThermalEngine parameters and geometrical considerations  but it seems you are not using ThermalEngine so that is irrelevant.
Revision history for this message

#4 
Hello,
I received your email, but it is important that all discussions remain on launchpad for other users to benefit. You are asking me if I am "sure that ThermalEngine works with DFNFlowEngine."
DFNFlowEngine is not compiled by default  so there is some implication here that the user knows how to compile and edit C++ to get it to work. I guess this is already clear since I helped you with the compilation of DFNFlowEngine a couple weeks ago. This means DFNFlow is untested and unmaintained. Yes, tragic. As the rest of Yade continues to evolve and remain maintained, DFNFlowEngine becomes more and more lost behind and will continue to require more and more manual intervention to keep running.
That said, the architecture of ThermalEngine fits together with DFNFlowEngine since DFNFlowEngine is simply another FlowEngine. Of course, there may be some bugs that you need to iron out if you want to go down the path, but none of them are structural issues.
Based on your email you are running into some bug, but you did not provide any indication of where the error arises (line numbers, files), what the error is in the terminal (copy and paste to here), what you have tried, what is your MWE. etc etc.
Thanks for providing the necessary info for me to help you debug your problem,
Robert
Revision history for this message

#5 
Thank you for replying. Here is the error = core dumped.
yade flowScenario.py
Welcome to Yade 202202
Using python version: 3.6.9 (default, Dec 8 2021, 21:08:43)
[GCC 8.4.0]
TCP python prompt on localhost:9000, auth cookie `cssdyk'
XMLRPC info provider on http://
Running script flowScenario.py
num bodies 216
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
infinite K1!
CHOLMOD Time to build linear equations 52
CHOLMOD sparse: Achol: 1039by1039, nz 3069, upper. OK
CHOLMOD Time to allocate matrix 92
Reusing reordering? 0. CHOLMOD Time to Analyze 2454
CHOLMOD warning: matrix not positive definite. file: ../Supernodal/
CHOLMOD Time to factorize 4672
Segmentation fault (core dumped)
Revision history for this message

#6 
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=1e3
timeStr = time.strftime(
num_spheres=1000# number of spheres
young=1e9
rad=0.003
mn,mx=Vector3(
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.
# macro diffusivity
O.materials.
O.materials.
walls=aabbWalls
wallIds=
sp = O.bodies.
print('num bodies ', len(O.bodies))
triax=TriaxialS
maxMultiplier=
finalMaxMultip
thickness = 0,
stressMask = 7,
internalCompac
)
ThermalEngine = ThermalEngine(
newton=
intRadius = 1
flow=DFNFlowEngine(
## choose solver to use (0: Gauss Seidel, 1: Taucs, 2: Pardiso, 3: CHOLMOD)
## DFN related
# controls the size scaling between YADE fracture and real one
)
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
#FlowEngine(
flow,
ThermalEngine,
GlobalStiffnes
triax,
newton
]
for b in O.bodies:
if isinstance(b.shape, Sphere):
b.dynamic=False # mechanically static
flow.defToleran
flow.permeabili
flow.viscosity= 0.001
flow.bndCondIsP
flow.bndCondVal
flow.thermalEng
flow.debug=False
flow.fluidRho = 997
flow.fluidCp = 4181.7
flow.getCHOLMOD
flow.bndCondIsT
flow.thermalEng
flow.thermalBnd
flow.tZero=t0
flow.pZero=0
flow.maxKdivKmean=1
flow.minKdivmea
thermal.dead=0
thermal.debug=False
thermal.
thermal.
thermal.
thermal.
thermal.
thermal.
thermal.
thermal.
thermal.
thermal.fluidK = 0.6069 #0.650
thermal.
thermal.particleT0 = t0
thermal.
thermal.particleK = thermalCond
thermal.particleCp = heatCap
thermal.
#thermal.
timing.reset()
O.dt=0.1e7
O.dynDt=False
O.run(1,1)
Here is the script i am running.
Revision history for this message

#7 
Hello,
If I were you, I would start debugging the c++ by identifying what part of DFNFlowEngine is infact the issue. For example, you would start with removing the "trickPermeabil
Robert
Revision history for this message

#8 
Just wondering about the dependencies since I am not entirely clear with how everything is related in the code. How is DFNFlowEngine "linked" to FLowEngine exactly?
For instance, should we add
ifdef DFNFLOW
and/or
include "FlowEngine_
somewhere in the thermalEngine files to make it work?
I thought that DFNFlowEnginee inherited from FlowEngine so that there is no need to write such "dependencies" but is that the case or not?
Sorry if this is a silly question but I must admit this is out of my programming comfort zone. Is there some sort of a "documentation" about how all these dependencies work in YADE PFV related extensions?
Luc
Revision history for this message

#9 
I agree that these Flow dependencies are unclear. For example: https:/
I hope that the authors will clarify things here :)
Revision history for this message

#10 
The earlier comment actually :) https:/
Revision history for this message

#11 
Hey Luc,
>>How is DFNFlowEngine "linked" to FLowEngine exactly?
From an architectural perspective, DFNFlow interacts with Yade the same way as the PeriodicFlow, TwoPhaseFlow, UnsaturatedFlow, PartialSatClay engines. FlowEngine is a "template" which users can essentially build their own stuff on top of. This means you get all the underlying functionality of the original FlowEngine, and the user only needs to add their tweaks. For DFNFlow, that tweak is the "trickPermeabil
So in other words, when someone runs DFNFlowEngine in their python code, the originally written FlowEngine:
ThermalEngine is *not* a template of FlowEngine. This is why all the example scripts include both the FlowEngine and the ThermalEngine. But ThermalEngine does interact quite a lot with FlowEngine (for heat advection). That link is created here [1]. Judging by that line, you may need to at least type "DFNFlowEngine" to make sure it is grabbing the correct object. Here, I try to generalize it so that any named derived FlowEngine will link [2]. Please test it at let me know if it works for your purposes. Thank you.
[1]https:/
[2]https:/
Revision history for this message

#12 
Hey Robert,
Unfortunately this generalization didn't work, still the thermal engine is interacting with Flow engine but not interacting with DFNEngine.
A few notification that may help :
1  What did I notice that if we give a temperature value for pore or solve the temperature field (if possible) from the flowengine or flowboundingsphere, we have no problem but whenever we go to the thermal.cpp and loop over the cells the core is dumped as if there is no mesh between the particles to be read or to loop over (not interacted with DFNEngine).
2  Concerning the solid phase, there is no problem to combine the thermal engine and DFNEngine if we want to solve the solidsolid conduction only, the problem starts when ever we want to define a mesh to loop over the cells. Exactly from this point " Tesselation& Tes = flow>solver
Ahmad
Can you help with this problem?
Provide an answer of your own, or ask ahmad mostafa for more information if necessary.