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

after 3 timesteps I always get "Floating Point Exception"

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By wyldckat
  • 1 Post By wyldckat
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 3, 2014, 15:31
Default after 3 timesteps I always get "Floating Point Exception"
  #1
New Member
 
Join Date: Mar 2014
Posts: 28
Rep Power: 12
knoedl1 is on a distinguished road
HI,

everytime i start the calculation, after 3 timesteps the "Floating Point Exception ERROR"
occurs. I am calculating a compressible case and want to have a eual massflow at inlet and outlet.

U:

inlet: flowRateInletVelocity
outlet zeroGradient

p:

inlet: zeroGradient
outlet groovyBC

and if i change my outlet BC for p into a fixedValue
the calculation is running but not with my groovyBC, here it stopps after 3 timesteps,
does anybody know why?
knoedl1 is offline   Reply With Quote

Old   October 4, 2014, 11:51
Default whats the cause of error?
  #2
New Member
 
Join Date: Mar 2014
Posts: 28
Rep Power: 12
knoedl1 is on a distinguished road
Hi,

maybesomebody can help me with this problem or maybe had ones the same problem.
I want to simulate a turbine and calculate the thrust of it. therefore i didn t mesh the turbine, i only meshed the air arround the turbine an i see the turbine as a blackbox, where air is going out (combustion) and going in (turbine) into the mesh. So it is important that thes same massflow is going in and out.


Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading thermophysical properties

Selecting thermodynamics package hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>


Selecting thermodynamics package hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>
Reading field rho

Reading field U

Reading/calculating face flux field phi

Creating turbulence model

Selecting turbulence model type RASModel
Selecting RAS turbulence model kOmegaSST
kOmegaSSTCoeffs
{
    Prt             0.85;
    alphaK1         0.85034;
    alphaK2         1;
    alphaOmega1     0.5;
    alphaOmega2     0.85616;
    gamma1          0.5532;
    gamma2          0.4403;
    beta1           0.075;
    beta2           0.0828;
    betaStar        0.09;
    a1              0.31;
    c1              10;
}

Create Riemann solver


    From function simpleFunctionObject::simpleFunctionObject
    in file simpleFunctionObject/simpleFunctionObject.C at line 109
    'outputControlMode' not found in inletMassFlow
Assuming: timeStep
--> FOAM Warning : 
    From function simpleFunctionObject::simpleFunctionObject
    in file simpleFunctionObject/simpleFunctionObject.C at line 117
    'outputInterval' not found in inletMassFlow
Assuming: 1
phi: phi
Compressible: 1
Turbulent: 1
LES: 0
--> FOAM Warning : 
    From function simpleFunctionObject::simpleFunctionObject
    in file simpleFunctionObject/simpleFunctionObject.C at line 109
    'outputControlMode' not found in outletMassFlow
Assuming: timeStep
--> FOAM Warning : 
    From function simpleFunctionObject::simpleFunctionObject
    in file simpleFunctionObject/simpleFunctionObject.C at line 117
    'outputInterval' not found in outletMassFlow
Assuming: 1
phi: phi
Compressible: 1
Turbulent: 1
LES: 0

 Time = 1



 Time = 2

diagonal:  Solving for p, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for Ux, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for Uz, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for h, Initial residual = 0, Final residual = 0, No Iterations 0
rho residual: 3.68136
p residual: 7.50091
U residual: 7.21437
T residual: 6.50897

DILUPBiCG:  Solving for omega, Initial residual = 0.000300156, Final residual = 9.44318e-12, No Iterations 1
DILUPBiCG:  Solving for k, Initial residual = 0.339242, Final residual = 7.49917e-14, No Iterations 2

 VMax = 373.504  MaMax = 0.849475  TtMax = 969.44  ptMax = 146628


    ExecutionTime = 3.39 s

 MassFlows:   Einlass_Turbine = 0.216
 MassFlows:   Auslass_Verdichter = 0.215495
forces output:
    forces(pressure, viscous)((-175.486 -13.4115 -8.87201e-18) (0.00040323 0.0156628 4.51661e-11))
    moment(pressure, viscous)((-6.32472e-19 4.82308e-19 35.2419) (2.19898e-11 -3.64473e-12 0.000636325))


 Time = 3

[1]+  Gleitkomma-Ausnahme     (Speicherabzug geschrieben) transonicSteadyMultiDensityFoam > my.log
but everytime i want to run the case it stops after 3 loops.
I know that there must be something wrong with
------>BC
------->Mesh
------->intitial conditions

I think it must be something of the BC because before the simulation ran perfect but after i changed somthing to groovyBC in the p-file, it wont fit anymore.

You see in the error message i always get a Floating error Message, So i think there must be something devided by zero ?!?

Here is my p-file:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.2                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions       [1 -1 -2 0 0 0 0];  //[0 2 -2 0 0 0 0];

internalField   uniform 97600;

boundaryField
{
    front
    {
        type            wedge;
    }

    back
    {
        type            wedge;
    }
    
    Netzoberflaeche1
    {
        //type fixedValue;
        //value uniform 95000;
                 
//         type            outletInlet;  
//     outletValue uniform  97600;
//         value uniform 97600;

         type            zeroGradient;
    
    }
    
    Netzoberflaeche2
    { 
      type            symmetryPlane; 
      
     // type fixedValue;
      //value uniform 95000;
        /*         
        type            outletInlet;  
    outletValue uniform  95000;
        value uniform 95000;
    */
    
    
    }
    
    Netzoberflaeche3
    { 
      
       // type fixedValue;
      //value uniform 95000;
                
        type            outletInlet;  
    outletValue uniform  97600;
        value uniform 97600;    
    }
    
    Starter_wall
         
     {
        type            zeroGradient;
     }

     Gasturbine_wall
     
     {
        type            zeroGradient;
     }

         
       
       Duese_wall  
           
      {
        type            zeroGradient;
      }

     Schubrohr_innen
          
      {
        type            zeroGradient;
      }


        Schubrohr_aussen
           
      {
        type            zeroGradient;
      }
    
    Einlass_Turbine
    {
         type            zeroGradient;       
    }
    
    /*Auslass_Verdichter
    {
      type               fixedValue;    
      value              uniform 94610;
      
    }*/
    
     Auslass_Verdichter
   {
     
       type groovyBC;
       
     // variable"0.0030/(sum(mag(Sf()))*(normal()&U)))*287.058*(T-(sqr(mag(U))/(2*1004.5)));T1=10;Umgebungsdruck=95000;";     
     // valueExpression "(time() < T1)?  Umgebungsdruck : pressure ";
      valueExpression"(0.0030/(sum(mag(Sf()))*(normal()&U)))*287.058*(T-(sqr(mag(U))/(2*1004.5)))";     
     
     
          
       value uniform  95000;//94610;
       
       
       
   }
   
    

    unten //defaultFaces
    {
        type            empty;
    }
}

// ************************************************************************* //
and the U-file:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.2                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0 30 0);

boundaryField
{
    front
    {
        type            wedge;
        
    }

    back
    {
        type            wedge;
    }
    
    Netzoberflaeche1
    {
      type            temperatureDirectedInletVelocity;
        cylindricalCS   no;
        omega           (0 0 0);
        T0              uniform 288.15;
        inletDirection  uniform (0 1 0);
        value           uniform (0 30 0);
      
        /*    
    type            pressureDirectedInletVelocity;
       // cylindricalCS   no;
       // omega           (0 0 0);    
       // T0              uniform 293;
        inletDirection  uniform (0 1 0);
        value           uniform (0 10 0);
        */
        
    }
    
    Netzoberflaeche2
    {   
      type            symmetryPlane; 
      /*
        type            pressureDirectedInletVelocity;
        //cylindricalCS   no;
        //omega           (0 0 0);
        //T0              uniform 293;
        inletDirection  uniform (-1 0 0);
        value           uniform (10 0 0);
        */
        
    }
    
    Netzoberflaeche3
    {
  type zeroGradient;
// //         type            pressureDirectedInletVelocity;
//     type pressureDirectedInletOutletVelocity;    
//         //cylindricalCS   no;
//         //omega           (0 0 0);
//         //T0              uniform 293;
//     inletValue uniform (0 0 0);
//         inletDirection  uniform (0 1 0);
//         value           uniform (0 10 0);
        
    }
    
    Starter_wall
    
        
        {             
           type            fixedValue;
           value           uniform (0 0 0);            
        }

     Gasturbine_wall
     
        {
           type            fixedValue;
           value           uniform (0 0 0);
        }
       
         
      

         
       
          Duese_wall  
        {             
           type            fixedValue;
           value           uniform (0 0 0);
                  
    }

        Schubrohr_innen
    
        
        {             
           type            fixedValue;
           value           uniform (0 0 0);
                  
    }


         Schubrohr_aussen
    
       {             
           type            fixedValue;
           value           uniform (0 0 0);
                  
    }
    
    Einlass_Turbine
    {
      
//         type fixedValue;
//     value            uniform (0 541 0);
      
    type             flowRateInletVelocity; //fixed value
        flowRate         0.0030;
        value            uniform (0 540 0);
     
    
    }
    
    Auslass_Verdichter
    {
        type zeroGradient;
       
    /*
        type             flowRateInletVelocity; 
        flowRate         -0.02;
        value            uniform (0 1 0);
        
        */    
    
        
    }
    
    

    unten //defaultFaces
    {
        type            empty;
    }
}

// ************************************************************************* //
knoedl1 is offline   Reply With Quote

Old   October 5, 2014, 04:55
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick-robotic answer: Insufficient information provided. Instructions from this thread were not followed: http://www.cfd-online.com/Forums/ope...-get-help.html

Will have to resort to copy-pasting from blog post: List of threads useful for building OpenFOAM and other Third Party tools
Quote:
"Oh my, oh my, the solver crashed, what am I going to do?"
  1. Don't panic.
  2. Start reading here: Foam::error::PrintStack - post #2
  3. Still can't figure out the problem, then read here: Parallel running of 3D multiphase turbulence model (unknown problem!!) post#3
  4. Perhaps wrong dimensions? porousSimpleFoam - crash post #2
  5. Wondering what it all means? Here's an explanation of one example: Unstabil Simulation with chtMultiRegionFoam post #11
edit: this was in answer to post #1, before I moved #2 from the thread mentioned below.
songwukong likes this.

Last edited by wyldckat; October 5, 2014 at 14:17. Reason: see "edit:"
wyldckat is offline   Reply With Quote

Old   October 5, 2014, 13:59
Default
  #4
New Member
 
Join Date: Mar 2014
Posts: 28
Rep Power: 12
knoedl1 is on a distinguished road
Hi
wyldckat, thank you very much for your reply, may you look at this thread,
http://www.cfd-online.com/Forums/ope...tml#post512890
there i have some details about my problem. Maybe you can help me with this issue??? thank you very much!!!

Last edited by wyldckat; October 5, 2014 at 14:41. Reason: rectified link and moved post to this same thread - it's now post #2
knoedl1 is offline   Reply With Quote

Old   October 5, 2014, 14:40
Default
  #5
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi knoedl1,

I've moved that post to this thread as well, to keep things in the same line of discussion. Next time please ask a Forum Moderator to move/merge the thread (as indicated in the forum rules, point #6 ).

OK... so the solver you're using is from the DensityBasedTurbo toolkit, more specifically from the branch "preconditioned_roe": http://sourceforge.net/p/openfoam-ex...oned_roe/tree/ - but there is no clear indication of which exact OpenFOAM or foam-extend version you're using.
This looks like a seriously experimental solver. The output isn't very conventional and the lack of a stack trace means we don't have any valuable hints as to where it crashed and why .

Unfortunately some of the patch names look cryptic to me, since I don't know German

Honestly, if I had to figure this out myself, I would take several steps back to a much more simplified case, then gradually increase the complexity of the problem. Because from what I can understand, it doesn't look like that the problem is a wrongly defined boundary condition... there seems that there is at least room for 3 incorrect boundary conditions, but it depends on what should really be used/done for each. A strategy of isolate-and-conquer is the one likely to lead to a successful case set-up.

Best regards,
Bruno
songwukong likes this.
__________________
wyldckat is offline   Reply With Quote

Old   October 5, 2014, 16:14
Unhappy
  #6
New Member
 
Join Date: Mar 2014
Posts: 28
Rep Power: 12
knoedl1 is on a distinguished road
hi Bruno,

i use OpenFoam1.6ext, if I change
Auslass_Verdichter in file p to

Code:
Auslass_Verdichter    
 {     
  type               fixedValue;        
   value              uniform 94610;          
  }
The simulation runs perfect, but the massflow ist not equal
between Ausalss_Verdichter and Einlass_Turbine or to translate it in english
between Outlet_Compressor and Inlet_Nozzle. So i think there must be something with the groovyBC type
in the p file???
knoedl1 is offline   Reply With Quote

Old   October 6, 2014, 12:53
Default
  #7
New Member
 
Join Date: Mar 2014
Posts: 28
Rep Power: 12
knoedl1 is on a distinguished road
nobody else an idea?
knoedl1 is offline   Reply With Quote

Old   October 7, 2014, 15:48
Default
  #8
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi knoedl1,

In case you aren't yet very familiar with how picky OpenFOAM is, allow me to suggest that you try to keep these field files as clean and neat as possible, so that you can minimize the probability of making a mistake.
For example, this:
Code:
    Starter_wall
    
        
        {             
           type            fixedValue;
           value           uniform (0 0 0);            
        }

     Gasturbine_wall
     
        {
           type            fixedValue;
           value           uniform (0 0 0);
        }
Can easily lead you to not see properly how things are defined. For this example, the code should be something like this:
Code:
    Starter_wall
    {             
       type            fixedValue;
       value           uniform (0 0 0);            
    }

    Gasturbine_wall
    {
       type            fixedValue;
       value           uniform (0 0 0);
    }
Why? Because the problem with GroovyBC is somewhat related to this kind of behaviour.
This line is from the code you posted:
Code:
valueExpression"(0.0030/(sum(mag(Sf()))*(normal()&U)))*287.058*(T-(sqr(mag(U))/(2*1004.5)))";
I only noticed the error when I copy-pasted the content of each file into a text editor and then tried to make it a bit more easier to read, by changing a bit the indentation and spacing... when I suddenly noticed that on that line there is a very small detail that has a massive importance: there is a space missing between 'valueExpression' and the quote '"':
Code:
valueExpression "(0.0030/(sum(mag(Sf()))*(normal()&U)))*287.058*(T-(sqr(mag(U))/(2*1004.5)))";
Honestly, without a test case, I'm not 100% certain this is problem and if it's the only one or not.

My suggestion is that you create a more simplified test case, something like a cube or square pipe, with one inlet and one outlet and test this boundary condition with "groovyBC". I say this because there might be one very critical error somewhere in the mathematical expression being done in "valueExpression", which is not easy to diagnose by someone else than yourself.
In addition, it's possible that something in that expression isn't working exactly as you think it does, which is also another reason for you to use a simple test case for testing if each parameter does what you want it to do.

Best regards,
Bruno
songwukong likes this.
__________________
wyldckat is offline   Reply With Quote

Old   October 8, 2014, 07:06
Default
  #9
New Member
 
Join Date: Mar 2014
Posts: 28
Rep Power: 12
knoedl1 is on a distinguished road
Hi Bruno,

thank you for your posting!
Yes i also tried it with a simple test case, but it also didnt work. I akso tried it like you said with the quote " , but also no effect,
I tried it with variables, also not working

Code:
Auslass_Verdichter
     {
     
       type groovyBC;                   
       variables "m=0.003;R=287.058;A=sum(mag(Sf()));cp=1004.5;";
       valueExpression "(m/(A*(normal() & U)))*R*(T-(sqr(mag(U))/(2*cp)))";
       value uniform  94400;//94610;      
     }
i think it must be something bit the U field in "valueExpression" ?!
knoedl1 is offline   Reply With Quote

Old   October 11, 2014, 13:58
Default
  #10
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by knoedl1 View Post
Yes i also tried it with a simple test case, but it also didnt work.
Then please share that test case! It will make considerably easier to help you.

Because without such a test case, only someone who has gone through the same exact problem + still remembers how he/she solved the problem + sees your post, will be able to answer you... and unfortunately the probabilities of that happening are very low... not impossible, but very low
wyldckat is offline   Reply With Quote

Old   October 11, 2014, 14:25
Red face
  #11
New Member
 
Join Date: Mar 2014
Posts: 28
Rep Power: 12
knoedl1 is on a distinguished road
Hi Bruno,
i think i know now whars going to be wrong, the term "Term" is going to be minus and for some reason groovyBC doesnt like that. i tried to fix the problem with mag() or sqr() but after 3 timeloops the massflow is going to be get a minus and in paraview flow is not going out of the domain , the glyphs at Auslass_Verdichter show in the domain, but it should be the opposite there. here is the code:


Code:
Time = 1

swak4Foam: Allocating new repository for sampledGlobalVariables
diagonal:  Solving for p, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for Ux, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0


 Time = 2

diagonal:  Solving for p, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for Ux, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for Uz, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for h, Initial residual = 0, Final residual = 0, No Iterations 0
rho residual: 3.68136
p residual: 7.50091
U residual: 7.21436
T residual: 6.50897

DILUPBiCG:  Solving for omega, Initial residual = 0.000300057, Final residual = 9.40299e-12, No Iterations 1
DILUPBiCG:  Solving for k, Initial residual = 0.339217, Final residual = 7.48541e-14, No Iterations 2

 VMax = 373.504  MaMax = 0.849452  TtMax = 969.44  ptMax = 146625


    ExecutionTime = 2.19 s

 MassFlows:   Einlass_Turbine = 0.216
 MassFlows:   Auslass_Verdichter = 0.215495
forces output:
    forces(pressure, viscous)((-175.486 -10.8263 -8.87201e-18) (0.000186025 0.0156629 4.51661e-11))
    moment(pressure, viscous)((-6.40361e-19 4.82308e-19 35.3082) (2.19898e-11 -3.64473e-12 0.000636327))


 Time = 3



 Time = 4

diagonal:  Solving for p, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for Ux, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for Uz, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for h, Initial residual = 0, Final residual = 0, No Iterations 0
rho residual: 3.9172
p residual: 8.19088
U residual: 6.47136
T residual: 6.54051

DILUPBiCG:  Solving for omega, Initial residual = 0.000301757, Final residual = 2.0824e-11, No Iterations 1
DILUPBiCG:  Solving for k, Initial residual = 0.150903, Final residual = 9.71889e-09, No Iterations 1

 VMax = 370.996  MaMax = 0.719477  TtMax = 968.511  ptMax = 127627


    ExecutionTime = 3.59 s

 MassFlows:   Einlass_Turbine = 0.216
 MassFlows:   Auslass_Verdichter = -0.199458
forces output:
    forces(pressure, viscous)((-175.484 -10.4786 -8.87308e-18) (0.00017001 0.0157096 3.65987e-11))
    moment(pressure, viscous)((-6.41601e-19 4.82301e-19 35.317) (2.02191e-11 -3.29715e-12 0.000632376))


 Time = 5



 Time = 6

diagonal:  Solving for p, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for Ux, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for Uz, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for h, Initial residual = 0, Final residual = 0, No Iterations 0
rho residual: 3.81277
p residual: 8.07941
U residual: 6.41272
T residual: 6.55219

DILUPBiCG:  Solving for omega, Initial residual = 0.000300682, Final residual = 4.65901e-11, No Iterations 1
DILUPBiCG:  Solving for k, Initial residual = 0.0906244, Final residual = 1.4054e-13, No Iterations 2

 VMax = 367.168  MaMax = 0.609535  TtMax = 967.104  ptMax = 126289


    ExecutionTime = 4.99 s

 MassFlows:   Einlass_Turbine = 0.216
 MassFlows:   Auslass_Verdichter = -0.204487
forces output:
    forces(pressure, viscous)((-175.483 -10.0527 -8.87376e-18) (0.000145578 0.0157592 2.20676e-11))
    moment(pressure, viscous)((-6.42282e-19 4.82292e-19 35.3275) (1.74642e-11 -2.74438e-12 0.000628062))


 Time = 7
You see that after the third timestep massflow gets a minus, but how can i tell groovyBC that it should be positive and the flow should go out of the domain. Can i do this with normal( ) or something? Maybe its because of the normal() expression in the calculation?

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.2                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions       [1 -1 -2 0 0 0 0];  //[0 2 -2 0 0 0 0];

internalField   uniform 97600;

boundaryField
{
    front
    {
        type            wedge;
    }

    back
    {
        type            wedge;
    }
    
    Netzoberflaeche1
    {
         type            zeroGradient;    
    }
    
    Netzoberflaeche2
    { 
      type            symmetryPlane;            
    }
    
    Netzoberflaeche3
    {            
        type            outletInlet;  
    outletValue uniform  97600;
        value uniform 97600;    
    }
    
    Starter_wall        
     {
        type            zeroGradient;
     }

     Gasturbine_wall    
     {
        type            zeroGradient;
     }

         
       
       Duese_wall            
      {
        type            zeroGradient;
      }

     Schubrohr_innen          
      {
        type            zeroGradient;
      }


        Schubrohr_aussen           
      {
        type            zeroGradient;
      }
    
    Einlass_Turbine
    {
         type            zeroGradient;       
    }
    
  
    
     Auslass_Verdichter
     {           
       type groovyBC;       
       valueExpression "sqrt(number)"; 
       variables "m=0.003;R=287.058;A=sum(mag(Sf()));cp=1004.5;Term=pow((T-(sqr(mag(U))/(2*cp))),2);number=sqr((m/(A*(normal()&U)))*R*sqrt(Term));";
       value uniform 94310;//94610;      
     }
   
    

    unten //defaultFaces
    {
        type            empty;
    }
}

// ************************************************************************* //
Do you maybe have an idea?
Yes im looking for the test case thank you!!!
knoedl1 is offline   Reply With Quote

Old   October 11, 2014, 14:36
Default
  #12
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by knoedl1 View Post
Do you maybe have an idea?
From the brief experience I have with pressure based boundary conditions, 1 Pa is more than enough to drive the flow in the opposite direction.
I can only guess that the problem you're seeing is that this patch is getting a calculated pressure value that is far lower than it's necessary, which is why it's giving you the mass flow in the wrong direction.
If you try not deriving the pressure level from the velocity field on this same patch, you should get better results.

In addition, if by any chance all patches have pressure boundary conditions, make sure you're properly defining the "pRef*" values in the "fvSolution" file.
wyldckat is offline   Reply With Quote

Old   October 11, 2014, 14:50
Default
  #13
New Member
 
Join Date: Mar 2014
Posts: 28
Rep Power: 12
knoedl1 is on a distinguished road
Hi Bruno,
thank you for your amazing quick reply!
Ok but how can I
Quote:
If you try not deriving the pressure level from the velocity field on this same patch, you should get better results.
do that?
i dont have any pref in my fsolution file
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM Extend Project: Open Source CFD        |
|  \\    /   O peration     | Version:  1.6-ext                               |
|   \\  /    A nd           | Web:      www.extend-project.de                 |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    rho
    {
        solver          diagonal;
    };

    p
    {
        solver          diagonal;
    };

    h
    {
        solver          diagonal;
    };
    
    U
    {
        solver          diagonal;
    };
}

multiStage
{
    RKCoeff 4(0.11 0.2766 0.5 1.0);
}

Riemann
{
    secondOrder yes;            // activate 2nd order extensions
    multidimLimiter yes;        // Switch between 1D and mutliD limiters
    epsilon "5";                // VK constant
    limiterName vanAlbadaSlope; // vanAlbadaSlope, MinmodSlope, vanLeerSlope
}

relaxationFactors
{
    // Note: under-relaxation factors used in wave-transmissive schemes
    k             0.2;
    omega         0.2;
}


fieldBounds
{
    // With bounding
    p      1e-6     1e6;
    rho    1e-6     1e6;
    e      1e-6     1e6;
    h      1e-6     1e6;
    rhoE   1e-6     1e6;
    T      1e-6    3000;
    U    1000;
}
// ************************************************************************* //
knoedl1 is offline   Reply With Quote

Old   October 11, 2014, 15:21
Default
  #14
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by knoedl1 View Post
thank you for your amazing quick reply!
You're welcome. I'm trying today to answer as many posts as I can, since my next time will likely only be next weekend... and that's if were lucky and I'm not too tired or busier than a bee

Quote:
Originally Posted by knoedl1 View Post
Ok but how can I do that?
Invent! Make up something! Test!
The objective is to isolate the error, and one of the ways to do this is to test the values. This is why a simple test case is so important, since that can help isolate the problem in more detail, giving you more control over the possible issue and quicker feedback from the test case, be it good or bad
Simply knowing if the problem is directly and only related to the "U" field, is more than enough to start studying what possibilities there are. Because from there you can check if it's a unit or scale problem; or if you can't simply use this groovyBC expression from the initial 0 time snapshot, and instead have to first use a fixed pressure value until convergence, and only then you can switch from fixed to groovyBC based calculation! In other words, only after the U field is more stable on this patch.


Quote:
Originally Posted by knoedl1 View Post
i dont have any pref in my fsolution file
Oh no, I completely forgot you were using transonicSteadyMultiDensityFoam, which is essentially an experimental solver.
It doesn't look like it was designed with this requirement in mind, namely to define a point with a reference pressure.
The example of what I'm referring to can be seen in the following locations:
But as I said, this is usually needed only if the solver uses it.... wait, I'm confusing things, sorry. This problem/requirement occurs only if only velocity based boundary conditions are used, i.e. if all inlets and outlets had "zeroGradient" in their respective pressure boundary conditions.
wyldckat is offline   Reply With Quote

Old   October 12, 2014, 05:13
Default
  #15
New Member
 
Join Date: Mar 2014
Posts: 28
Rep Power: 12
knoedl1 is on a distinguished road
Hi Bruno!

thank you very much for your detailed answer, i appreciate that!
Yes i know today is sunday, enough from working but maybe you are accidently even online today???

Quote:
or if you can't simply use this groovyBC expression from the initial 0 time snapshot, and instead have to first use a fixed pressure value until convergence, and only then you can switch from fixed to groovyBC based calculation!
That was also an idea to maybe fix the problem, i tried it with varying time BC in groovyBC. For example after time() < 100 loops do that ,else do that, but it also doesnt work. is there maybe an other way to switch from fixed value to groovyBC during runtime?
I mean at beginning in 0 file having a fixed value for pressure, waiting until loop e.g 10.000 and then just switching on the groovyBC?
I think thats impossible because groovyBC is only in the start file 0???!!!

greetings knoedl1
knoedl1 is offline   Reply With Quote

Old   October 12, 2014, 12:33
Default
  #16
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer: Study this thread and the explanations given there: http://www.cfd-online.com/Forums/ope...atch-wall.html
wyldckat is offline   Reply With Quote

Old   October 24, 2014, 10:54
Default
  #17
New Member
 
Join Date: Mar 2014
Posts: 28
Rep Power: 12
knoedl1 is on a distinguished road
It is working now, i put
Code:
fractionExpression    "-1";
into my groovyBC.
But that is for the case that my U internalField is (0 30 0)
but now i want to simulate with U internalField (0 0 0)
Evry time i start the simualtion I get a floating point exception BEFORE the first timestep.
Here is the error:

Code:
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 1.6-ext-7a3b2ae1a005
Exec   : transonicSteadyMultiDensityFoam
Date   : Oct 24 2014
Time   : 15:36:50
Host   : fttmpc60
PID    : 17033
Case   :/Gasturbine_1.6ext_relevanteErgebnisse/case28_SR
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading thermophysical properties

Selecting thermodynamics package hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>
Reading field rho

Reading field U

Reading/calculating face flux field phi

Creating turbulence model

Selecting turbulence model type RASModel
Selecting RAS turbulence model kOmegaSST


Selecting thermodynamics package hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>
Reading field rho

Reading field U

Reading/calculating face flux field phi

Creating turbulence model

Selecting turbulence model type RASModel
Selecting RAS turbulence model kOmegaSST
kOmegaSSTCoeffs
{
    Prt             0.85;
    alphaK1         0.85034;
    alphaK2         1;
    alphaOmega1     0.5;
    alphaOmega2     0.85616;
    gamma1          0.5532;
    gamma2          0.4403;
    beta1           0.075;
    beta2           0.0828;
    betaStar        0.09;
    a1              0.31;
    c1              10;
}

Create Riemann solver


    From function simpleFunctionObject::simpleFunctionObject
    in file simpleFunctionObject/simpleFunctionObject.C at line 109
    'outputControlMode' not found in inletMassFlow
Assuming: timeStep
--> FOAM Warning : 
    From function simpleFunctionObject::simpleFunctionObject
    in file simpleFunctionObject/simpleFunctionObject.C at line 117
    'outputInterval' not found in inletMassFlow
Assuming: 1
phi: phi
Compressible: 1
Turbulent: 1
LES: 0
--> FOAM Warning : 
    From function simpleFunctionObject::simpleFunctionObject
    in file simpleFunctionObject/simpleFunctionObject.C at line 109
    'outputControlMode' not found in outletMassFlow
Assuming: timeStep
--> FOAM Warning : 
    From function simpleFunctionObject::simpleFunctionObject
    in file simpleFunctionObject/simpleFunctionObject.C at line 117
    'outputInterval' not found in outletMassFlow
Assuming: 1
phi: phi
Compressible: 1
Turbulent: 1
LES: 0

  
[1]+  Gleitkomma-Ausnahme     (Speicherabzug geschrieben) transonicSteadyMultiDensityFoam > my.log
So why is he stopping for U (0 0 0) and with U(0 30 0) its working?
I also tried with less velocity (almost zero) like (0 0.001 0)!
knoedl1 is offline   Reply With Quote

Old   October 24, 2014, 10:57
Default
  #18
New Member
 
Join Date: Mar 2014
Posts: 28
Rep Power: 12
knoedl1 is on a distinguished road
or without calculating the massflow:

Code:
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0


    Prt             0.85;
    alphaK1         0.85034;
    alphaK2         1;
    alphaOmega1     0.5;
    alphaOmega2     0.85616;
    gamma1          0.5532;
    gamma2          0.4403;
    beta1           0.075;
    beta2           0.0828;
    betaStar        0.09;
    a1              0.31;
    c1              10;
}

Create Riemann solver

Create kappa

Create rhoU

Create rhoE

Create local time-step


Starting time loop


 Time = 1


    Prt             0.85;
    alphaK1         0.85034;
    alphaK2         1;
    alphaOmega1     0.5;
    alphaOmega2     0.85616;
    gamma1          0.5532;
    gamma2          0.4403;
    beta1           0.075;
    beta2           0.0828;
    betaStar        0.09;
    a1              0.31;
    c1              10;
}

Create Riemann solver

Create kappa

Create rhoU

Create rhoE

Create local time-step


Starting time loop


 Time = 1

[1]+  Gleitkomma-Ausnahme     (Speicherabzug geschrieben)
knoedl1 is offline   Reply With Quote

Old   January 25, 2015, 11:56
Default
  #19
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi knoedl1,

Sorry for the late reply, but only now was I able to come back to your questions.

After reviewing your description, the problem seems that there is a mathematical expression somewhere that is dividing by "U" or "mag(U)", which means that it would try to divide by zero.

OK, found it. It's this expression:
Code:
m/(A*(normal() & U))
Which will unravel to "m/0", which is why it crashes.
One simple fix is to initialize the field with some really small value, for example with U set to "(0 1e-8 0)".

Best regards,
Bruno
__________________
wyldckat 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
Floating Point Exception Error nyox FLUENT 11 November 30, 2018 12:31
a reconstructPar issue immortality OpenFOAM Post-Processing 8 June 16, 2013 11:25
an odd(at least for me!) reconstructPar error on a field immortality OpenFOAM Running, Solving & CFD 3 June 3, 2013 22:36
matching variable data with grid point data anfho OpenFOAM Programming & Development 0 May 6, 2011 15:28
"floating point exception" what does it mean? mhassani OpenFOAM Running, Solving & CFD 0 July 16, 2010 09:36


All times are GMT -4. The time now is 05:46.