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

Running a test

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 13, 2020, 15:07
Default Running a test
  #1
New Member
 
Ra Miro
Join Date: Aug 2020
Posts: 21
Rep Power: 6
ramrebol is on a distinguished road
Hello.



I executed some tutorials, and now I try to run my own test. I have tried to understand why it does not run, but I can't understand it. It is a fluid (Navier-Stokes) in a curved tube. There are "inlet", "outlet" and "walls" faces. I made the mesh in salome. I'm trying to use icoFoam.


I tryied to use OpenFoam 8 and foam-extend 4.0 and 4.1 versions. Are there differences when implementing the same example in these differents OpenFoam versions?

I'm new in OpenFoam world, and I'm trying my best to learn how to use it.


Modifying somethings appears different errors, that's why I think could be easier to detect the error sharing my codes with you to understand where is the error.



https://www.dropbox.com/s/hvys04778v...tpipe.zip?dl=0


Thanks in advance.
ramrebol is offline   Reply With Quote

Old   September 14, 2020, 08:53
Default
  #2
Member
 
Petros Ampatzidis
Join Date: Oct 2018
Location: Bath, UK
Posts: 64
Rep Power: 8
petros is on a distinguished road
Hi,

First things first, please try to provide to the community a snippet of the errors that you get using the code tags. Usually, errors are self-explanatoty, especially in the beginning of your OpenFOAM experience. Also, as a beginner do not try to build a case from scratch. Instead, use the tutorials that come with every OpenFOAM branch that you wish to use.

From a quick look at your case:
  • The 0 folder should be placed outside of the constant folder.
  • The type of your boundaries in the boundary file should be the same with the ones used in the 0 directory.
  • When you set velocity inlet you must let the flow exit the domain so fix the pressure at the outlet.

I suspect that you tried to follow the cavity case but you didn't notice that the boundaries are walls and not patches as in your case.

I hope that the above info will help getting you started.

Best,
Petros
petros is offline   Reply With Quote

Old   September 16, 2020, 01:10
Default
  #3
New Member
 
Ra Miro
Join Date: Aug 2020
Posts: 21
Rep Power: 6
ramrebol is on a distinguished road
Thanks petros, you are right, the files were in wrong place, and also I'm editing the cavity example for my problem. Since I'm new in the OpenFoam world, I really appreciate your support.

Now I'm running a simpler test as before: a straight cylinder example with circular base (without using any symmetry).


1. I read that icoFoam is just for laminar fluid, Can I use it for transient or turbulent fluid? My question is, icoFoam solves the following Navier--Stokes equations or I must to be careful with some assumption?


u_t-\nu\Delta u+(\nabla u)u+\nabla p=f in \Omega
\nabla\cdot u=0 in \Omega
(plus boundary conditions)



2. I separated the non-interior faces in three groups: "inlet", "outlet" and "walls" ("walls" are the non-interior faces that are not inlet nor outlet). For the outlet I want to impose Neumann boundary condition, that I know are


-(\nu\nabla u+p)n=0


This is the typical Neumann boundary condition that appears in Finite Element method, and may be here, as OpenFoam uses Finite Volume Method, is not the same. As I not see how to implement this boundary condition in the tutorials, I would like to be sure that I'm doing it right. The data in my input files are:



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

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

internalField   uniform 0;

boundaryField
{
  inlet
    {
      type   fixedValue;
      value  uniform 0.02;
    }
  
  outlet
    {
      type   fixedValue;
      value  uniform 0.0;
    }
  
  walls
    {
      type   zeroGradient;
    }
}

// ************************************************************************* //
0/u
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  8
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform (0 0 0);

boundaryField
{
  inlet
    {
      type    pressureInletVelocity;
      value   uniform (0 0 0);
    }

    outlet
    {
      type    zeroGradient;
    }

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

// ************************************************************************* //

3. I'm trying to implement a Poiseuille flow. Do you think I did well?
p_{\textrm{inlet}}=20 and p_{\textrm{outlet}}=0.
ramrebol is offline   Reply With Quote

Old   September 16, 2020, 14:00
Default
  #4
Member
 
Petros Ampatzidis
Join Date: Oct 2018
Location: Bath, UK
Posts: 64
Rep Power: 8
petros is on a distinguished road
1. icoFoam is for incompressible, laminar and transient flows of Newtonian fluids so it doesn't handle turbulence.

2. The Neumann boundary condition is a fixedGradient. As for your case, you have correctly chosen the fixedValue BC, which is a Dirichlet BC.

Just to remind you that the Neumann BC in OpenFOAM is:

\phi_f = \phi_c+\Delta\nabla \phi

where \Delta is the face-to-cell distance.

3. In incompressible solvers the pressure is the kinematic pressure measured in m^2/s^2 because we devide by the density. Your values are correct only if your fluid is water with an assumed density of 1000 kg/m^3.

Best,
Petros
petros is offline   Reply With Quote

Old   September 17, 2020, 13:34
Default
  #5
New Member
 
Ra Miro
Join Date: Aug 2020
Posts: 21
Rep Power: 6
ramrebol is on a distinguished road
Thank you very much. I hope not to abuse your patience to continue clarifying certain doubts.

1. Thanks !
3. Yes it is, I'm running tests where I can compare known solutions to understand how OpenFoam works.


2. About Neumann boundary conditions, I come from the "Finite Elements" world, where the Neumann boundary condition are:

-(\nu\nabla u+p)n=0

I don't know if it is an abuse to ask you to explain (or send me a link) to learn how this relates to OpenFoam's implementation of Neumann conditions, I mean, the numerical algorithm inside. If you think it is too much (or require an answer to long), you may not aswer this question.


I have some little questions too:


Question A:
--------------------------------------------
For the pressure:

inlet
{
type fixedValue;
value uniform 0.02;
}


For me this is ok, because we have impose a fixed value for the inflow pressure


But, for the velocity

inlet
{
type pressureInletVelocity;
value uniform (0 0 0);
}


What the "value uniform (0 0 0 );" means? I'm fixing the inlet velocity value to cero? Is this ok?

Furthermore, for the velocity:

outlet
{
type zeroGradient;
}

--------------------------------------------

I suppose that the "zeroGradient" for the outlet velocity is related with the Neumann boundary condition.

If -(\nu\nabla u+p)n=0 is the Neumann boundary condition, \nabla u n=0 because we are supposing that the fluid is fully development?



--------------------------------------------

Question B:

For me, it is natural to impose velocity equal to zero in the walls, but, why we can (or must) impose the "zeroGradient" for the pressure?

walls
{
type zeroGradient;
}
ramrebol is offline   Reply With Quote

Old   September 18, 2020, 16:07
Default
  #6
Member
 
Petros Ampatzidis
Join Date: Oct 2018
Location: Bath, UK
Posts: 64
Rep Power: 8
petros is on a distinguished road
The implementation of the Neumann boundary condition in OpenFOAM can be found here. You may also want to have a look at the respective source code here.

Quote:
Originally Posted by ramrebol View Post

What the "value uniform (0 0 0 );" means? I'm fixing the inlet velocity value to cero? Is this ok?
This value is just an initial value needed by the solver to start the iteration.


Quote:
Originally Posted by ramrebol View Post

I suppose that the "zeroGradient" for the outlet velocity is related with the Neumann boundary condition.

If -(\nu\nabla u+p)n=0 is the Neumann boundary condition, \nabla u n=0 because we are supposing that the fluid is fully development?
The zeroGradient is a Neumann boundary condition. Try to think in terms of finite volume and how OpenFOAM treats the boundaries. The Neumann boundary condition is the way that we calculate the patch values from the adjacent cell centres. And yes, you can say that a fully developed flow implies zeroGradient for your flow variables at the outlet, but also for your case relates to the fact that you have fixed the pressure at the inlet.

Quote:
Originally Posted by ramrebol View Post

Question B:

For me, it is natural to impose velocity equal to zero in the walls, but, why we can (or must) impose the "zeroGradient" for the pressure?
Yes this is the common practice. But don't be confused, zeroGradient does not mean that we fix the value at the boundary. This is actually an interesting topic and you can learn more by some discussion elsewhere, e.g. here and here.

I hope my comments were helpful.

Best,
Petros
petros is offline   Reply With Quote

Old   September 22, 2020, 00:30
Default
  #7
New Member
 
Ra Miro
Join Date: Aug 2020
Posts: 21
Rep Power: 6
ramrebol is on a distinguished road
Thanks petros for your huge patience. I'm analyzing your answer.
I feel that I have a lot to learn about the software, and your guidance is very useful.
ramrebol is offline   Reply With Quote

Reply

Tags
foam-extend 4.0, navier stokes equations, pipe flow


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
Error problem while running sadia d lts tutorial kane OpenFOAM Running, Solving & CFD 2 May 26, 2018 04:38
XiFoam Non reactive test case Stefano Puggelli OpenFOAM Running, Solving & CFD 1 July 9, 2015 03:24
A new test harness for OpenFOAM mbeaudoin OpenFOAM Announcements from Other Sources 0 June 17, 2010 11:36
critical error during installation of openfoam Fabio88 OpenFOAM Installation 21 June 2, 2010 04:01
Running test nt31921a OpenFOAM Installation 2 May 9, 2010 00:48


All times are GMT -4. The time now is 16:15.