CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   IOobject NO_READ error (http://www.cfd-online.com/Forums/openfoam/76415-ioobject-no_read-error.html)

snehal May 25, 2010 09:19

IOobject NO_READ error
 
hello everybody,
I am a new openfoam user and am trying to simulate vortex sheeding of a cylinder in cross flow.
I have modified my solver pisofoam to calculate Nusselt number. This is how I have defined the Nusselt no in create fields.h file of the solver
volScalarField Nusselt
(
IOobject
(
"Nusselt",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh
);
ofcourse i hav added the necessary eqns to the my_pisofoam.c file......the solver is compiled with no error at all. But once i run the case I get the following error:
--> FOAM FATAL ERROR:
NO_READ specified for read-constructor of object Nusselt of class IOobject

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 47.

FOAM aborting

#0 Foam::error::printStack(Foam::Ostream&) in "/home/stss5/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::error::abort() in "/home/stss5/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.so"
#2 Foam::regIOobject::readStream() in "/home/stss5/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.so"
#3 Foam::regIOobject::readStream(Foam::word const&) in "/home/stss5/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.so"
#4 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject const&, Foam::fvMesh const&) in "/home/stss5/OpenFOAM/OpenFOAM-1.6.x/applications/bin/linux64GccDPOpt/my_pisoFoam"
#5 main in "/home/stss5/OpenFOAM/OpenFOAM-1.6.x/applications/bin/linux64GccDPOpt/my_pisoFoam"
#6 __libc_start_main in "/lib64/libc.so.6"
#7 _start at /usr/src/packages/BUILD/glibc-2.10.1/csu/../sysdeps/x86_64/elf/start.S:116
Abgebrochen

Any help would be appreciated.
Thank you

nimasam May 25, 2010 11:13

why dont you use a fake initial condition for nusselt in zero folder? ,so you can change code into MUST READ , i guess it will work ofcourse its not perfect way :D

l_r_mcglashan May 25, 2010 11:32

If you specify NO_READ you have to provide an initial field for the variable:

Code:

volScalarField Nusselt
    (
        IOobject
        (
            "Nusselt",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        mesh,
        dimensionedScalar("Nusselt", dimless, scalar(0.0))
    );


snehal May 26, 2010 03:56

Thank you very much sir for your reply, it worked successfully...

snehal May 26, 2010 03:58

@nimasan
it does not work that way, I tried it out yesterday only....anyways thnks for your reply

T.D. October 13, 2010 10:30

hi
me too id did not work that way
it also tell me that must read from the /0 folder

l_r_mcglashan October 13, 2010 10:34

It does work.

What did you do? Show your code.

T.D. October 13, 2010 10:39

My Code
 
Hi this is my code:

volScalarField gammadot
(
IOobject
(
"gammadot",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("gammadot", dimless, scalar(0.0))
);
and when i run the solver:
it says FOAM FATAL IO ERROR:
cannot open file
...../0/gammadot

!!!

l_r_mcglashan October 13, 2010 10:47

It works for me.

Are you sure the error occurs at that point of your code?

T.D. October 13, 2010 10:53

hi
 
hi
really it's strange i don't know why it's not working at me.
Any way forget it, can you help me please in my at end of the following thread(link down), it is a major problem
and may be useful for every one please:

http://www.cfd-online.com/Forums/ope...ity-model.html


thanks a lot


All times are GMT -4. The time now is 17:40.