CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Parabolic velocity profile in OpenFoam 1.6 (https://www.cfd-online.com/Forums/openfoam/75561-parabolic-velocity-profile-openfoam-1-6-a.html)

fsalvucci April 28, 2010 16:43

Parabolic velocity profile in OpenFoam 1.6
 
I have a problem with a customized 3D parabolic BC. I followed all the steps of the Sig Turbomachinery in wiki, but when i try to run the case, an error occurs. The write function is as follows:

void parabolicVelocityFvPatchVectorField::write(Ostream & os) const
{
fvPatchVectorField::write(os);
os.writeKeyword("maxValue")
<< maxValue_ << token::END_STATEMENT << nl;
os.writeKeyword("n")
<< n_ << token::END_STATEMENT << nl;
os.writeKeyword("y")
<< y_ << token::END_STATEMENT << nl;
os.writeKeyword("freq")
<< f_ << token::END_STATEMENT << nl;
os.writeKeyword("phi")
<< phi_ << token::END_STATEMENT << nl;
writeEntry("value", os);
}


In the 0/U files, i specify the boundary condition as:


inlet
{ type parabolicVelocity;
maxValue 0.452;
n (0 0 -1);
y (0 0 0);
freq 0;
phi 0;
}

And when i run the case, the following error occurs:

Cannot find 'value' entry on patch entrada of field U in file "./SmeriglioSilviaP/0/U"
which is required to set the values of the generic patch field.
(Actual type parabolicVelocity)
Please add the 'value' entry to the write function of the user-defined boundary-condition
or link the boundary-condition into libfoamUtil.so
file: ./SmeriglioSilviaP/0/U::boundaryField::entrada from line 35 to line 40.
From function genericFvPatchField<Type>::genericFvPatchField(con st fvPatch&, const Field<Type>&, const dictionary&)
in file fields/fvPatchFields/basic/generic/genericFvPatchField.C at line 72.

FOAM exiting

So, i add in 0/U an entry after phi:

value uniform (0 0 0);

As is sugested in wiki tutorial, and says:


FOAM FATAL ERROR:
gradientInternalCoeffs cannot be called for a genericFvPatchField (actual type parabolicVelocity)

on patch entrada of field U in file "./SmeriglioSilviaP/0/U"

You are probably trying to solve for a field with a generic boundary condition.
From function genericFvPatchField<Type>::gradientInternalCoeffs( ) const
in file fields/fvPatchFields/basic/generic/genericFvPatchField.C at line 782.
FOAM exiting



Any ideas? I need help!

chrisb July 14, 2010 00:22

Quote:

Originally Posted by fsalvucci (Post 256748)
I have a problem with a customized 3D parabolic BC. I followed all the steps of the Sig Turbomachinery in wiki, but when i try to run the case, an error occurs. The write function is as follows:

void parabolicVelocityFvPatchVectorField::write(Ostream & os) const
{
fvPatchVectorField::write(os);
os.writeKeyword("maxValue")
<< maxValue_ << token::END_STATEMENT << nl;
os.writeKeyword("n")
<< n_ << token::END_STATEMENT << nl;
os.writeKeyword("y")
<< y_ << token::END_STATEMENT << nl;
os.writeKeyword("freq")
<< f_ << token::END_STATEMENT << nl;
os.writeKeyword("phi")
<< phi_ << token::END_STATEMENT << nl;
writeEntry("value", os);
}


In the 0/U files, i specify the boundary condition as:


inlet
{ type parabolicVelocity;
maxValue 0.452;
n (0 0 -1);
y (0 0 0);
freq 0;
phi 0;
}

And when i run the case, the following error occurs:

Cannot find 'value' entry on patch entrada of field U in file "./SmeriglioSilviaP/0/U"
which is required to set the values of the generic patch field.
(Actual type parabolicVelocity)
Please add the 'value' entry to the write function of the user-defined boundary-condition
or link the boundary-condition into libfoamUtil.so
file: ./SmeriglioSilviaP/0/U::boundaryField::entrada from line 35 to line 40.
From function genericFvPatchField<Type>::genericFvPatchField(con st fvPatch&, const Field<Type>&, const dictionary&)
in file fields/fvPatchFields/basic/generic/genericFvPatchField.C at line 72.

FOAM exiting

So, i add in 0/U an entry after phi:

value uniform (0 0 0);

As is sugested in wiki tutorial, and says:


FOAM FATAL ERROR:
gradientInternalCoeffs cannot be called for a genericFvPatchField (actual type parabolicVelocity)

on patch entrada of field U in file "./SmeriglioSilviaP/0/U"

You are probably trying to solve for a field with a generic boundary condition.
From function genericFvPatchField<Type>::gradientInternalCoeffs( ) const
in file fields/fvPatchFields/basic/generic/genericFvPatchField.C at line 782.
FOAM exiting



Any ideas? I need help!

Hi,
I ran into a similar error generating a similar boundary condition. I gather you are using Hrv's parabolic velocity patch as a template. My problem was rectified by explicitly specifying the library path. It seemed like the library (despite being located within $FOAM_USER_LIBBIN) was not found.

Explicitly specifying the path removed the error.

CB

P.S. I know the thread is a little old, however, given I found a solution I thought a reply was worth while.

santiagomarquezd July 16, 2010 21:07

Chris, thanks for your answer I'm facing the same problem but with Tomasso Lucchini's rampedFixedValue BC. How do you explicitly specify the path? I tried to put it in the controlDict but it was useless...

Thanks in advance.

chrisb July 17, 2010 01:27

controlDict: explicit path
 
See attached in the code block. I don't know whether it was exactly what my problem was I had just run across something very similar literally an hr before.

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.6                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application    pisoFoam;

startFrom      latestTime;

startTime      0;

stopAt          endTime;

endTime        100;

deltaT          0.01;

writeControl    timeStep;

writeInterval  1;

purgeWrite      0;

writeFormat    binary;

writePrecision  6;

writeCompression uncompressed;

timeFormat      general;

timePrecision  6;

runTimeModifiable yes;

libs
(
    "/home/user/OpenFOAM/1.6/lib/linux64GccDPOpt/librectilinearBC.so"

);


santiagomarquezd July 17, 2010 19:29

Chris, thanks for your quick reply. I tried this way to set the path and it is correct. The problem finally was in another thing and I could manage it. I declared some methods in .H, but hadn't implemented them in .C. Solver had gave me a warning, but it was at the beginning of the output and I was only looking at the end in the FOAM FATAL ERROR. This fatal error was caused by the first one, something like:

--> FOAM Warning :
From function dlLibraryTable::open(const fileName& functionLibName)
in file db/dlLibraryTable/dlLibraryTable.C at line 79
could not load /home/d/OpenFOAM/d-1.5/lib/linux64GccDPDebug/libconvectiveOutlet.so: undefined symbol: _ZTIN4Foam5token8compoundE

Wrong implementation of methods generates misfunction in BCs.

Regards.


aevub September 14, 2012 09:27

Error when trying to use owm RampedFixedValue
 
Hi
I am trying to make a ramped BC as mentioned above (Tomasso Lucchini's rampedFixedValue BC).

It compiles, but when using it in the cavitycase I get this error:


Foam::error::printStack(Foam::Ostream&) in "/home/mvdtempe/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
Foam::sigSegv::sigHandler(int) in "/home/mvdtempe/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
Uninterpreted:
void Foam::dot<Foam::Vector<double>, Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>(Foam::GeometricField<Foam::inne rProduct<Foam::Vector<double>, Foam::Vector<double> >::type, Foam::fvsPatchField, Foam::surfaceMesh>&, Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh> const&) in "/home/mvdtempe/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/bin/icoFoam"

at icoFoam.C:0

in "/home/mvdtempe/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/bin/icoFoam"
__libc_start_main in "/lib/i386-linux-gnu/libc.so.6"
in "/home/mvdtempe/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/bin/icoFoam"
Segmentation fault (core dumped)


...?
I use 2.1.x

aevub September 16, 2012 13:49

found it: it was a pointer problem in my BC.C file.


All times are GMT -4. The time now is 14:27.