Re: [Yade-users] [Question #698948]: Stability of advection modeling by ThermalEngine

2021-10-21 Thread Zoheir Khademian
Question #698948 on Yade changed:
https://answers.launchpad.net/yade/+question/698948

Zoheir Khademian confirmed that the question is solved:
Thanks Robert Caulk, that solved my question.

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #698948]: Stability of advection modeling by ThermalEngine

2021-10-21 Thread Zoheir Khademian
Question #698948 on Yade changed:
https://answers.launchpad.net/yade/+question/698948

Status: Answered => Solved

Zoheir Khademian confirmed that the question is solved:
I am glad we were able to fix this after all.

Thanks

Zoheir

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #698948]: Stability of advection modeling by ThermalEngine

2021-10-21 Thread Robert Caulk
Question #698948 on Yade changed:
https://answers.launchpad.net/yade/+question/698948

Robert Caulk proposed the following answer:
>>I think the problem is delT is being used as a variable here as well
[1], so during fluid-fluid conduction calculations, delT becomes
positive and it activates applyTempDeltaToSolids automatically

Yes, that is a big bug. Great spot, Zoheir. I am pushing the fix
upstream immediately, here [1] you can follow the progress.

This is quite interesting, as it would seem that in the code's current
state, it would only work when delT is always a negative value, which
depends entirely on how the facet list is created with respect to the
boundary conditions. Anyways, this is a necessary fix - thank you.

Cheers,

Robert

[1]https://gitlab.com/yade-dev/trunk/-/merge_requests/786

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #698948]: Stability of advection modeling by ThermalEngine

2021-10-20 Thread Zoheir Khademian
Question #698948 on Yade changed:
https://answers.launchpad.net/yade/+question/698948

Zoheir Khademian posted a new comment:
BTW, my Ubuntu version is: 20.04.3

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #698948]: Stability of advection modeling by ThermalEngine

2021-10-20 Thread Zoheir Khademian
Question #698948 on Yade changed:
https://answers.launchpad.net/yade/+question/698948

Zoheir Khademian posted a new comment:
Hi  Robert,
>>This is quite odd: applyTempDeltaToSolids is deactivated by default: the
user needs to manually set thermal.delT>0 for that function to activate

I think the problem is delT is being used as a variable here as well
[1], so during fluid-fluid conduction calculations, delT becomes
positive and it activates applyTempDeltaToSolids automatically. I
deleted detT variable here [1] and directly used "cell->info().temp() -
neighborCell->info().temp()" for  conductionEnergy calculation here[2].
Then recompiled and the results are stable.

Let me know if this does not makes sense to you.

[1] https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/pfv/Thermal.cpp#L530
[2] https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/pfv/Thermal.cpp#L545


In any case, here is the list of particles (all the same size) and the MWE to 
run the model. 

Thanks - Zoheir

#format x_y_z_r
0.0177741   0.0293044   0.0178294   0.0015
0.0322250.0197924   0.0178472   0.0015
0.0322266   0.0291739   0.0178539   0.0015
0.0279236   0.0322490.0261029   0.0015
0.0322118   0.0302264   0.0320853   0.0015
0.0272061   0.0316643   0.0320534   0.0015
0.0293610.0178245   0.0290514   0.0015
0.0223492   0.0237293   0.0212975   0.0015
0.0322662   0.0177355   0.0290630.0015
0.0249392   0.0297701   0.0178535   0.0015
0.0278041   0.0253036   0.0320824   0.0015
0.0209031   0.0239399   0.0259082   0.0015
0.0299960.0247971   0.0227321   0.0015
0.0231086   0.0224061   0.0178694   0.0015
0.0237889   0.0267710.0280437   0.0015
0.0271796   0.0296372   0.0298686   0.0015
0.0293275   0.0207069   0.0294883   0.0015
0.0297280.0307252   0.0238577   0.0015
0.0294550.0177438   0.03204 0.0015
0.0220291   0.0251347   0.0320876   0.0015
0.0228457   0.0177657   0.0205171   0.0015
0.0247976   0.0201580.0187476   0.0015
0.0221528   0.0177930.0297048   0.0015
0.0177809   0.0178246   0.0320527   0.0015
0.0178286   0.0204492   0.0192357   0.0015
0.0191019   0.0272907   0.0227524   0.0015
0.0231820.0266745   0.0241058   0.0015
0.0228497   0.0296931   0.0320761   0.0015
0.0203349   0.0184782   0.0277075   0.0015
0.0178115   0.0232242   0.0181458   0.0015
0.0236951   0.0187262   0.0273578   0.0015
0.0178150.0178142   0.0290756   0.0015
0.0268862   0.0177484   0.0275311   0.0015
0.0293104   0.0293306   0.0320274   0.0015
0.0178224   0.0228895   0.0229322   0.0015
0.0229362   0.0182461   0.0233847   0.0015
0.0234661   0.0204362   0.0296891   0.0015
0.0308867   0.0228868   0.0282905   0.0015
0.0322099   0.0250677   0.0296246   0.0015
0.0322810.0178211   0.0320448   0.0015
0.0322146   0.0204259   0.0245334   0.0015
0.0322253   0.0322509   0.0239898   0.0015
0.0279165   0.0228391   0.0279433   0.0015
0.0234598   0.0322574   0.0219894   0.0015
0.0202221   0.0215691   0.0178190.0015
0.0292976   0.0252520.0289125   0.0015
0.0178179   0.0322929   0.0207288   0.0015
0.0219679   0.0204761   0.0198587   0.0015
0.0219003   0.0322297   0.0244164   0.0015
0.0188566   0.0202206   0.0221634   0.0015
0.0276402   0.0177882   0.0232129   0.0015
0.0178161   0.0322694   0.0269258   0.0015
0.0295711   0.0280749   0.0290676   0.0015
0.0265758   0.0178165   0.0320975   0.0015
0.0321235   0.0295753   0.0253156   0.0015
0.0203762   0.0177426   0.0220801   0.0015
0.0292814   0.0231458   0.0251311   0.0015
0.0299286   0.0268797   0.0186235   0.0015
0.0288255   0.0202145   0.0243078   0.0015
0.0178049   0.0276979   0.0202425   0.0015
0.0322722   0.0256006   0.0178161   0.0015
0.0223008   0.0202683   0.0253642   0.0015
0.0255165   0.0266773   0.0206327   0.0015
0.0199502   0.0216179   0.0289218   0.0015
0.0301260.0177624   0.0178698   0.0015
0.0254739   0.0197561   0.0231361   0.0015
0.0322638   0.0228734   0.0228553   0.0015
0.0265408   0.0222830.0178242   0.0015
0.0254871   0.0259749   0.0258332   0.0015
0.0322915   0.0227056   0.0178061   0.0015
0.0319731   0.0202977   0.0214805   0.0015
0.0235946   0.0323112   0.0178428   0.0015
0.0250886   0.0203689   

Re: [Yade-users] [Question #698948]: Stability of advection modeling by ThermalEngine

2021-10-20 Thread Robert Caulk
Question #698948 on Yade changed:
https://answers.launchpad.net/yade/+question/698948

Robert Caulk requested more information:
Also, please indicate your version of Ubuntu.

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #698948]: Stability of advection modeling by ThermalEngine

2021-10-20 Thread Robert Caulk
Question #698948 on Yade changed:
https://answers.launchpad.net/yade/+question/698948

Robert Caulk proposed the following answer:
Hey Zoheir,

This is quite odd: applyTempDeltaToSolids is deactivated by default: the
user needs to manually set thermal.delT>0 for that function to activate
[1]. As you see in [1], thermal.delT is set to 0 if user does nothing. So
compiling without the line you indicated will change nothing in the output
unless your user script manually activated thermal.delT>0. I don’t see you
setting that value in any of the MWEs that you provided here. So this
cannot be the issue (unless you are using a different script to the one
provided here where you use delT).

Can you please find the unstable packing, then export those sphere radii
and location to text file, the copy paste that file to this thread so I can
replicate exactly your problem. Also please copy paste the identical script
that goes with running that packing.

Then please type here the exact output of yade -v where yade is the
executable you are using (it may be named differently depending on how you
compile or which package you download).

Cheers,

Robert


[1] https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/pfv/Thermal.hpp#L133


Le mar. 19 oct. 2021 à 23:01, Zoheir Khademian <
question698...@answers.launchpad.net> a écrit :

> Question #698948 on Yade changed:
> https://answers.launchpad.net/yade/+question/698948
>
> Zoheir Khademian posted a new comment:
> Hey Robert,
> Sorry for my delays. I try to give your comments enough thoughts and do
> investigation before replying.
>
> I tried both released version [1] and development version [2] and still
> observed the instabilities meaning the particle temp goes above the max
> boundary temp while cell temp is still within the range.
>
>
> Regarding the diffusivity coefficient kA/L, in the MWE I uploaded last, I
> have reduced  kA/L by reducing fluidk and fluidConductionAreaFactor to
> arbitrarily low values. I also tried your values
> (thermal.minimumFluidCondDist=rMean and
> thermal.fluidConductionAreaFactor=0.1) but still the particle temp is
> unstable.
>
> Finally I looked at the thermal.cpp and noticed that
> applyTempDeltaToSolids [3] adds pore temp differences to the solid temp
> for no apparent reason (particle temp is updated here [4]). I
> deactivated applyTempDeltaToSolids and recompiled the source. I ran the
> MWE and the results are stable now.
>
> Let me know if applyTempDeltaToSolids must not be deactivated or I am
> missing something here
>
> Thanks
> Zoheir
>
>
> [1] https://launchpad.net/yade/+download
>
> [2] https://gitlab.com/yade-dev/trunk
>
> [3] https://gitlab.com/yade-
> dev/trunk/-/blob/master/pkg/pfv/Thermal.cpp#L94
>
> [4] https://gitlab.com/yade-
> dev/trunk/-/blob/master/pkg/pfv/Thermal.cpp#L605
>
> --
> You received this question notification because your team yade-users is
> an answer contact for Yade.
>
> ___
> Mailing list: https://launchpad.net/~yade-users
> Post to : yade-users@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #698948]: Stability of advection modeling by ThermalEngine

2021-10-19 Thread Zoheir Khademian
Question #698948 on Yade changed:
https://answers.launchpad.net/yade/+question/698948

Zoheir Khademian posted a new comment:
Hey Robert,
Sorry for my delays. I try to give your comments enough thoughts and do 
investigation before replying.

I tried both released version [1] and development version [2] and still
observed the instabilities meaning the particle temp goes above the max
boundary temp while cell temp is still within the range.


Regarding the diffusivity coefficient kA/L, in the MWE I uploaded last, I have 
reduced  kA/L by reducing fluidk and fluidConductionAreaFactor to arbitrarily 
low values. I also tried your values (thermal.minimumFluidCondDist=rMean and 
thermal.fluidConductionAreaFactor=0.1) but still the particle temp is unstable. 

Finally I looked at the thermal.cpp and noticed that
applyTempDeltaToSolids [3] adds pore temp differences to the solid temp
for no apparent reason (particle temp is updated here [4]). I
deactivated applyTempDeltaToSolids and recompiled the source. I ran the
MWE and the results are stable now.

Let me know if applyTempDeltaToSolids must not be deactivated or I am
missing something here

Thanks
Zoheir


[1] https://launchpad.net/yade/+download

[2] https://gitlab.com/yade-dev/trunk

[3] https://gitlab.com/yade-
dev/trunk/-/blob/master/pkg/pfv/Thermal.cpp#L94

[4] https://gitlab.com/yade-
dev/trunk/-/blob/master/pkg/pfv/Thermal.cpp#L605

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #698948]: Stability of advection modeling by ThermalEngine

2021-10-13 Thread Robert Caulk
Question #698948 on Yade changed:
https://answers.launchpad.net/yade/+question/698948

Robert Caulk proposed the following answer:
Hey Zoheir,

The version that you have installed is actually an *earlier* version
than the branch you were using. Best to start using a *later* version so
as to keep up with bug fixes etc. For example, I am using the latest, it
is 52f0c5a7, but installing it is as simple as following these
instructions [1].

>>Would you be able to try this one more time with rMean=0.001 on your
machine? I would really appreciate your help

Yes, it works when I decrease the timestep, as expected. The magnitude
of timestep decrease depends on the seed and packing - we are sampling a
uniform particle distribution [0.001+/-0.00033] 100 times. So sometimes
we may get a tiny sphere other times we may not. That has significant
impact on stability as I will teach to you below. (btw, we do not have
the same seed values since we are on separate computers.) So you can
change seed to demonstrate that process.

I think it will help you for me to review to you directly the fluid
conduction scheme:

All particles are triangulated to create a connected set of tetrahedra.
Each tetrahedron has 4 neighbors, and with those 4 neighbors, it shares
1 facet each. The fluid conduction is computed using the fluid area (A)
of the incident facet divided by the distance between the two
neighboring tetrahedra centers (L). Fluid area is simply the area of the
facet not consumed by a sphere. Please refer to our paper for
visualization of these geometries. So we have:

q_12 = k_12 * A_12/L_12 * (T1 - T2)

As we have discussed at length, the time step depends on this "diffusion
coefficient" kA/L. As that increases, the allowable timestep decreases.
So what does this mean? If the area is big, the timestep is small. If L
is small, the timestep is small, if k is big, the timestep is small. We
can refer to A/L as a characteristic length scale of the problem.

When you start adding a wide distribution of spheres (rRelFuzz=0.33),
you start to play with these geometries in the triangulation indirectly.
Which means you are adjusting your maximum allowable timestep. So if you
are constrained by the timestep of 1e-3, but you insist on decreasing
the characteristic length scale of the fluid conduction scheme
(decreasing sphere size), then you need to make some sacrifices
elsewhere. At least, you can demonstrate this is the root of your
instability by manually controlling the diffusion coefficient via
python:

thermal.minimumFluidCondDist=rMean
thermal.fluidConductionAreaFactor=0.1

This means you have a fluid area that is anomalously large compared to
the rest of your triangulation, or a length that is anomalously small. I
leave it to you to play with these factors to determine which one it is.

By the way, depending on the sensitivity of the triangulation (it can be
quite sensitive when you have a wide range of vertex weights (sphere
radii) ), you need to isolate the problem from any sort of external
stochasticity such as parallelized compaction such as you are showing
here. You have a slightly different triangulation each time (even using
seed in make cloud). Thus, best practice is to export the packing and
then import the identical packing each time.


Cheers,

Robert

[1]https://yade-dem.org/doc/installation.html#source-code

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #698948]: Stability of advection modeling by ThermalEngine

2021-10-13 Thread Robert Caulk
Question #698948 on Yade changed:
https://answers.launchpad.net/yade/+question/698948

Robert Caulk proposed the following answer:
Hey Zoheir,

The version that you have installed is actually an *earlier* version
than the branch you were using. Best to start using a *later* version so
as to keep up with bug fixes etc. For example, I am using the latest, it
is 52f0c5a7, but installing it is as simple as following these
instructions [1].

>>Would you be able to try this one more time with rMean=0.001 on your
machine? I would really appreciate your help

Yes, it works when I decrease the timestep, as expected. The magnitude
of timestep decrease depends on the seed and packing - we are sampling a
uniform particle distribution [0.001+/-0.00033] 100 times. So sometimes
we may get a tiny sphere other times we may not. That has significant
impact on stability as I will teach to you below. (btw, we do not have
the same seed values since we are on separate computers.) So you can
change seed to demonstrate that process.

I think it will help you for me to review to you directly the fluid
conduction scheme:

All particles are triangulated to create a connected set of tetrahedra.
Each tetrahedron has 4 neighbors, and with those 4 neighbors, it shares
1 facet each. The fluid conduction is computed using the fluid area (A)
of the incident facet divided by the distance between the two
neighboring tetrahedra centers (L). Fluid area is simply the area of the
facet not consumed by a sphere. Please refer to our paper for
visualization of these geometries. So we have:

q_12 = k_12 * A_12/L_12 * (T1 - T2)

As we have discussed at length, the time step depends on this "diffusion
coefficient" kA/L. As that increases, the allowable timestep decreases.
So what does this mean? If the area is big, the timestep is small. If L
is small, the timestep is small, if k is big, the timestep is small. We
can refer to A/L as a characteristic length scale of the problem.

When you start adding a wide distribution of spheres (rRelFuzz=0.33),
you start to play with these geometries in the triangulation indirectly.
Which means you are adjusting your maximum allowable timestep. So if you
are constrained by the timestep of 1e-3, but you insist on decreasing
the characteristic length scale of the fluid conduction scheme
(decreasing sphere size), then you need to make some sacrifices
elsewhere. At least, you can demonstrate this is the root of your
instability by manually controlling the diffusion coefficient via
python:

thermal.minimumFluidCondDist=rMean
thermal.fluidConductionAreaFactor=0.1

This means you have a fluid area that is anomalously large compared to
the rest of your triangulation, or a length that is anomalously small. I
leave it to you to play with these factors to determine which one it is.

By the way, depending on the sensitivity of the triangulation (it can be
quite sensitive when you have a wide range of vertex weights (sphere
radii) ), you need to isolate the problem from any sort of external
stochasticity such as parallelized compaction such as you are showing
here. You have a slightly different triangulation each time (even using
seed in make cloud). Thus, best practice is to export the packing and
then import the identical packing each time.


Cheers,

Robert

[1]https://yade-dem.org/doc/installation.html#source-code

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #698948]: Stability of advection modeling by ThermalEngine

2021-10-12 Thread Zoheir Khademian
Question #698948 on Yade changed:
https://answers.launchpad.net/yade/+question/698948

Zoheir Khademian posted a new comment:
Hi Robert,

I updated my Yade version to yade-2021.01a and tried the  script above
with rMean=0.001. The particle temperature still goes up to 1000 K after
2 iterations. I even tried the script on other machines but got the
same results.  Please note that with rMean=0.0015, the temp range is OK
(under 45 K) but once I change the mean size to rMean=0.001, the
particle temperature exceeds the boundary temp and goes to 1000 K.

Would you be able to try this one more time with rMean=0.001 on your
machine? I would really appreciate your help


Zoheir

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #698948]: Stability of advection modeling by ThermalEngine

2021-10-10 Thread Robert Caulk
Question #698948 on Yade changed:
https://answers.launchpad.net/yade/+question/698948

Robert Caulk proposed the following answer:
Hey Zoheir,

I have no way of testing that yadedaily version, and it is not
recommended to be compiling old branches of yade. That was a branch that
was merged into the master, so it is best to stick to the master as you
get updates. But, I can confirm that running the latest master version
is stable in all the condtions you asked me to test. Please update your
sources and recompile:

cd ../trunk
git remote update
git pull upstream master
cd ../build
make -jX install # X being the numberof cores on your computer

Let me know if this fixes it, sorry for the delay,

Robert

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #698948]: Stability of advection modeling by ThermalEngine

2021-10-10 Thread Zoheir Khademian
Question #698948 on Yade changed:
https://answers.launchpad.net/yade/+question/698948

Zoheir Khademian posted a new comment:
Hey Robert,

I ran it in both Yadedaily 20201215-4510~714a723~bionic1 Using python version: 
3.6.9
and "eraseBodyThermalEngine" [1] trunk version.

Of 10 times of running the model, I get 8 stable results and 2 unstable results 
(after 1 iterations)
If I change the sphere size to rMean=0.001 from 0.0015, all tries lead to 
instability. Please reduce the mean sphere size to 0.001 and let me know if you 
can still get stable results.

[1]https://gitlab.com/yade-dev/trunk/-/tree/eraseBodyThermalEngine

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #698948]: Stability of advection modeling by ThermalEngine

2021-10-10 Thread Robert Caulk
Question #698948 on Yade changed:
https://answers.launchpad.net/yade/+question/698948

Robert Caulk requested more information:
Hey zoheir,

I just ran your MWE out 160 seconds, 170k iterations. It is stable,
temperatures do not exceed the boundary conditions. Am I missing
something?

Which version of yade are you running?

Cheers,

Robert

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #698948]: Stability of advection modeling by ThermalEngine

2021-10-10 Thread Zoheir Khademian
Question #698948 on Yade changed:
https://answers.launchpad.net/yade/+question/698948

Zoheir Khademian posted a new comment:
Thanks Robert!
I went through a trial and error process using a more traditional BC as you 
suggested:

low.bndCondIsTemperature=[0,0,0,0,1,1]
flow.thermalBndCondValue=[0,0,0,0,25,45]
thermal.bndCondIsTemperature=[0,0,0,0,1,1]
thermal.thermalBndCondValue=[0,0,0,0,25,45]

and avoid mesh updating by meshUpdateInterval=-1

- First, I turned off the compaction and ran the model. Temperature
ranges seemed to be within expected range 25-45 K. Turning on the
compaction made the model unstable in a way that solid and fluid temp
goes above the assigned boundary condition (45 K).

- I tried to minimize the particle-pore and pore-pore resistivities by 
assigning very small numbers to thermal.fluidConductionAreaFactor[1] and 
thermal.fluidK[2]. I also made sure that the distance between cells wont be 
zero by assigning thermal.minimumFluidCondDist[3] of 0.001. I tried different 
numbers but the particle temp still goes up to 1e3 very quickly while cell temp 
stays below 45 K. 
- I also tried avoiding fictious cells by 
thermal.ignoreFictiousConduction[4]=True but still no chance. I also tried 
using HertzMethod [5] for area calculation. The cell temp was in the range but 
particle temp went to negative. 
- I also limited the Reynolds (thermal.uniformReynolds[6]) to 10 to make sure 
Nusselt number calc is not the reason.

[1] 
https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.ThermalEngine.fluidConductionAreaFactor
[2] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.ThermalEngine.fluidK
[3] 
https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.ThermalEngine.minimumFluidCondDist
[4] 
https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.ThermalEngine.ignoreFictiousConduction
[5] 
https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.ThermalEngine.useHertzMethod
[6] 
https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.ThermalEngine.uniformReynolds
Here is the MWE for reference:
###
from yade import pack, ymport, plot, utils, export, timing
import numpy as np

young=5e6

mn,mx=Vector3(0,0,0),Vector3(0.05,0.05,0.05)

identifier = '-thm_coupling'

if not os.path.exists('VTK'+identifier):
 os.mkdir('VTK'+identifier)

if not os.path.exists('txt'+identifier):
 os.mkdir('txt'+identifier)

O.materials.append(FrictMat(young=young*100,poisson=0.5,frictionAngle=0,density=2600,label='walls'))
O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(30),density=2600,label='spheres'))

walls=aabbWalls([mn,mx],thickness=0,material='walls')
wallIds=O.bodies.append(walls)

sp=pack.SpherePack()
sp.makeCloud(mn,mx,rMean=0.0015,rRelFuzz=.333,num=200,seed=11)
sp.toSimulation(color=(0.752, 0.752, 0.752),material='spheres')

triax=TriaxialStressController(

  maxMultiplier=0,
  finalMaxMultiplier=0,
  thickness = 0,
  goal1=-5,
  goal2=-5,
  goal3=-5,
  max_vel=0.1,
  stressMask = 7,
  internalCompaction=False,
  dead=True,
)

O.engines=[
 ForceResetter(),
 
InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1,label='is2aabb'),Bo1_Box_Aabb()]),
 InteractionLoop(
  
[Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=1,label='ss2sc'),Ig2_Box_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()],label="iloop"
 ),
 
#GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.5),
 triax,
 FlowEngine(dead=1,label="flow",multithread=False),
 ThermalEngine(dead=1,label='thermal'),
 
VTKRecorder(iterPeriod=500,fileName='VTK'+identifier+'/spheres-',recorders=['spheres','thermal','intr'],dead=0,label='VTKrec'),
 NewtonIntegrator(damping=0.5)
]
O.dt=PWaveTimeStep()*.3
O.step()
ss2sc.interactionDetectionFactor=-1
is2aabb.aabbEnlargeFactor=-1
triax.dead=False

while 1:
  O.run(1000, True)
  unb=unbalancedForce()
  print('unbalanced force:',unb,' mean stress: ',triax.meanStress)
  if unb<0.1 and abs(triax.goal3-triax.meanStress)/-triax.goal3<0.001:
break
for b in O.bodies:
 if isinstance(b.shape,Sphere):
  b.dynamic=False
triax.internalCompaction=False
maxY=max([b.state.pos[1]+b.shape.radius for b in O.bodies if 
isinstance(b.shape,Sphere)])
maxX=max([b.state.pos[0]+b.shape.radius for b in O.bodies if 
isinstance(b.shape,Sphere)])
minY=min([b.state.pos[1]-b.shape.radius for b in O.bodies if 
isinstance(b.shape,Sphere)])
minX=min([b.state.pos[0]-b.shape.radius for b in O.bodies if 
isinstance(b.shape,Sphere)])
minZ=min([b.state.pos[2]-b.shape.radius for b in O.bodies if 
isinstance(b.shape,Sphere)])
maxZ=max([b.state.pos[2]+b.shape.radius for b in O.bodies if 
isinstance(b.shape,Sphere)])
print(minX,minY,minZ)
print(maxX,maxY,maxZ)
dz=maxZ-minZ
dy=maxY-minY
dx=maxX-minX

flow.debug=False
# add flow
flow.permeabilityMap = False
flow.pZero = 10
flow.meshUpdateInterval=-1
flow.fluidBulkModulus=2.2e9
flow.useSolver=4
flow.permeabilityFactor=-1e-5

Re: [Yade-users] [Question #698948]: Stability of advection modeling by ThermalEngine

2021-10-08 Thread Robert Caulk
Question #698948 on Yade changed:
https://answers.launchpad.net/yade/+question/698948

Robert Caulk posted a new comment:
>> I forgot to mention that the example I am basing the MWE on is [1]
but I added the wall compaction and made the particles dynamic false
after compaction.

If it is true, you forgot to mention you changed the meshUpdateInterval.

It is important to keep track of all changes in comparison to the
example script, this way we can determine the culprit.

Cheers,

Robert

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #698948]: Stability of advection modeling by ThermalEngine

2021-10-07 Thread Robert Caulk
Question #698948 on Yade changed:
https://answers.launchpad.net/yade/+question/698948

Robert Caulk proposed the following answer:
Hey Zoheir,

The calculation of the diffusion coefficient for the fluid conduction
scheme is inversely proportional to the distance between the centers
i.e. dividing by zero is a no-no.

>>Could you direct me to the section in the source code that may be
sensitive to this specific configuration of meshes?

[1]

Cheers,

Robert

[1]https://gitlab.com/yade-
dev/trunk/-/blob/master/pkg/pfv/Thermal.cpp#L544

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #698948]: Stability of advection modeling by ThermalEngine

2021-10-07 Thread Zoheir Khademian
Question #698948 on Yade changed:
https://answers.launchpad.net/yade/+question/698948

Zoheir Khademian posted a new comment:
Thanks so much Robert for the great suggestions. I forgot to mention
that the example I am basing the MWE on is [1] but I added the wall
compaction and made the particles dynamic false after compaction.

I am going through the trial and error approach you suggested, but I had
a question about what you said earlier in this thread: "The one issue we
may run into is when two tetrahedra centers occur on top of one
another". How can this be an issue? I mean how the alignment of two
meshes on the top of each other can contribute to the instability of TH?
Could you direct me to the section in the source code that may be
sensitive to this specific configuration of meshes?

I will get back to you about the results of the trial and error
exercise.

Thank again

Zoheir

[1] https://gitlab.com/yade-
dev/trunk/-/blob/07085490a7a47f24aa962f914b6ba062ea11a026/examples/ThermalEngine/thermoHydroMechanical_coupling.py

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #698948]: Stability of advection modeling by ThermalEngine

2021-10-06 Thread Robert Caulk
Question #698948 on Yade changed:
https://answers.launchpad.net/yade/+question/698948

Status: Open => Answered

Robert Caulk proposed the following answer:
Hey Zoheir,

Thanks for the good feedback. Can you precise to me the example script
that you are basing this on? We have 4 example scripts in the
repository. I guess you are using flowScenario.py since you had
b.dynamic=False before as well as a pressure boundary condition?

>> If so, could you give me some hint on how to avoid this issue.

We've discussed in the past how to estimate the stable timestep
dynamically [1]. Did you explore that already for your case? I started
adding that feature to ThermalEngine [2][3], but it is still
experimental.

Let's try to debug this through some kind of trial and error, I think it
will identify the problem most rapidly. We can consider the factors
discussed in [1] and hold various components constant. Since you know it
is in the fluid conduction, then you just need to consider the
parameters associated with fluid conduction such as
thermal.fluidConductionAreaFactor[4] and thermal.fluidK. As we discuss
in [1], increasing the diffusion coefficient [5] is going to decrease
the maximum allowable timestep. You have pythonic control over all 3
parameters in that diffusion equation which means you should be able to
determine the exact cause of the instability through trial and error. I
would first start by holding them all constant at extraordinary values
i.e. force that diffusion constant to be extremely low to test if the
system is perfectly stable. Then open up each parameter back to your
desired values indivdiually. BTW to be strict about the test you need to
set flow.meshUpdateInterval=-1 and b.dynamic=False - since those two
components adjust geometric quantities used for the diffusion
coefficient and which evolve with time during the simulation.

Another easy test would be to not run compaction (basically just holding
bodies static) and see if the simulation remains stable.

Thanks for testing this stuff, let me know what you come up with.

[1]https://answers.launchpad.net/yade/+question/695542
[2]https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/pfv/Thermal.cpp#L177
[3]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.ThermalEngine.tsSafetyFactor
[4]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.ThermalEngine.fluidConductionAreaFactor
[5]https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/pfv/Thermal.cpp#L544

Thanks,

Robert

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #698948]: Stability of advection modeling by ThermalEngine

2021-10-06 Thread Zoheir Khademian
Question #698948 on Yade changed:
https://answers.launchpad.net/yade/+question/698948

Status: Answered => Open

Zoheir Khademian is still having a problem:
Hi Robert and thanks for the response.

>>What changes have you made in comparison to the example script? 
1- Turning internal compaction off in the triaxial engine and compacted the 
sample by inwards-moving walls.
2- Reducing the particle density from 2600e10 to 2600 to run the triaixal 
engine. 
3- Setting bodies dynamic false after compaction so there is no movement.
4- Turning off the thermo-mechanical analyses in thermal engine.
5- flow.bndCondIsPressure=[0,0,0,0,1,1] ; flow.bndCondValue=[0,0,0,0,0,10]
6- changing rRelFuzz from 0.333 to 0.33 #Small changes in the packing can make 
the model unstable like changing (mn,mx) a bit.

After making these changes, when I run, the model maximum body and fluid
temp exceed the boundary temp after 2 s.

>> I would apply more traditional boundary conditions a bit to confirm that you 
>> can reach stable states for your setup:
I changed the boundary conditions to the traditional ones as you suggested but 
it did not make any difference in stability.


>>You can take some manual control with thermal.minimumFluidCondDist[1].
I tried assigning different values (0.0015 to 0.015) to minimumFluidCondDist[1] 
but it did not make any difference.


>>However, you should also be able to figure out if that is the issue by simply 
>>turning on and off thermal.fluidConduction.
I turned off thermal.fluidConduction  and it solved the instability. I checked 
the centers of neighboring cells and some of them had pretty close X or Y or Z 
coordinates (less than 1e-5). Is this the issue? If so, could you give me some 
hint on how to avoid this issue. 


[1]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.ThermalEngine.minimumFluidCondDist

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #698948]: Stability of advection modeling by ThermalEngine

2021-10-03 Thread Robert Caulk
Question #698948 on Yade changed:
https://answers.launchpad.net/yade/+question/698948

Status: Open => Answered

Robert Caulk proposed the following answer:
Hey Zoheir,

>So, my question is the origin of this instability if it is not merely
me missing something in the model.

You are applying constant 45 degrees to 1 of the 6 particle boundaries,
yet you have no heat-flux for all 6 boundaries of the flow advection
calculation <- that seems suspect. I would apply more traditional
boundary conditions a bit to confirm that you can reach stable states
for your setup:

flow.bndCondIsTemperature=[0,0,0,0,1,1]
flow.thermalBndCondValue=[0,0,0,0,25,45]
thermal.bndCondIsTemperature=[0,0,0,0,1,1]
thermal.thermalBndCondValue=[0,0,0,0,25,45]

In fact, it brings me to the main question: which example script are you
modelling this after? What changes have you made in comparison to the
example script? Which change results in the instability?

>>If not, is it correct that there may be some polyhedral mesh with bad
geometries somewhere in the model away from the heat source so it takes
a couple thousand steps before the flow reaches these bad geometries and
model crashes? If this is the case, how can I identify these "bad"
geometries and remove them from calculations?

You can guarantee a clean mesh by setting relFuzz=0. This will set a
monodisperse cubic packing that you can be sure will have a clean
triangulation.

That said, the triangulation is not actually an issue in the pore-finite
volume (PFV) scheme. Inherent to the method we don't actually care about
tetrahedral shape - it is simply used for geometric reductions. The one
issue we may run into is when two tetrahedra centers occur on top of one
another (centers are bary centers in PFV). This usually only occurs in
regular packings, and yade is designed to handle these situations
elegantly. You can take some manual control with
thermal.minimumFluidCondDist[1]. However, you should also be able to
figure out if that is the issue by simply turning on and off
thermal.fluidConduction.

[1]https://yade-
dem.org/doc/yade.wrapper.html#yade.wrapper.ThermalEngine.minimumFluidCondDist

p.s. turning various physics (thermal.advection, conduction,
fluidConduction) on and off is a good way to start locating the issue.
You can also turn debug on to get some helpful messages.  You can *not*
break it :)

Let me know what you come up with,

Robert

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


[Yade-users] [Question #698948]: Stability of advection modeling by ThermalEngine

2021-10-03 Thread Zoheir Khademian
New question #698948 on Yade:
https://answers.launchpad.net/yade/+question/698948

Hello,

I am working on the advection through a spherical packing. The problem is when 
thermal advection is on in the model, after about 3 steps or about 2 s the 
body and cell temperatures exceed the target temp (by several orders of 
magnitudes) and thus the model becomes unstable. When I reduce the timestep to 
1e-5 (from 1e-4), the same problem comes up but after 8 s into the simulation.  

So, my question is the origin of this instability if it is not merely me 
missing something in the model. If not, is it correct that there may be some 
polyhedral mesh with bad geometries somewhere in the model away from the heat 
source so it takes a couple thousand steps before the flow reaches these bad 
geometries and model crashes? If this is the case, how can I identify these 
"bad" geometries and remove them from calculations? Any other reasons for this 
delayed instability?

Here is the MWE:


from yade import pack, ymport, plot, utils, export, timing
import numpy as np

young=5e6

mn,mx=Vector3(0,0,0),Vector3(0.05,0.05,0.05)

identifier = '-thm_coupling'

if not os.path.exists('VTK'+identifier):
os.mkdir('VTK'+identifier)

if not os.path.exists('txt'+identifier):
os.mkdir('txt'+identifier)


O.materials.append(FrictMat(young=young*100,poisson=0.5,frictionAngle=0,density=2600,label='walls'))
O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(30),density=2600,label='spheres'))


walls=aabbWalls([mn,mx],thickness=0,material='walls')
wallIds=O.bodies.append(walls)

sp=pack.SpherePack()
sp.makeCloud(mn,mx,rMean=0.0015,rRelFuzz=.33,num=200,seed=11) 
sp.toSimulation(color=(0.752, 0.752, 0.752),material='spheres')

triax=TriaxialStressController(

  maxMultiplier=0, 
  finalMaxMultiplier=0, 
  thickness = 0,
  goal1=-5,
  goal2=-5,
  goal3=-5,
  max_vel=0.1,
  stressMask = 7,
  internalCompaction=False, 
  dead=True,
)


O.engines=[
 ForceResetter(),
 
InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1,label='is2aabb'),Bo1_Box_Aabb()]),
 InteractionLoop(
  
[Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=1,label='ss2sc'),Ig2_Box_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()],label="iloop"
 ),
 
#GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.5),
 triax,
 FlowEngine(dead=1,label="flow",multithread=False),
 ThermalEngine(dead=1,label='thermal'),
 
VTKRecorder(iterPeriod=500,fileName='VTK'+identifier+'/spheres-',recorders=['spheres','thermal','intr'],dead=1,label='VTKrec'),
 NewtonIntegrator(damping=0.5)
]
O.dt=PWaveTimeStep()*.3
O.step()
ss2sc.interactionDetectionFactor=-1
is2aabb.aabbEnlargeFactor=-1
triax.dead=False

while 1:
  O.run(1000, True)
  unb=unbalancedForce()
  print('unbalanced force:',unb,' mean stress: ',triax.meanStress)
  if unb<0.1 and abs(triax.goal3-triax.meanStress)/-triax.goal3<0.001:
break
for b in O.bodies:
if isinstance(b.shape,Sphere):
b.dynamic=False
triax.internalCompaction=False
maxY=max([b.state.pos[1]+b.shape.radius for b in O.bodies if 
isinstance(b.shape,Sphere)]) 
maxX=max([b.state.pos[0]+b.shape.radius for b in O.bodies if 
isinstance(b.shape,Sphere)]) 
minY=min([b.state.pos[1]-b.shape.radius for b in O.bodies if 
isinstance(b.shape,Sphere)]) 
minX=min([b.state.pos[0]-b.shape.radius for b in O.bodies if 
isinstance(b.shape,Sphere)]) 
minZ=min([b.state.pos[2]-b.shape.radius for b in O.bodies if 
isinstance(b.shape,Sphere)]) 
maxZ=max([b.state.pos[2]+b.shape.radius for b in O.bodies if 
isinstance(b.shape,Sphere)]) 
print(minX,minY,minZ)
print(maxX,maxY,maxZ)
dz=maxZ-minZ
dy=maxY-minY
dx=maxX-minX


flow.debug=False
# add flow
flow.permeabilityMap = False
flow.pZero = 10
flow.meshUpdateInterval=5
flow.fluidBulkModulus=2.2e9
flow.useSolver=4
flow.permeabilityFactor=-1e-5
flow.viscosity= 0.001
flow.decoupleForces =  False
flow.bndCondIsPressure=[0,0,0,0,1,1]
flow.bndCondValue=[0,0,0,0,0,10]

## Thermal Stuff
flow.bndCondIsTemperature=[0,0,0,0,0,0] 
flow.thermalEngine=True
flow.thermalBndCondValue=[0,0,0,0,0,0] 
flow.tZero=25

flow.dead=0

thermal.dead=1

thermal.conduction=True
thermal.fluidConduction=True
thermal.debug=0
thermal.thermoMech=False
thermal.solidThermoMech = False
thermal.fluidThermoMech = False
thermal.advection=True
thermal.useKernMethod=False
thermal.bndCondIsTemperature=[0,0,0,0,0,1]
thermal.thermalBndCondValue=[0,0,0,0,0,45]
thermal.fluidK = 0.650
thermal.fluidBeta = 2e-5 # 0.0002
thermal.particleT0 = 25
thermal.particleK = 2.0
thermal.particleCp = 710
thermal.particleAlpha = 3.0e-5
thermal.particleDensity = 2700
thermal.tsSafetyFactor = 0 #0.01
thermal.uniformReynolds =10
thermal.minimumThermalCondDist=0


timing.reset()
O.dt=1e-4
O.dynDt=False
thermal.dead=0
flow.emulateAction()

def bodyByPos(x,y,z):
 cBody = O.bodies[1]
 cDist = Vector3(100,100,100)
 for b in O.bodies:
  if