CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Problem with nonuniform boundary conditions (https://www.cfd-online.com/Forums/openfoam-pre-processing/62123-problem-nonuniform-boundary-conditions.html)

qtian July 23, 2007 13:11

Dear all, I am trying to s
 
Dear all,

I am trying to specify nonuniform boundary conditions at "inlet". For some reason, I am keep geting this error message when I try to access the 0/U file. Can anyone give me some help and advise? Thank you very much.

--> FOAM FATAL IO ERROR : attempt to read beyond EOF

file: /home/qtian/OpenFOAM/qtian-1.4/run/tutorials/simpleFoam//bump1/0/U::value at line 58.

From function ITstream::read(token& t)
in file db/IOstreams/Tstreams/ITread.C at line 70.

FOAM exiting

U file look like this,

internalField uniform (0 0 0);
boundaryField
{
Bottom
{
type fixedValue;
value uniform (0 0 0);
}

leftwall
{
type slip;
}

outlet
{
type zeroGradient;
}

rightwall
{
type slip;
}

inlet
{
type fixedValue;
value nonuniform; Line 58
}

top
{
type slip;
}
}

frackowi July 23, 2007 14:46

Hello, if you want to specify
 
Hello,
if you want to specify a non uniform boundary condition, you should specify the field values inside the 0/U file. In my case, I dealt with non uniform velocity fields (vector field) and temperature fields (scalar field) at a boundary called "goutte" (droplet in english)
Here are my 0/U and 0/T files as example. Good luck. Bruno
/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.4 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class volVectorField;
object U;
}

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

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

internalField uniform ( 15. 0. 0. );

boundaryField
{
inlet
{
type fixedValue;
value uniform ( 15. 0. 0. );
}
inlet1
{
type fixedValue;
value uniform ( 15. 0. 0. );
}
goutte
{
type fixedValue;
value nonuniform List<vector>
32
(
( 0.125901997 0.138911426 0. )
( 0.128139153 0.172775626 0. )
( 0.126960248 0.211820379 0. )
( 0.120514534 0.254806578 0. )
( 0.107431941 0.30025211 0. )
( 0.0867254138 0.346227229 0. )
( 0.0579536967 0.390691847 0. )
( 0.0212141946 0.431824267 0. )
( 0.138057172 0.00678228773 0. )
( 0.135565937 0.0201092884 0. )
( 0.131116718 0.0328430161 0. )
( 0.126068711 0.0451080948 0. )
( 0.121914245 0.0576611347 0. )
( 0.11977531 0.0717905611 0. )
( 0.120108962 0.0890788361 0. )
( 0.122550257 0.111073039 0. )
( -0.461236358 0.508895934 0. )
( -0.393406957 0.530447841 0. )
( -0.32478264 0.541867137 0. )
( -0.257232815 0.543873072 0. )
( -0.192155391 0.537038386 0. )
( -0.130680457 0.521705806 0. )
( -0.0739541948 0.498558581 0. )
( -0.0230022091 0.468220979 0. )
( -0.802104294 0.0394048579 0. )
( -0.788241446 0.116924562 0. )
( -0.764009297 0.191374391 0. )
( -0.73147279 0.261725157 0. )
( -0.690910041 0.326776087 0. )
( -0.642638564 0.385182768 0. )
( -0.587392509 0.435639977 0. )
( -0.526437223 0.477134943 0. )
);
}
outlet
{
type zeroGradient;
}
def1
{
type wedge;
}
def2
{
type wedge;
}
}
// ********************************************** //

/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.4 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class volScalarField;
object T;
}

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

dimensions [ 0 0 0 1 0 0 0 ];

internalField uniform 873.;

boundaryField
{
inlet
{
type fixedValue;
value uniform 873.;
}
inlet1
{
type fixedValue;
value uniform 873.;
}
goutte
{
type fixedValue;
value nonuniform List<scalar>
32
(
316.607025
317.104828
317.483337
317.741577
317.88974
317.944489
317.9245
317.849274
312.305328
312.442383
312.751709
313.243347
313.877991
314.591553
315.318268
316.003143
316.917969
316.997284
317.094482
317.207031
317.332245
317.467346
317.606018
317.737732
316.933899
316.903168
316.853973
316.808655
316.785156
316.787842
316.81308
316.856873
);
}
outlet
{
type zeroGradient;
}
def1
{
type wedge;
}
def2
{
type wedge;
}
}
// ********************************************** //

qtian July 25, 2007 15:30

Frackowiak, Thanks for your
 
Frackowiak,

Thanks for your help. It works right now.

QT

siemons.sk May 11, 2017 07:32

Expression for non uniform value?
 
Hi All,

I am looking for a method to update my partialSlip boundary condition from a uniform slip fraction to an expression (Maxwellian slip) in rhoSimpleFoam for OF 2.2.0. So currently I have in my U file:

wall
{
type partialSlip;
valueFraction uniform 0.01;
}

and want something like this

wall
{
type partialSlip;
valueFraction DynViscousity/Density*pow(PI/2*Density/Pressure,1/2);
}

Can I implement this within the U file? I am looking for a solution that does not involve compiling a new BC.

Thanks in advance!

Tomko January 12, 2018 15:03

Hi Bruno,

I am a new foamer. Can I ask how do you extract the vector list of your boundary "goutte" from face label?

Thank you very much!


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