CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   refCell for Laplacian in a periodic box (https://www.cfd-online.com/Forums/openfoam-solving/179693-refcell-laplacian-periodic-box.html)

gigilentini8 November 5, 2016 09:50

refCell for Laplacian in a periodic box
 
Hi all,

I am solving a simple diffusion problem on a periodic (cyclic condition) box with regular grids.
I start from random values in each cell (either as initial condition or source term in steady diffusion) and I let the Laplacian do the smoothing it is supposed to do

everything works as expected, apart that strange over(under-)shoots appear in the cell where I set my reference value (needed of course due to periodicity), in a consistent way. i.e., I repeated several times with different random seeds and realisations and the values at the refCell or refPoint are always much lower or much larger than the rest of the domain.

It looks like the reference values are not exactly doing their job.
I am using all linear uncorrected schemes and OF 4.x

any clue on how to solve this?

my code is as simple as this
Code:

    while (simple.loop())
    {
          fvScalarMatrix TEqn  (
                fvm::ddt(T) - fvm::laplacian(DT, T) +  fvOptions(T)
                == -ff
            );

        TEqn.relax();
        TEqn.setReference(TRefCell, TRefValue);
        fvOptions.constrain(TEqn);
              TEqn.solve();
                    fvOptions.correct(T);
        }


gigilentini8 November 5, 2016 10:08

Solved!
 
1 Attachment(s)
Ok, the problem was just that I was smoothing so much that the mismatch I saw between the refPoint and the rest of the domain was maybe a real effect due to the statistical error

with much smaller diffusion coefficient, I can get a nice smooth Gaussian Random Field


All times are GMT -4. The time now is 19:30.