CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (http://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Error with timeVaryingUniformTotalPressure and timeVaryingUniformFixedValue patch (http://www.cfd-online.com/Forums/openfoam-bugs/66729-error-timevaryinguniformtotalpressure-timevaryinguniformfixedvalue-patch.html)

nishant_hull July 22, 2009 17:04

Error with timeVaryingUniformTotalPressure and timeVaryingUniformFixedValue patch
 
Hi forum

I am trying to implement the timeVaryingUniformTotalPressure boundary condition for the channel flow simulation in sonicFoam solver. I want to give a time varyingpressure condition at the inlet from the file inlet.dat. I havent used this BC before and I am having some problem in implementation. The solver failed to run with error message:

gradientInternalCoeffs cannot be called for a genericFvPatchField (actual type timeVaryingUniformTotalPressure)
on patch inlet of field p in file "/home/e343880/OpenFOAM/e343880-1.5/run/tutorials/sonicFoam/channel-sonic0-inletdat/0/p"
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 692.



The Make/options file in the solver reads:

EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude

EXE_LIBS = -lfiniteVolume

LATER ON, when I tried to recompile the folder:
/home/e343880/OpenFOAM/OpenFOAM-1.5/src/finiteVolume

then I noticed that there are some errors here. They are complaining about some error about undefined reference to the triSurface() function. I was wondering if this has something to do with the problem mentioned above?

Error reported is:

meshCutSurface.C:(.text+0x5b52): undefined reference to `Foam::triSurface::operator=(Foam::triSurface const&)'
meshCutSurface.C:(.text+0x5b68): undefined reference to `Foam::triSurface::~triSurface()'
meshCutSurface.C:(.text+0x5b76): undefined reference to `Foam::triSurface::~triSurface()'
meshCutSurface.C:(.text+0x5d5f): undefined reference to rientedSurface::~orientedSurface()]+0x24): undefined reference to
.
.
.
`Foam::triSurface::~triSurface()'
Make/linuxGccDPOpt/meshCutSurface.o: In function `Foam::meshCutSurface::~meshCutSurface()':
meshCutSurface.C.text._ZN4Foam14meshCutSurfaceD0Ev[Foam::meshCutSurface::~meshCutSurface()]+0x29): undefined reference to `Foam::triSurface::~triSurface()'
Make/linuxGccDPOpt/meshCutSurface.o: In function `Foam:rientedSurface::~orientedSurface()':
meshCutSurface.C
.text._ZN4Foam15orientedSurfaceD0Ev[Foam:rientedSurface::~orientedSurface()]+0x29): undefined reference to `Foam::triSurface::~triSurface()'
Make/linuxGccDPOpt/meshCutSurface.o.data.rel.ro._ZTVN4Foam14meshCutSu rfaceE[vtable for Foam::meshCutSurface]+0x10): undefined reference to `Foam::triSurface::movePoints(Foam::Field<Foam::Ve ctor<double> > const&)'
Make/linuxGccDPOpt/meshCutSurface.o.data.rel.ro._ZTIN4Foam14meshCutSu rfaceE[typeinfo for Foam::meshCutSurface]+0x8): undefined reference to `typeinfo for Foam::triSurface'
Make/linuxGccDPOpt/meshCutSurface.o.data.rel.ro._ZTVN4Foam15orientedS urfaceE[vtable for Foam:rientedSurface]+0x10): undefined reference to `Foam::triSurface::movePoints(Foam::Field<Foam::Ve ctor<double> > const&)'
Make/linuxGccDPOpt/meshCutSurface.o.data.rel.ro._ZTIN4Foam15orientedS urfaceE[typeinfo for Foam:rientedSurface]+0x8): undefined reference to `typeinfo for Foam::triSurface
collect2: ld returned 1 exit status
make: *** [OpenFOAM.out] Error 1


I think there is some bug in the timeVaryingUniformTotalPressure and timeVaryingUniformFixedValue.

regards,
Nishant

gschaider July 23, 2009 05:47

Quote:

Originally Posted by nishant_hull (Post 223697)
Hi forum

I am trying to implement the timeVaryingUniformTotalPressure boundary condition for the channel flow simulation in sonicFoam solver. I want to give a time varyingpressure condition at the inlet from the file inlet.dat. I havent used this BC before and I am having some problem in implementation. The solver failed to run with error message:

gradientInternalCoeffs cannot be called for a genericFvPatchField (actual type timeVaryingUniformTotalPressure)
on patch inlet of field p in file "/home/e343880/OpenFOAM/e343880-1.5/run/tutorials/sonicFoam/channel-sonic0-inletdat/0/p"
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 692.


Try in p

type timeVaryingTotalPressure;

instead (because that is the actual type-name specified in the source)

Quote:

Originally Posted by nishant_hull (Post 223697)
The Make/options file in the solver reads:

EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude

EXE_LIBS = -lfiniteVolume

LATER ON, when I tried to recompile the folder:
/home/e343880/OpenFOAM/OpenFOAM-1.5/src/finiteVolume

then I noticed that there are some errors here. They are complaining about some error about undefined reference to the triSurface() function. I was wondering if this has something to do with the problem mentioned above?

Error reported is:

meshCutSurface.C:(.text+0x5b52): undefined reference to `Foam::triSurface::operator=(Foam::triSurface const&)'
meshCutSurface.C:(.text+0x5b68): undefined reference to `Foam::triSurface::~triSurface()'
meshCutSurface.C:(.text+0x5b76): undefined reference to `Foam::triSurface::~triSurface()'
meshCutSurface.C:(.text+0x5d5f): undefined reference to rientedSurface::~orientedSurface()]+0x24): undefined reference to
.
.
.
`Foam::triSurface::~triSurface()'
Make/linuxGccDPOpt/meshCutSurface.o: In function `Foam::meshCutSurface::~meshCutSurface()':
meshCutSurface.C.text._ZN4Foam14meshCutSurfaceD0Ev[Foam::meshCutSurface::~meshCutSurface()]+0x29): undefined reference to `Foam::triSurface::~triSurface()'
Make/linuxGccDPOpt/meshCutSurface.o: In function `Foam:rientedSurface::~orientedSurface()':
meshCutSurface.C
.text._ZN4Foam15orientedSurfaceD0Ev[Foam:rientedSurface::~orientedSurface()]+0x29): undefined reference to `Foam::triSurface::~triSurface()'
Make/linuxGccDPOpt/meshCutSurface.o.data.rel.ro._ZTVN4Foam14meshCutSu rfaceE[vtable for Foam::meshCutSurface]+0x10): undefined reference to `Foam::triSurface::movePoints(Foam::Field<Foam::Ve ctor<double> > const&)'
Make/linuxGccDPOpt/meshCutSurface.o.data.rel.ro._ZTIN4Foam14meshCutSu rfaceE[typeinfo for Foam::meshCutSurface]+0x8): undefined reference to `typeinfo for Foam::triSurface'
Make/linuxGccDPOpt/meshCutSurface.o.data.rel.ro._ZTVN4Foam15orientedS urfaceE[vtable for Foam:rientedSurface]+0x10): undefined reference to `Foam::triSurface::movePoints(Foam::Field<Foam::Ve ctor<double> > const&)'
Make/linuxGccDPOpt/meshCutSurface.o.data.rel.ro._ZTIN4Foam15orientedS urfaceE[typeinfo for Foam:rientedSurface]+0x8): undefined reference to `typeinfo for Foam::triSurface
collect2: ld returned 1 exit status
make: *** [OpenFOAM.out] Error 1

I'm not quite sure what you're trying to compile here. Did you try to compile the finiteVolume-library with "wmake"? (that would explain the undefined references) It's a library and therefore should be compiled with "wmake libso"

Quote:

Originally Posted by nishant_hull (Post 223697)
I think there is some bug in the timeVaryingUniformTotalPressure and timeVaryingUniformFixedValue.

regards,
Nishant

My bet is: there isn't

nishant_hull July 24, 2009 12:50

is the format right?
 
Thanks for the help.
I would believe you here. However I can still see a folder in field folder with name timeVaryingUniformTotalPressure.
I have tried as you said. but I am still having some issue. Sorry for bothering you but it is still giving some problems. My p file is formatted as:

type timeVaryingTotalPressure;
p0 uniform 100000.5;
U U;
phi phi;
rho rho;
psi none;
gamma 1.4;
value uniform 100000.5;
timeDataFileName "inlet.dat";

where inlet.dat is the file from where I am reading the values. Is this the right format?

I have tried with other BCs like timeVaryingUniformFixedValue as well. and they didn't really work for sonicFoam. I am recompiling the finieVolume folder with "wmake libso" option now. I hope this should be ok.

But I am wondering why timeVaryingUniformFixedValue BC also didn't work?? That option used to work on 1.4.1 a few months ago. (since i was not working on BC from last few months!) However I can There is a folder in field folder with name timeVaryingUniformTotalPressure.

regards,

Nishant

nishant_hull July 26, 2009 16:09

I even tried totalPressureTimeSeries. and I come across that even that option didn't work. I cant really figure out what is going wrong.

If you want my case file then i can provide it to you.

regards,

Nishant

nishant_hull July 26, 2009 16:46

I am trying this BC with sonicFoam solver. I was wondering if the option of trying this solver with

rho rho;
psi none;

in timeVaryingUniformTotalPressure is ok or not??

regards

Nishant

nishant_hull July 26, 2009 18:43

correct format
 
Hi

I manage to find the right format. It has changed a lot from the 1.4.1 version.
The correct format is:

type timeVaryingTotalPressure;
p0 100000.5;
U U;
phi phi;
rho rho;
psi none;
gamma 1.4;
value uniform 100000.5;
outOfBounds clamps;
fileName "inlet.dat";


Can anyone put some light on outOfBounds type?
Other way could be to see the /lnInclude/interpolationTable.C file.

regards,
Nishant

olesen July 27, 2009 06:17

Quote:

Originally Posted by nishant_hull (Post 224186)
Can anyone put some light on outOfBounds type?

Sure, the code needs to know how to handle cases where you've requested an interpolation time that is out-of-bounds (ie, which is not covered by your table). It can be an error. It can clamp to the upper/lower limits, with or without issuing a warning. Or it can repeat the table (ie, wrap around to the starting time) - this last one would be useful for example with engine data that is from 0-720 deg crank-angle, but repeats again for further engine cycles.

nishant_hull July 27, 2009 10:17

Quote:

Originally Posted by olesen (Post 224240)
Sure, the code needs to know how to handle cases where you've requested an interpolation time that is out-of-bounds (ie, which is not covered by your table). It can be an error. It can clamp to the upper/lower limits, with or without issuing a warning. Or it can repeat the table (ie, wrap around to the starting time) - this last one would be useful for example with engine data that is from 0-720 deg crank-angle, but repeats again for further engine cycles.

Hi olesen,

thanks for the comment. I have few question to ask though.

1) How would the keyword clamp decide about the upper or lower limit? Do they clam keyword take the last in the table value as the clamping point?

2)How would repeat actually repeat the table. For example, i have a table

time pressure
0.2 1000000
0.4 1000000.2
0.6 1000000.4
.
.
1.4 1000001.4

If my simulation is starting from 0 and crosses the time 1.4 then wot will be the next value it will take? will it take the value of time at 0.2 sec for the time 1.6???


regards,

Nishant

olesen July 27, 2009 10:39

Quote:

Originally Posted by nishant_hull (Post 224282)
thanks for the comment. I have few question to ask though.

It is much faster if you just take a look at the source src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C - this should quickly answer all of your questions.

BTW: I just noticed that you filed this under 'bugs', but it doesn't seem to be a bug report at all.


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