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/)
-   -   Courant Number Shoot up! (https://www.cfd-online.com/Forums/openfoam-solving/169254-courant-number-shoot-up.html)

NightWing April 6, 2016 12:03

Courant Number Shoot up!
 
I am trying to run a simulation using BuoyantBoussinesqPimpleFOAM.
I have re-modified the solver as a laminar transient one. In the control dict even though i have specifed maxCo has 0.5, during simulation the max courant number reaches values in the range10k-100k+ and still the simulation keeps on running. Mean courant number also varies from 0.001 to 100+ ranges. i have chosen the deltat based on the formuale (i.e. velocity/smallest cell in domain) and i am sure my mesh is a very good mesh.

But ANyone know why this happens??? Any idea??

wyldckat April 16, 2016 12:22

Quick question: Which OpenFOAM version are you using?

Quick answers:
Quote:

Originally Posted by NightWing (Post 593705)
I am trying to run a simulation using BuoyantBoussinesqPimpleFOAM.
I have re-modified the solver as a laminar transient one.

You don't need to modify the solver, you only need to configure the "constant/turbulenceProperties" file to use "laminar".

Quote:

Originally Posted by NightWing (Post 593705)
In the control dict even though i have specifed maxCo has 0.5,

Don't assume you've configured the file properly ;). Please provide the "controlDict" file, because apparently you missed one very tiny detail somewhere.

In addition, if you indeed have modified the solver, then you might have broken how it adapts the time step.

NightWing April 17, 2016 00:13

Thank you for the reply
 
Hi Bruno,

I am glad you happen to read my post :) Yeah i initially, switched off RAS to laminar in the 'turbulenceProperties' in the constant directoary. But Still it kept on asking to read the values of alphat, k, epsilon etc which is not needed as iam trying to simulate a laminar solver.
So i took out, the RAS and turbulence.H files from my .C file and also from my files/options in the solver and re-complied it. Just to keep away all the unwanted aspects of turbulence in the solver. (pratically it wasnt needed but i just tried :) ) I would post the controlDict file here:


Code:

libs (
      "libOpenFOAM.so"
      "libsimpleSwakFunctionObjects.so"
      "libswakFunctionObjects.so"
      "libgroovyBC.so"
    );


application    Foam;

startFrom      startTime;

startTime      0;

stopAt          endTime;

endTime        1800;

deltaT            1;

writeControl    timeStep;

writeInterval  150;

purgeWrite      0;

writeFormat    ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision  6;

runTimeModifiable true;

adjustTimeStep  no;

maxCo          0.5;

i am trying to use groovyBC for some of my boundaries. I want to use heatflux (uniform) on my walls. for that i tried to use groovyBC. But later i found that there is something called as fixedGradient too. I am currently using fixedGradient BC. While simulation my courant no is of the range 2.0 to 2.9 and the max courant number is 90.0 to 90.9 <----

But the results i get are somewhat in accordance with the physics of the problem. I am trying to simulate natural convection (thermosyphon effect) on tubes. In the base solver the UEqn.H is given as:


Code:

fvVectorMatrix UEqn
    (
        fvm::ddt(U)
      + fvm::div(phi, U)
      + turbulence->divDevReff(U)
    ==
        fvOptions(U)
    );

    UEqn.relax();

    fvOptions.constrain(UEqn);

    if (pimple.momentumPredictor())
    {
        solve
        (
            UEqn
        ==
            fvc::reconstruct
            (
                (
                  - ghf*fvc::snGrad(rhok)
                  - fvc::snGrad(p_rgh)
                )*mesh.magSf()
            )
        );

        fvOptions.correct(U);
    }

i have re-written this Equation as:

Code:

// Solve the momentum equation

    fvVectorMatrix UEqn
    (
        fvm::ddt(U)
      + fvm::div(phi, U)
      -fvm::laplacian(nu, U)

    );

    UEqn.relax();

    UEqn.solve();

as i have switched off the momentum predictor in the fvSolutions. Does this make sense?? I didnt change my pEqn.H.

Any Suggestions Sir :)

wyldckat April 17, 2016 14:20

Quick answers:
Quote:

Originally Posted by NightWing (Post 595408)
I am glad you happen to read my post :) Yeah i initially, switched off RAS to laminar in the 'turbulenceProperties' in the constant directoary. But Still it kept on asking to read the values of alphat, k, epsilon etc which is not needed as iam trying to simulate a laminar solver.

What about the "RASProperties" file?


And I'm glad I asked for the "controlDict", because these 3 entries:
Quote:

Originally Posted by NightWing (Post 595408)
Code:

deltaT            1;

writeControl    timeStep;

adjustTimeStep  no;


should be changed to something like this:
  • Smaller "deltaT", to avoid unexpected surprises:
    Code:

    deltaT            0.01;
  • Adjustable time step is a must, so that it's written at the correct time:
    Code:

    writeControl    adjustableRunTime;
  • And now, the very most important detail that you missed... is this:
    Code:

    adjustTimeStep  yes;


Quote:

Originally Posted by NightWing (Post 595408)
Code:

// Solve the momentum equation

    fvVectorMatrix UEqn
    (
        fvm::ddt(U)
      + fvm::div(phi, U)
      -fvm::laplacian(nu, U)

    );

    UEqn.relax();

    UEqn.solve();

as i have switched off the momentum predictor in the fvSolutions. Does this make sense?? I didnt change my pEqn.H.

Looks OK to me. Although keep in mind that this way you can't use source terms defined with "fvOptions" for the U field.

NightWing April 17, 2016 14:25

Big Thank you Bruno :)
 
I was waiting even if its late at nite here f or your post :) Glad that u read my post ;) am a slow learner thanks for the help

Indeed yeah, I cant use my source term using fvOptions by this way. But i guess i dont need it for my problem. It seems like that. I would check with the controlDict file and let u know, what happened :)

And about RAS properties file inside the constant directory, i removed it as i have removed RAS Header files frm .C :)

wyldckat April 17, 2016 14:41

Quote:

Originally Posted by NightWing (Post 595470)
I was waiting even if its late at nite here f or your post :)

Just to let you know that I likely won't be able to answer more questions until next weekend, or even only on the other weekend. So no use staying up even more late today waiting for any answers from me ;)

NightWing May 15, 2016 11:00

Hope you had a safe journey :) Bruno (Y)
 
Hi All,

In my problem as stated above, i am using fixedGradient to apply a uniform heat flux boundary condition on walls. Suppose I want to apply heat flux condition on the surface of a tube through which water is flowing. since i want to apply different heat flux at the top side and bottom side of the top i have written a boundary condition like

topside
{
type fixedGradient;
gradient uniform 1321.549;
}

bottomside
{
type fixedGradient;
gradient uniform 320.145;
}

And I have set the internalfield of Temperature field to be at room temperature i.e. 298K. But when i run the simulation, the temperature on the bottom walls falls below 298K or even goes like 180K even. The temperature Equation is

fvScalarMatrix TEqn
(
fvm::ddt(T)
+ fvm::div(phi, T)
- fvm::laplacian(KcEff, T)
);

TEqn.relax();

TEqn.solve();
where KcEff is a dimensioned Scalar for time being.

any suggestions?

NightWing June 3, 2016 02:00

I solved it
 
It was an error occurring due to some mistake in m pressure boundary conditions.
It works now.

NightWing June 5, 2016 23:16

I am trying to simulate a problem similar to water flowing through a glass tube. The glass tube is provided with constant heat flux and i am using boussinesq approximation to model the natural convection taking place within the tube. The base solver i am using is buoyantBoussinesqPimpleFOAM.

The problem is transient, laminar, incompressible.
I kind of modeled the problem. But i have some doubts regarding this issue.

To apply a constant heat flux condition on tube walls i have used a fixedGradient Boundary condition on 0/T
As we know that Q/A (heat flux) = -k* dt/dx, where k is thermal conductivity of glass

Now i assume that, the water intakes the heat applied on tube walls by convection. therefore Q/A = h* (T - Tinf)

If this formulation is right. I want to find out the (T-Tinf). But as i dont know much about OpenFOAM, i dont know how to compute it. I want to calculate this in every cell of the domain.

Why i need (T-Tinf)? Suppose if i want to calculate the grashoffno from this solver in post processing stage. I can write the grashoff nio equation and it contains this term (T-Tinf). By finding it, i can find out grashoff no also. is it correct?

If my theory is wrong, please correct me. How can i compute that (T-Tinf) from my solver?

Looking forward for your help.


All times are GMT -4. The time now is 13:18.