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/)
-   -   Manual limiter of velocity doesn't work (https://www.cfd-online.com/Forums/openfoam-solving/114556-manual-limiter-velocity-doesnt-work.html)

immortality April 24, 2013 12:45

thanks.
thus if I comment out that coeffs and use a crankNicolson .5 scheme it will be like a rhoPimpleFoam.true?
but I've found it more stable than rhoPimpleFoam even when I use crankNicolson and without coeffs.
whats your opinion about this method?

fredo490 April 24, 2013 13:44

if you remove the "localEuler rDeltaT", the coefficients become useless so you actually don't even need to comment them. You can still do it for safety but you also need to check in the code what is the default value (sometimes even you don't declare it, the solver takes a default value by itself).

I also found that it is more stable but I didn't compare the 2 codes. I think only the pressure file has been changed.

immortality April 24, 2013 14:11

these are defaults:
Code:

scalar rDeltaTSmoothingCoeff
    (
        pimpleDict.lookupOrDefault<scalar>("rDeltaTSmoothingCoeff", 0.02)
    );

    scalar rDeltaTDampingCoeff
    (
        pimpleDict.lookupOrDefault<scalar>("rDeltaTDampingCoeff", 1.0)
    );

I'm mixed up.so is it possible that solver use default values for modifying rDeltaT even if I use crankNicolson .5 time scheme?
there isn't any p folder in rhoLTSPimpleFoam.it seems it uses same folder of p as rhoPimpleFoam.

fredo490 April 25, 2013 04:12

This is a C++ requirement... If you use the solver, you must create the variable and if possible initialize it in case the user made a mistake or forgot it. No matter if you use it or not, the variable must be there ! It is declared in the program so the program creates it.

As a programmer, you always try your best to give a default value to a variable to avoid any hazardous effects. Here the solver gives a default value like any other function does. For example, the k-epsilon model gives default value for the constant but you can use others if you want.

The two variables are used just below there declaration:
Code:

    // Limit rate of change of time scale
    // - reduce as much as required
    // - only increase at a fraction of old time scale
    if
    (
        rDeltaTDampingCoeff < 1.0
    && runTime.timeIndex() > runTime.startTimeIndex() + 1
    )
    {
        rDeltaT =
            rDeltaT0
          *max(rDeltaT/rDeltaT0, scalar(1) - rDeltaTDampingCoeff);

        Info<< "Damped flow time scale min/max = "
            << gMin(1/rDeltaT.internalField())
            << ", " << gMax(1/rDeltaT.internalField()) << endl;
    }

and

Code:

    if (rDeltaTSmoothingCoeff < 1.0)
    {
        fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
    }

And by the way, the localEuler scheme code comments contains:

Quote:

This scheme should only be used for steady-state computations
using transient codes where local time-stepping is preferably to
under-relaxation for transport consistency reasons.


All times are GMT -4. The time now is 00:20.