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

alphat

Register Blogs Community New Posts Updated Threads Search

Like Tree34Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 18, 2014, 05:08
Default alphat
  #1
Member
 
Join Date: Oct 2014
Posts: 42
Rep Power: 12
Wien3 is on a distinguished road
Good Morning,
I'm studying an OF model which consists on a cube which has a sphere inside. A fluid flows from inlet to outlet.
As it is incompressible, I think I have to assign the 4 walls like this:

type alphatWallFunction;
value uniform 0;


The problem is that it appears this error:

PHP Code:
file: /home/jstoeckl/Desktop/grav0/0/alphat.boundaryField.Back from line 26 to line 27.

    From 
function fvPatchField<Type>::New(const fvPatch&, const DimensionedField<TypevolMesh>&, const dictionary&)
    
in file /home/opencfd/OpenFOAM/OpenFOAM-2.3.0/src/finiteVolume/lnInclude/fvPatchFieldNew.C at line 143.

FOAM exiting 
I would really like to know how this parameter works. I think its value should be 0 in the solid parts (walls and sphere) and it has a different value in inlet and outlet From this I have my other doubts:
- How do I calculate this value for my incompressible fluid?
- How do I assign these 2 inputs? Should it be just with "fixedValue?


Thank you very much for your help
y_jiang and lpz456 like this.
Wien3 is offline   Reply With Quote

Old   November 18, 2014, 05:16
Default
  #2
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,

you've truncated meaningful part of the error message.

About the way alphat is calculated:

Code:
alphat = turbulence->nut()/Prt;
Value of turbulent Prantl number is in general randomly chosen between 0.75 and 0.95
Elham, y_jiang, Yage and 9 others like this.
alexeym is offline   Reply With Quote

Old   November 18, 2014, 05:36
Default
  #3
Member
 
Join Date: Oct 2014
Posts: 42
Rep Power: 12
Wien3 is on a distinguished road
Hi,
I will try to explain my doubts again:
1) Does an incompressible fluid need a Pr number?
2) With this kind of fluid, should I assign solid elements as "alphatWallFunction" or "alphatJayatillekeWallFunction"?
3) And with inlet and outlet, should I assign a "fixedValue" for them or just write "calculated"?? As they are not Walls, I cannot use the alphatFunctions I guess.

Currently my input of alphat is here:
Quote:
dimensions [0 2 -1 0 0 0 0];

internalField uniform 0;

boundaryField
{
Back
{
type alphatJayatillekeWallFunction;
Prt 0.85;
value uniform 0;
}
Bottom
{
type alphatJayatillekeWallFunction;
Prt 0.85;
value uniform 0;
}
Front
{
type alphatJayatillekeWallFunction;
Prt 0.85;
value uniform 0;
}
Icosphere
{
type alphatJayatillekeWallFunction;
Prt 0.85;
value uniform 0;
}
Inlet
{
type calculated;
value uniform 0;
}
Outlet
{
type calculated;
value uniform 0;
}
Top
{
type alphatJayatillekeWallFunction;
Prt 0.85;
value uniform 0;
}
}
I'm sorry if I didn't expose my doubts more clearly before.

Thank you again
febriyan91 likes this.
Wien3 is offline   Reply With Quote

Old   November 18, 2014, 05:47
Default
  #4
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,

Quote:
Originally Posted by Wien3 View Post
1) Does an incompressible fluid need a Pr number?
It's not fluid, it's solver who needs Prandtl number.

Quote:
2) With this kind of fluid, should I assign solid elements as "alphatWallFunction" or "alphatJayatillekeWallFunction"?
As you're simulating incompressible fluid (solver uses nut field, i.e. equations are divided by density), you won't be able to use alphatWallFunction (as it will looks for mut field). So it's "alphatJayatillekeWallFunction" (the only alphat wall function in incompressible turbulence models).

Quote:
3) And with inlet and outlet, should I assign a "fixedValue" for them or just write "calculated"?? As they are not Walls, I cannot use the alphatFunctions I guess.
"calculated" should be OK.
soheil_r7, Wien3, a_habib and 8 others like this.
alexeym is offline   Reply With Quote

Old   November 18, 2014, 05:58
Default
  #5
Member
 
Join Date: Oct 2014
Posts: 42
Rep Power: 12
Wien3 is on a distinguished road
Ok thank you very much! So I guess my file was well!

And another question: should I assign the "epsilon, omega, k and nut" in the same way? I mean that every inlet/outlet are "calculated uniform 0" and the walls are kqRWallFunction for k, epsilonWallFunction for epsilon and omegaWallFunction for omega, and nutWallFunction (everything with uniform 0).

Thanks!
Wien3 is offline   Reply With Quote

Old   November 18, 2014, 06:30
Default
  #6
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
Usually I use zero gradient outlet boundary conditions for turbulence. For inlet it's turbulentIntensityKineticEnergyInlet and similar patch types (see $FOAM_SRC/finiteVolume/fields/fvPatchFields/derived, $FOAM_SRC/turbulenceModels/incompressible/RAS/derivedFvPatchFields folders for names or you can use fixedValue estimated using http://www.cfd-online.com/Wiki/Turbu...ary_conditions). And for walls - yes - wall functions.
lpz456 likes this.
alexeym is offline   Reply With Quote

Old   November 18, 2014, 07:27
Default
  #7
Member
 
Join Date: Oct 2014
Posts: 42
Rep Power: 12
Wien3 is on a distinguished road
Hi,
your advice were really helpful! Now I understand quite better many things. I hope this post could be useful too for someone amateur in OF like me.

As it seems you control a lot this program, could you take a look to the post I wrote the last week in this same forum? The one which is called "pressure and velocity in inlet/outlet definitions".

Thank you really much
skanjosh and tankerp like this.
Wien3 is offline   Reply With Quote

Old   November 18, 2014, 08:35
Default
  #8
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
I've taken a look at your message but wasn't able to grasp what you're trying to simulate.
alexeym is offline   Reply With Quote

Old   November 18, 2014, 08:48
Default
  #9
Member
 
Join Date: Oct 2014
Posts: 42
Rep Power: 12
Wien3 is on a distinguished road
Well, I'll try to explain.
Corresponding to the model I have described in this forum (a cube with a sphere inside it and a fluid which cross it from inlet to outlet) I'm just trying to analyze the evolution of temperature and pressure in the different elements.
When I imported my model from enGrids, there were only p and U file, so I decided to create T file and change simpleFoam by buoyantBoussinesqSimpleFoam (as it is an incompressible fluid).
Obviously it is not enough to add this file, I had to do it with others, for example alphat, g, p_rgh, etc.
Everything worked fine until I analyse the p and p_rgh, and I notice two things:
- The first one is that when I click play it doesn't continue until my endTime (defined in controlDict) which is 1000. It does it just until 2, which is the numbers of iterations.
- The second one is it doesn't appear any heat transference, so temperature fields stay the same that at the beginning. That's why I need to know if my p and p_rgh (I think T and U are fine) are right or not for defining my model:

PHP Code:
p_rgh

dimensions      
[0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    
Back
    
{
        
type            fixedFluxPressure;
        
rho             rhok;
        
value           uniform 0;
    }
    
Bottom
    
{
        
type            fixedFluxPressure;
        
rho             rhok;
        
value           uniform 0;
    }
    
Front
    
{
        
type            fixedFluxPressure;
        
rho             rhok;
        
value           uniform 0;
    }
    
Icosphere
    
{
        
type            fixedFluxPressure;
        
rho             rhok;
        
value           uniform 0;
    }
    
Inlet
    
{
        
type            fixedFluxPressure;
        
rho             rhok;
        
value           uniform 0;
    }
    
Outlet
    
{
        
type            fixedFluxPressure;
        
rho             rhok;
        
value           uniform 0;
    }
    
Top
    
{
        
type            fixedFluxPressure;
        
rho             rhok;
        
value           uniform 0;
    }

PHP Code:
p
    Back
    
{
        
type zeroGradient;
    }
    
Bottom
    
{
        
type zeroGradient;
    }
    
Front
    
{
        
type zeroGradient;
    }
    
Icosphere
    
{
        
type zeroGradient;
    }
    
Inlet
    
{
        
type zeroGradient;
    }
    
Outlet
    
{
        
type  fixedValue;
        
value uniform 0;
    }
    
Top
    
{
        
type zeroGradient;
  }
    

PHP Code:
T

dimensions      
[0 0 0 1 0 0 0];

internalField   uniform 300;

boundaryField
{
    
Back
    
{
        
type            fixedValue;
        
value           uniform 300;
    }
    
Bottom
    
{
        
type            fixedValue;
        
value           uniform 300;
    }
    
Front
    
{
        
type            fixedValue;
        
value           uniform 300;
    }
    
Icosphere
    
{
        
type            fixedValue;
        
value           uniform 400;
    }
    
Inlet
    
{
        
type            fixedValue;
        
value           uniform 250;
    }
    
Outlet
    
{
        
type            zeroGradient;
    }
    
Top
    
{
        
type            fixedValue;
        
value           uniform 300;
    }

PHP Code:
U
dimensions      
[0 1 -1 0 0 0 0];

internalField   uniform (0 0 0);

boundaryField
{
    
Back
    
{
        
type  fixedValue;
        
value uniform (0 0 0);
    }
    
Bottom
    
{
        
type  fixedValue;
        
value uniform (0 0 0);
    }
    
Front
    
{
        
type  fixedValue;
        
value uniform (0 0 0);
    }
    
Icosphere
    
{
        
type  fixedValue;
        
value uniform (0 0 0);
    }
    
Inlet
    
{
        
type  fixedValue;
        
value uniform (0.535 0 0);
    }
    
Outlet
    
{
        
type zeroGradient;
    }
    
Top
    
{
        
type  fixedValue;
        
value uniform (0 0 0);
    }


I hope now my problem is better explained!

Thanks in advance
Wien3 is offline   Reply With Quote

Old   November 18, 2014, 10:20
Default
  #10
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
Still don't get what you're trying to do. p_rgh, U, T seem to be reasonable. Pressure (p) is calculated in the solver:

Code:
...
    volScalarField p
    (
        IOobject
        (
            "p",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        p_rgh + rhok*gh
    );
...
well, as your p_rhg needs reference (no BCs which fix value), so this code

Code:
    if (p_rgh.needReference())
    {
        p += dimensionedScalar
        (
            "p",
            p.dimensions(),
            pRefValue - getRefCellValue(p, pRefCell)
        );
        p_rgh = p - rhok*gh;
    }
will be also executed. But still solver won't read your p file from 0 folder.

This part is enigmatic:

Quote:
- The first one is that when I click play it doesn't continue until my endTime (defined in controlDict) which is 1000. It does it just until 2, which is the numbers of iterations.
- The second one is it doesn't appear any heat transference, so temperature fields stay the same that at the beginning.
Play? Where do you press play?

If you'd like to discuss you controlDict, fvSolution, and fvSchemes, post your files (and the output of simulation).
alexeym is offline   Reply With Quote

Old   November 18, 2014, 10:49
Default
  #11
Member
 
Join Date: Oct 2014
Posts: 42
Rep Power: 12
Wien3 is on a distinguished road
Hello!
Ok, so those files are fine. You tell that p file is calculated by the programme. Does it mean can I delete it from 0 file or just I have to write every element as uniform 0?

First of all, and to make the model easier, I input a gravity=0, in order to not to be influenced by this force. With the initial conditions mentioned above, it appears this message:

PHP Code:
--> FOAM FATAL ERROR
Continuity error cannot be removed by adjusting the outflow.
Please check the velocity boundary conditions and/or run potentialFoam to initialise the outflow.
Total flux              10.4374
Specified mass inflow   
2.14
Specified mass outflow  
0
Adjustable mass outflow 
0


    From 
function adjustPhi(surfaceScalarField&, const volVectorField&,volScalarField&)
    
in file cfdTools/general/adjustPhi/adjustPhi.C at line 118.

FOAM exiting 
To solve it, I have copied the folder, I changed "SIMPLE" by "potentialFlow" in fvSolutions and run potentialFoam to have initial values for the parameters. After that I copied the 0/U file in the main folder and run again with buoyantBoussinesqSimpleFoam.

I attach the controlDict, fvSolution, and fvSchemes files and also the images with the output of the simulation.

When I said "Pressed Play" I referred to the OpenFOAM, because asi you can see in the images the simulation stops at the 2° step (which is also the number of iterations). As you can see in Temperature picture it doesn't appear any heat transference.

I don't know which file is wrong =S

Thank you in advance

Last edited by Wien3; November 19, 2014 at 09:47.
Wien3 is offline   Reply With Quote

Old   November 18, 2014, 11:08
Default
  #12
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,

1. with this, rather relaxed convergence criterion

Code:
    residualControl
    {
        "(p|T|U|k|epsilon|omega)" 0.5; //*(7)
    }
it's possible that your simulation runs just for 2 iterations.

2. On your temperature screenshot values of BCs are shown (as you selected patches and not internalMesh). Your BCs are in fixedValue except outlet. So you get these fixed values on your screenshot. If you'd like to see temperature variations - select internalMesh, cut it with Clip filter.
alexeym is offline   Reply With Quote

Old   November 19, 2014, 05:16
Default
  #13
Member
 
Join Date: Oct 2014
Posts: 42
Rep Power: 12
Wien3 is on a distinguished road
Good Morning,
1) Concerning to p file, I have understood it doesn't matter its input because the solver will calculate this value but not from 0 folder. Anyway we cannot delete p from 0 file.

2) Related to reducing the tolerance, I can easily reduce it to 0.31 (which only takes 3 iterances) but if I reduce this value more it diverges (for example with 0.3).
So I guess the responsible of this it is not the tolerance...

3) And talking about your advice related to temperature, it is really useful, but the problem is that my theory about no complete simulation is confirmed. I attach pictures. In the first one you can see the BC temperatures and in the second one how the left part seems to have some heat transference (although it seems to be stopped) and how the sphere, which is 800 K, doesn't have any heat exchange.

Thank you

Last edited by Wien3; November 19, 2014 at 09:47.
Wien3 is offline   Reply With Quote

Old   November 19, 2014, 05:29
Default
  #14
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,

1. You can. Solver doesn't read p file in the beginning. It reads p_rgh file.

2. In general value of residuals should be below 1e-4.

3. Looking at the attached figure, it seems your simulation diverges. Maybe your posts lack some information? Can you post the case? (Surely I can reproduce it myself but it'll take more time).
alexeym is offline   Reply With Quote

Old   November 19, 2014, 06:49
Default
  #15
Member
 
Join Date: Oct 2014
Posts: 42
Rep Power: 12
Wien3 is on a distinguished road
Hello,
I attach my files. I have change the times in controlDict and it improved just a littel bit. As OF forums don't accept so big folders, I am able to post just 0 and systems files. It gives continuity problems, so after importing 0/U (run with potentialFoam) to the previous folder I can attach the the following pictures. Pay attention to the given values, in the case of pressure and velocity are enormous.

I don't know if everything you need is here. In other case please let me know and I will post it.

Last edited by Wien3; November 19, 2014 at 09:47.
Wien3 is offline   Reply With Quote

Old   November 19, 2014, 08:58
Default
  #16
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, without a mesh it's rather meaningless. Surely I can construct mesh and make the case running. But it'll be my mesh and you've got problems running case on your mesh. Post case with the mesh somewhere else, there are plenty of places where you can store large files.
alexeym is offline   Reply With Quote

Old   November 19, 2014, 10:33
Default
  #17
Member
 
Join Date: Oct 2014
Posts: 42
Rep Power: 12
Wien3 is on a distinguished road
Hello,
I found the way. Here I post two links: the first one is the model with the initial conditions and the second is the one which has the new 0/U file copied from the same case run with potentialFoam, as it gave continuity problems.

http://www.filedropper.com/test00

http://freakshare.com/files/th1rvk69/test01.zip.html
Wien3 is offline   Reply With Quote

Old   November 19, 2014, 12:39
Default
  #18
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,

not quite get why I need second archive but...

1. Get yourself new mesh. Really. The geometry is not so complicated.

2. About your configuration

2.1.

Code:
    residualControl
    {
        "(p|T|U|k|epsilon|omega)" 0.3; //*(7)
    }
should be something like

Code:
    residualControl
    {
        "(p_rgh|T|U|k|epsilon|omega)" 1e-2;
    }
2.2.

Code:
ddtSchemes
{
    default Euler;
}
should be

Code:
ddtSchemes
{
    default steadyState;
}
you're using

2.3.

Code:
gradSchemes
{
    default         Gauss linear;
    grad(p)         Gauss linear;
    grad(U)         Gauss linear;
}
should be

Code:
gradSchemes
{
    default         leastSquares;
}
2.4. For beginning change this

Code:
divSchemes
{
    default          none;
    div(phi,T)       Gauss linearUpwind Gauss; //*(16)
    div(phi,U)       Gauss linearUpwind Gauss;
    div(phi,k)       Gauss upwind;
    div(phi,epsilon) Gauss upwind;
    div(phi,omega)   Gauss upwind;
    div((nuEff*dev(T(grad(U))))) Gauss linear;  //*(6)
}
to

Code:
divSchemes
{
    default          none;
    div(phi,T)       bounded Gauss upwind;
    div(phi,U)       bounded Gauss upwind;
    div(phi,k)       bounded Gauss upwind;
    div(phi,epsilon) bounded Gauss upwind;
    div(phi,omega)  bounded Gauss upwind;
    div((nuEff*dev(T(grad(U))))) Gauss linear;  //*(6)
}
2.5. Set your "relTol"s to 0.01. Or 0.5 if you'd like to go with your "mesh".

2.6. Change solver for p_rgh to GAMG, this will speed up solution process.

3. How did you calculate Pr? It looks rather random.

Guess this is the time to wash my hands, you should read User guide at least.
alexeym is offline   Reply With Quote

Old   March 6, 2015, 10:27
Default
  #19
Member
 
Naresh Yathuru
Join Date: Feb 2015
Posts: 66
Rep Power: 11
Naresh yathuru is on a distinguished road
No words to thank you Alexey. you did a great contribution. i was trying to simulate a similar case, u almost cleared most of my doubts.
Respect..!!

Regards
Naresh
Naresh yathuru is offline   Reply With Quote

Old   May 20, 2019, 07:15
Default
  #20
Senior Member
 
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7
Raza Javed is on a distinguished road
Hello Everyone,


I am modeling a laminar fluid flow. But now I want to change my flow from Laminar to Turbulent.



I replaced my Turbulence properties and using kEpsilon Turbulence model.


But when I RUN the solver it gives the following error:


Selecting turbulence model type RAS
Selecting RAS turbulence model kEpsilon


Code:
--> FOAM FATAL IO ERROR: 
cannot find file

file: /home/openfoam/raza-4.1/run/circular_fluid/0/fluid/alphat at line 0.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 72.

FOAM exiting
This error is coming because my "0/fluid/" directory just has p,U,T,epsilon,k and p_rgh files. But I don't know how can I put alphat file in this directory.


Can someone please help me out in this?

I am using chtMultiRegionSimpleFoam and my OpenFoam version is 4.1.



Thank you

Last edited by Raza Javed; May 20, 2019 at 08:21.
Raza Javed 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
Alphat file in heat transfer case xiyuqiu OpenFOAM Running, Solving & CFD 1 June 8, 2017 18:39
mut and alphat & compressible flow sasanghomi OpenFOAM 2 September 17, 2013 15:42
an odd(at least for me!) reconstructPar error on a field immortality OpenFOAM Running, Solving & CFD 3 June 3, 2013 23:36
Where do I find the equation for alphat? ishihara OpenFOAM 1 July 30, 2012 04:23
turbulent jet simulation antonio_ing OpenFOAM Running, Solving & CFD 5 September 16, 2010 03:31


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