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

help with velocity boundary condition potentialFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 30, 2012, 19:44
Default help with velocity boundary condition potentialFoam
  #1
hfc
New Member
 
Hon Fai Choi
Join Date: May 2012
Posts: 2
Rep Power: 0
hfc is on a distinguished road
Hi,

I am new to the forum and not a CFD specialist. I am interested in the potentialFoam solver of OpenFOAM because I want to solve the Poisson equation with given velocity boundary conditions. I am currently trying to apply the potentialFoam solver on a rectangular domain. I would like to define velocity boundary conditions on two opposing faces of the rectangle and zero gradient on the other two. I have set up the U and p input files as follow:

p input file:
-----------

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

internalField uniform 0;

boundaryField
{
inflow
{
type calculated;
}

outflow
{
type calculated;
}

side
{
type zeroGradient;
}

defaultFaces
{
type empty;
}
}


U input file:
-----------

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

internalField uniform (0 0 0);

boundaryField
{
inflow
{
type fixedValue;
value uniform (0.707 0.707 0);
}

outflow
{
type fixedValue;
value uniform (0.707 0.707 0);
}

side
{
type zeroGradient;
}

defaultFaces
{
type empty;
}
}

where 'inflow' and 'outflow' are the opposing faces with velocity BC. I tried to solve this case, but I get the following error:

FOAM FATAL ERROR:

gradientInternalCoeffs cannot be called for a calculatedFvPatchField on patch outflow of field p in file "/home/user/Projects/Foam/case/block_test1/0/p"
You are probably trying to solve for a field with a default boundary condition.

From function calculatedFvPatchField<Type>::gradientInternalCoef fs() const in file /opt/openfoam210/src/finiteVolume/lnInclude/calculatedFvPatchField.C at line 186.


I also tried setting the pressure boundary conditions on 'inflow' and 'outflow' to zeroGradient instead of calculated, which works, but the resulting velocity field is always perpendicular to these boundaries, even if the boundary velocities that I impose are not.

Does anybody have a suggestion to correct this? Maybe I am not using the right type of boundary conditions for the problem that I have in mind. If so, which other boundary condition should I use?


thanks,
Hon Fai
hfc is offline   Reply With Quote

Old   May 31, 2012, 10:17
Default
  #2
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 18
kmooney is on a distinguished road
Perhaps give this a try on the inflow and outflow patches. I don't have much experience with potentialFoam however. For most of the incompressible PISO solvers you need to have pressure defined somewhere to make the solution unique.

Code:
inflow
    {
        type zeroGradient;
    }

    outflow
    {
        type fixedValue;
value uniform 0;
    }
kmooney is offline   Reply With Quote

Old   May 31, 2012, 20:52
Default
  #3
hfc
New Member
 
Hon Fai Choi
Join Date: May 2012
Posts: 2
Rep Power: 0
hfc is on a distinguished road
Hi,

Thanks for the suggestion. I have tried what you suggested, but the output velocity does not match the boundary values that I input. The pressure distribution stays uniform across the 'inflow' boundary, and the velocities remain perpendicular to the boundary. From what I understand, the velocity is not explicitly solved for in potentialFoam, but only corrected with the calculated pressure. So perhaps I need to reformulate the Poisson equation in a mixed approach that explicitly solves for the velocity and the pressure? I haven't figured out yet how to do this.

thanks,
Hon Fai
hfc 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
Water subcooled boiling Attesz CFX 7 January 5, 2013 04:32
Robin boundary condition for the velocity fumiya OpenFOAM 4 June 17, 2011 03:58
velocity boundary condition Logan Page OpenFOAM 0 November 19, 2010 18:59
New topic on same subject - Flow around race car Tudor Miron CFX 15 April 2, 2004 07:18


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