CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Help for the small implementation in turbulence model

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 18, 2014, 03:39
Default
  #21
Senior Member
 
Baris (Heewa)
Join Date: Jan 2013
Location: Japan
Posts: 130
Rep Power: 13
shipman is on a distinguished road
Dear Alexey,

What do you mean exactly by saying "we arrived to the point where you can describe the problem you are trying to simulate" and how did you understand that 0.1 MPa is to large. In my simulation, outside is environment. Therefore, i set it atmospheric pressure.

Ok, i will try 0 for pressure and will set the relaxation factors according to your advises.

I will let you know results.

Thanks so much

B.
shipman is offline   Reply With Quote

Old   March 18, 2014, 04:19
Default
  #22
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Well,

I meant - "tell us about physical side of the problem you're trying to simulate", geometry, inflow/outflow conditions etc.

Cause I have almost no knowledge about your problem, I can only guess what's going on and give general hints like "change relaxation factors, change PIMPLE dictionary" but the problem maybe elsewhere (for example in wrong direction of g).
alexeym is offline   Reply With Quote

Old   March 19, 2014, 03:51
Default Hi
  #23
Senior Member
 
Baris (Heewa)
Join Date: Jan 2013
Location: Japan
Posts: 130
Rep Power: 13
shipman is on a distinguished road
Dear Alexey,

I have tried following different cases:

1. 0/ k-epsilon I have changed wallFucntion setting =>as ZeroGradient

2. U inlet ==> FixedValue
outlet= intletOutlet and
outlet
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
inletValue uniform (0 0 0);

3. i have used relaxation factors:
Code:
relaxationFactors
{
    fields
    {
    }
    equations
    {
        "U.*"           0.7;
        "k.*"           0.5;  => from 1 to 0.5 tried different values
        "epsilon.*"     0.5; => from 1 to 0.5
        "p_rgh.*"       0.3;
    }
}
4. 0/p_rgh
inlet ==> zeroGradient
Outlet==> fixedValues ==>1e5, 1e4...0 (gradully decreased until 0)
and also for outlet i tried:

Code:
  outlet
    {
        type            fixedMeanValue;
        meanValue        0 and 1e5;    
        value           uniform 0 and 1e5;
    }
5. For gravity i checked direction it is true, but i also took it as pozitive..

All of these different challenges gives again following divergence error :

Code:
ime step continuity errors : sum local = 981070, global = -2.61762e-10, cumulative = 0.00804153
PIMPLE: iteration 49
GAMG:  Solving for p_rgh, Initial residual = 4.69143e-09, Final residual = 4.69143e-09, No Iterations 0
GAMG:  Solving for p_rgh, Initial residual = 4.69143e-09, Final residual = 4.69143e-09, No Iterations 0
time step continuity errors : sum local = 1.44349e+06, global = -3.62086e-10, cumulative = 0.00804153
GAMG:  Solving for p_rgh, Initial residual = 6.18678e-09, Final residual = 6.18678e-09, No Iterations 0
GAMG:  Solving for p_rgh, Initial residual = 6.18678e-09, Final residual = 6.18678e-09, No Iterations 0
time step continuity errors : sum local = 1.90359e+06, global = -3.35302e-10, cumulative = 0.00804153
PIMPLE: iteration 50
GAMG:  Solving for p_rgh, Initial residual = 9.10213e-09, Final residual = 9.10213e-09, No Iterations 0
GAMG:  Solving for p_rgh, Initial residual = 9.10213e-09, Final residual = 9.10213e-09, No Iterations 0
time step continuity errors : sum local = 2.80061e+06, global = -4.94029e-10, cumulative = 0.00804153
GAMG:  Solving for p_rgh, Initial residual = 1.20034e-08, Final residual = 9.50047e-10, No Iterations 1
GAMGPCG:  Solving for p_rgh, Initial residual = 4.32284e-15, Final residual = 4.32284e-15, No Iterations 0
time step continuity errors : sum local = 994878, global = -2.11248e-10, cumulative = 0.00804153
PIMPLE: not converged within 50 iterations
ExecutionTime = 1974.23 s  ClockTime = 2002 s

Courant Number mean: 6.58573e+06 max: 2.47105e+13
deltaT = 2.17834e-30
--> FOAM Warning : 
    From function Time::operator++()
    in file db/Time/Time.C at line 1010
    Increased the timePrecision from 8 to 9 to distinguish between timeNames at time 6.97175e-05
Time = 6.97175051e-05

[11] #0  Foam::error::printStack(Foam::Ostream&)[3] #0  Foam::error::printStack(Foam::Ostream&)[7] #0  Foam::error::printStack(Foam::Ostream&)[6] #0  Foam::error::printStack(Foam::Ostream&)[10] #0  Foam::error::printStack(Foam::Ostream&)[9] #0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[3] #1  Foam::sigFpe::sigHandler(int)[2] #0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[7] #1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[11] #1  Foam::sigFpe::sigHandler(int)[4] #0  Foam::error::printStack(Foam::Ostream&)[5] #0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[9] #1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[10] #1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[7] #2   in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[2] #1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[3] #2  [0] #0  Foam::error::printStack(Foam::Ostream&)[1] #0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[4] #1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[5] #1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[9] #2   in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[11] #2   in "/lib/libc.so.6"
[3] #3   in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[10] #2  [8] #0  Foam::error::printStack(Foam::Ostream&) in "/lib/libc.so.6"
[7] #3   in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[6] #1  Foam::sigFpe::sigHandler(int) in "/lib/libc.so.6"
[11] #3   in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[2] #2   in "/lib/libc.so.6"
[9] #3   in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libO in "/opt/openfoam211/platforms/penFOAM.so"
[0] #1  linux64GccDPOpt/lib/libOpenFOAM.so"
Foam::sigFpe::sigHandler(int)[1] #1  Foam::sigFpe::sigHandler(int)
 in "/lib/libc.so.6"
[10] #3   in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[5] #2  
 in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[4] #2  

 in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[8] #1  Foam::sigFpe::sigHandler(int) in "/lib/libc.so.6"
[2] #3  
[7]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[7] #4  [3]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[3] #4  [11]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[11] #4   in "/lib/libc.so.6"
[5] #3   in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[6] #2   in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[1] #2   in "/lib/ in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[0] #2  libc.so.6"
[4] #3  

[10]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[10] #4  


 in "/lib/libc.so.6"
[1] #3  
 in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[8] #2   in "/lib/libc.so.6"
[0] #3  [2]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[2] #4  [11]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[11] #5  [9]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[9] #4  
 in "/lib/libc.so.6"
[6] #3  [3]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[3] #5  


[4]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[4] #4  [7]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[7] #5   in "/lib/libc.so.6"
[8] #3  


[5]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[5] #4  
[9]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[9] #5  [11]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[11] #6  __libc_start_main[0]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[0] #4  [1]  in "/home/yusuke/OpenFOAM/yusuke-2.1[3]  in "/home/yusuke/OpenFOAM/yusuke.1/platforms/linux64GccDPOpt/bin/RNGinterP-2.1.1/platforms/linux64GccDPOpt/bin/RhaseChangeFoam"
NGinterPhaseChangeFoam"
[1] #4  [3] #6  __libc_start_main
[2]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[2] #5  
[6]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[6] #4  [10]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[10] #5   in "/lib/libc.so.6"
[11] #7  




[7]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[7] #6  __libc_start_main

 in "/lib/libc.so.6"
[3] #7  
[4]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[4] #5  [9]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[9] #6  __libc_start_main[6]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[6] #5   in "/lib/libc.so.6"
[7] #7  
[1]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[1] #5  [2]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[2] #6  __libc_start_main
[10]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[10] #6  __libc_start_main[5]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[5] #5  
[8]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[8] #4  
 in "/lib/libc.so.6"
[2] #7  

[11]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[VENUS:26554] *** Process received signal ***
[VENUS:26554] Signal: Floating point exception (8)
[VENUS:26554] Signal code:  (-6)
[VENUS:26554] Failing at address: 0x3e8000067ba
[VENUS:26554] [ 0] /lib/libc.so.6(+0x33af0) [0x7f17f47d3af0]
[VENUS:26554] [ 1] /lib/libc.so.6(gsignal+0x35) [0x7f17f47d3a75]
[VENUS:26554] [ 2] /lib/libc.so.6(+0x33af0) [0x7f17f47d3af0]
[VENUS:26554] [ 3] RNGinterPhaseChangeFoam() [0x4a8442]
[VENUS:26554] [ 4] RNGinterPhaseChangeFoam() [0x4b74fd]
[VENUS:26554] [ 5] RNGinterPhaseChangeFoam() [0x435358]
[VENUS:26554] [ 6] /lib/libc.so.6(__libc_start_main+0xfd) [0x7f17f47bec4d]
[VENUS:26554] [ 7] RNGinterPhaseChangeFoam() [0x42b849]
[VENUS:26554] *** End of error message ***
 in "/lib/libc.so.6"
[10] #7  [0]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[0] #5   in "/lib/libc.so.6"
[9] #7  [3]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[VENUS:26546] *** Process received signal ***
[VENUS:26546] Signal: Floating point exception (8)
[VENUS:26546] Signal code:  (-6)
[VENUS:26546] Failing at address: 0x3e8000067b2
[VENUS:26546] [ 0] /lib/libc.so.6(+0x33af0) [0x7ff896532af0]
[VENUS:26546] [ 1] /lib/libc.so.6(gsignal+0x35) [0x7ff896532a75]
[VENUS:26546] [ 2] /lib/libc.so.6(+0x33af0) [0x7ff896532af0]
[VENUS:26546] [ 3] RNGinterPhaseChangeFoam() [0x4a8483]
[VENUS:26546] [ 4] RNGinterPhaseChangeFoam() [0x4b74fd]
[VENUS:26546] [ 5] RNGinterPhaseChangeFoam() [0x435358]
[VENUS:26546] [ 6] /lib/libc.so.6(__libc_start_main+0xfd) [0x7ff89651dc4d]
[VENUS:26546] [ 7] RNGinterPhaseChangeFoam() [0x42b849]
[VENUS:26546] *** End of error message ***
[1]  in "/home/yusuke/OpenFOAM/yusuke-2.1.1/platforms/linux64GccDPOpt/bin/RNGinterPhaseChangeFoam"
[1] #6  __libc_start_main
I dont know what i can try..Please tell me some new ways..

Thanks in advance.

B
shipman is offline   Reply With Quote

Old   March 19, 2014, 04:02
Default
  #24
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

well, as you don't want to share an exact description of the physical problem you are trying to simulate, let's continue guessing.

1. You run modified version of interPhaseChangeFoam, have you tried running original solver? Just to try to localize what's causing troubles with convergence.

2. The only modification you've made was that scaling factor for nut? Or you've done something else? Can you share your modified code?

I can continue with questions using just the pictures and solver output you've posted but think it won't be very productive.
alexeym is offline   Reply With Quote

Old   March 19, 2014, 04:39
Default hi
  #25
Senior Member
 
Baris (Heewa)
Join Date: Jan 2013
Location: Japan
Posts: 130
Rep Power: 13
shipman is on a distinguished road
Dear Alexey,


Thanks so much for your reply. I think that you misunderstood. Of course i can share exact description of the physical problem. I am trying to simulate cavitation inside of nozzle. My nozzle shape is as you can see at thread #13.

1. yeah i have tried with original interphasechangefoam. I had one thread before you can see here: http://www.cfd-online.com/Forums/ope...foam_help.html

In original case, cavitation took place inside of nozzle, extended until some level and then disappeared. That was the problem.

After that in some papers i saw that RANS turbulence viscosity is calculated high and need to have some modification to decrease the nut Now what i am trying to do.

2. Yes i have only modification which is bold in the file of U.Eqn as follow:

Code:
    dimensionedScalar rhoUnit("rhoUnit", dimDensity, 1.0);

   surfaceScalarField muEff
    (
        "muEff",
        twoPhaseProperties->muf()
      + fvc::interpolate((Foam::pow((0.017-rho/rhoUnit),5)/Foam::pow((0.017-998),5)*(998-0.017)+ 0.017)*rho*turbulence->nut())
    );

    fvVectorMatrix UEqn
    (
        fvm::ddt(rho, U)
      + fvm::div(rhoPhi, U)
      - fvm::Sp(fvc::ddt(rho) + fvc::div(rhoPhi), U)
      - fvm::laplacian(muEff, U)
      - (fvc::grad(U) & fvc::grad(muEff))
    //- fvc::div(muEff*(fvc::interpolate(dev2(fvc::grad(U))) & mesh.Sf()))
    );

    UEqn.relax();

    if (pimple.momentumPredictor())
    {
        solve
        (
            UEqn
         ==
            fvc::reconstruct
            (
                (
                    fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
                  - ghf*fvc::snGrad(rho)
                  - fvc::snGrad(p_rgh)
                ) * mesh.magSf()
            )
        );
    }
sorry again for misunderstanding.

Please let me know what kind of info you want.

Thanks

B.
shipman is offline   Reply With Quote

Old   March 19, 2014, 11:08
Default
  #26
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Well, cause modeling of cavitation is not something that I do, my thoughts will be quite general (i.e. maybe completely useless ).

1. When you were doing simulations with original interPhaseChangeFoam, what was in your PIMPLE dictionary? Are you sure that the solution converged on every time step?

2. If you need lower turbulent viscosity why not start with just modifying Cmu (if you're using k-epsilon model). Set it 100 time lower (9e-4) and see what will happen.

3. Finally are you sure that settings for cavitation model are correct?

In general you've got several points of possible errors: ICs/BCs, cavitation model settings, transport model settings, your modification of the code. See the influence of these things on the results, locate the source of the problem (well, I guess it'll be code modification as without it code was at least running and simulation wasn't blowing up). Plot muEff with your modification, compare it to the values without modifications. See if it even make any sense.
alexeym is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
implementation of Spalart-Allmaras Turbulence Model zhengjg Main CFD Forum 0 July 24, 2013 04:43
Implementation of turbulence model idefix OpenFOAM Programming & Development 5 March 27, 2013 02:22
SA Turbulence model implementation ganesh Main CFD Forum 0 March 6, 2006 13:23
k-w Turbulence model implementation suneesh Main CFD Forum 4 November 23, 2005 18:35
A reference on implementation of Spalart-Alam. Turbulence Model? Mohammad Kermani Main CFD Forum 2 December 26, 1999 03:56


All times are GMT -4. The time now is 04:45.