Bug in cfdemSolverPiso for nonNewtonian Viscosity Models

Submitted by AliBlues on Fri, 02/17/2017 - 12:46

Hi,
There seems to be a bug in the cfdemSolverPiso as it does not update viscosity of the flow based on the selected viscosity Model. For example, I’ve selected the powerlaw viscosity model in the periodic channel tutorial with the appropriate model parameters. But the solver just doesn’t update the viscosity. I went to the powerLaw model class definition and in the calcNu() function of the class added the line (Info<<”COMPUTING VISCOSITY").
Running the solver, and looking at the log file, pasted below, shows that the top message is only present at the very first time-step, by the constructor function of the powerLaw model which then calls calcNu(). The function for some reason is not called in the remaining timesteps. This is not the case if I use the pisoFoam in which I'll get the message printed out every time step.
I’ve attached the entire case. Would really appreciate it if a solution to this issue is suggested.
Thank you for your time.
Ali

//***********
...
Reading particle velocity field Us
Reading/calculating face flux field phi
Generating interstitial face flux field phiByVoidfraction
Selecting incompressible transport model powerLaw
COMPUTING VISCOSITY

Selecting turbulence model type laminar
Creating finite volume options from "system/fvOptions"
...
**********//

AttachmentSize
Binary Data periodicchannel_nonnewtonian.tar_.gz2.01 MB

AliBlues | Tue, 03/07/2017 - 11:47

Hi,
I very much appreciate it if the developers would check if there is indeed a bug in the cfdemSolverPiso as I have discussed above. I understand it does sound strange that the solver wont update the viscosity if say the powerlaw model is selected since the solver constructs the singlePhaseTransportModel and accordingly the turbulenceModel, and at the end of the solver the turbulence->correct() is called, but as I have indicated with the above simple test, the solver just doesn't call the calcnu() function of the viscosity model (powerlaw here). If I run pisoFoam with powerlaw, one can clearly see that "COMPUTING VISCOSITY" is printed on the log every timestep unlike the cfdemSolverPiso which only shows this at the very beginning timestep as a results of the constructor function for generating the field nu.

Thank you
Ali

j-kerbl's picture

j-kerbl | Wed, 03/08/2017 - 18:23

Hi Ali,

I had this on my list for a while now, but time is rather short.
for OF 30x, try adding
            laminarTransport->correct();
in line 281 in the solver, just above the turbulence update and recompile the solver.
I have this on the list for the next release. Thanks for pointing it out and I'll remove the duplicate post from the User forum.
Please tell me, if this works on your side.

Cheers,
Josef

AliBlues | Thu, 03/09/2017 - 15:14

Hi Josef,
Thank you for the reply.
For OF30x, your suggestion worked, but with the modification:
laminarTransport.correct();

Since from createFields.H laminarTransport is not a pointer to class. So now it gets updated per timestep. Thanks a lot. Still not sure why I would need such a correction as the turbulence->correct() should take care of this as laminarTransport is then used to construct pointer to turbulence which is then corrected?

Best
Ali

j-kerbl's picture

j-kerbl | Wed, 04/05/2017 - 14:24

Hi Ali,

thanks for testing it. I've opened an issue for the next release.
I haven't found any direct link from the turbulence correct to the real fluid viscosity, only turbulent nut.

Cheers,
josef