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

gradientInternalCoeffs cannot be called for a calculatedFvPatchField

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 28, 2012, 05:27
Default gradientInternalCoeffs cannot be called for a calculatedFvPatchField
  #1
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
hi everybody,

I defined a new solver that solve natural convection in a viscoelastic Fluid. it made successfully, but when I want to run my model the following error was appeared:

Code:
--> FOAM FATAL ERROR:

     gradientInternalCoeffs cannot be called for a calculatedFvPatchField
     on patch floor of field p in file "/home/mostafa/OpenFOAM/mostafa-2.1.0/run/tutorials/viscoelastic/viscoelasticFluidFoam/Hasan_Giesekus/0/p"
     You are probably trying to solve for a field with a default boundary condition.
     From function calculatedFvPatchField<Type>::gradientInternalCoeffs() const
     in file fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C at line 186.

  FOAM exiting
do anybody know where is the problem?

Thanks
Kummi likes this.
adambarfi is offline   Reply With Quote

Old   September 28, 2012, 15:01
Default
  #2
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
DEAR mostafa
could you post your p file here?
nimasam is offline   Reply With Quote

Old   September 28, 2012, 16:08
Default
  #3
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
the attachment contains the p, fvSolution and fvSchemes files.
I changed the floor boundary condition and even delete the p file but this problem didn't had been solve. I think the problem is somewhere in the fvSolution or fvSchemes.
Attached Files
File Type: gz attachment.tar.gz (1.4 KB, 116 views)
adambarfi is offline   Reply With Quote

Old   September 28, 2012, 17:37
Default
  #4
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
this solver reads p or p-rgh ?
it seems it reads p, if it reads p! then you should define BC for p, you can not use calculated BC, you should use (fixedValue or fixedGradient) for it
vs1 and Teresa Sun like this.
nimasam is offline   Reply With Quote

Old   September 28, 2012, 23:36
Default
  #5
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
Quote:
Originally Posted by nimasam View Post
this solver reads p or p-rgh ?
it seems it reads p, if it reads p! then you should define BC for p, you can not use calculated BC, you should use (fixedValue or fixedGradient) for it
It reads p and calculate the p-rgh, such as bouyantbuossinesqsimplefoam. I change the bc to fixedValue and fixedGradient but this this error didn't had been omit.
adambarfi is offline   Reply With Quote

Old   September 29, 2012, 02:57
Default
  #6
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
Dear mostafa let me ask another questions, which version of openfoam do you use?
could you run this test case before heat transfer implementation?
put the test case and solver here, then may other can help you
nimasam is offline   Reply With Quote

Old   September 29, 2012, 05:42
Default
  #7
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 17
ata is on a distinguished road
Hi
Did you set p equal to another field in your solver during calculations? i.g.
p=....?
ata is offline   Reply With Quote

Old   September 29, 2012, 06:09
Default
  #8
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
this is where I use the p in createFields.H:
Code:
    Info<< "Calculating field g.h\n" << endl;
    volScalarField gh("gh", g & mesh.C());
    surfaceScalarField ghf("ghf", g & mesh.Cf());

    volScalarField p
    (
        IOobject
        (
            "p",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        p_rgh + rhok*gh
    );

    label pRefCell = 0;
    scalar pRefValue = 0.0;
    setRefCell(p,p_rgh, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);


    if (p_rgh.needReference())
    {
        p += dimensionedScalar
        (
            "p",
            p.dimensions(),
            pRefValue - getRefCellValue(p, pRefCell)
        );
    }
and in pEqn:

Code:
    p = p_rgh + rhok*gh;

    if (p_rgh.needReference())
    {
        p += dimensionedScalar
        (
            "p",
            p.dimensions(),
            pRefValue - getRefCellValue(p, pRefCell)
        );
        p_rgh = p - rhok*gh;
    }
what is wrong in my code?
adambarfi is offline   Reply With Quote

Old   September 29, 2012, 06:33
Default
  #9
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 17
ata is on a distinguished road
Hi
I think you have two options two solve the problem. Selection is your choice:
1:
volScalarField p ( IOobject ( "p", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh );
or
2:
p == p_rgh + rhok*gh;
Teresa Sun likes this.
ata is offline   Reply With Quote

Old   September 29, 2012, 07:21
Default
  #10
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
Dear Ata
I applied what you offered me and what Nima said, that error was solved. but after some iterations (50) the following error appeared:
Code:
#0  Foam::error::printStack(Foam::Ostream&) in "/home/mostafa/OpenFOAM/OpenFOAM-2.1.0/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigFpe::sigHandler(int) in "/home/mostafa/OpenFOAM/OpenFOAM-2.1.0/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2  Uninterpreted: 
#3  Foam::PBiCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/home/mostafa/OpenFOAM/OpenFOAM-2.1.0/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#4  Foam::fvMatrix<Foam::SymmTensor<double> >::solve(Foam::dictionary const&) in "/home/mostafa/OpenFOAM/OpenFOAM-2.1.0/platforms/linuxGccDPOpt/lib/libviscoelasticTransportModels.so"
#5  Foam::fvMatrix<Foam::SymmTensor<double> >::solve() in "/home/mostafa/OpenFOAM/OpenFOAM-2.1.0/platforms/linuxGccDPOpt/lib/libviscoelasticTransportModels.so"
#6  Foam::Giesekus::correct() in "/home/mostafa/OpenFOAM/OpenFOAM-2.1.0/platforms/linuxGccDPOpt/lib/libviscoelasticTransportModels.so"
#7  Foam::multiMode::correct() in "/home/mostafa/OpenFOAM/OpenFOAM-2.1.0/platforms/linuxGccDPOpt/lib/libviscoelasticTransportModels.so"
#8  Foam::viscoelasticModel::correct() in "/home/mostafa/OpenFOAM/OpenFOAM-2.1.0/platforms/linuxGccDPOpt/lib/libviscoelasticTransportModels.so"
#9  
 in "/home/mostafa/OpenFOAM/OpenFOAM-2.1.0/platforms/linuxGccDPOpt/bin/BuoyantBoussinesqViscoelasticFluidFoam"
#10  __libc_start_main in "/lib/i386-linux-gnu/libc.so.6"
#11  
 in "/home/mostafa/OpenFOAM/OpenFOAM-2.1.0/platforms/linuxGccDPOpt/bin/BuoyantBoussinesqViscoelasticFluidFoam"
Floating point exception
what is your opinion about this error?

again thank you so much
adambarfi is offline   Reply With Quote

Old   September 29, 2012, 15:21
Default
  #11
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
it seems somewhere in your code something divide on zero or going to result indefinite value
nimasam is offline   Reply With Quote

Old   February 23, 2013, 01:34
Default Dear adambarfi,
  #12
Senior Member
 
T. Chourushi
Join Date: Jul 2009
Posts: 321
Blog Entries: 1
Rep Power: 17
Tushar@cfd is on a distinguished road
Are you able to resolve your error?
Tushar@cfd is offline   Reply With Quote

Old   February 23, 2013, 01:44
Default
  #13
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
Quote:
Originally Posted by Tushar@cfd View Post
Are you able to resolve your error?
Dear Tushar,
yes, after some day hard working, finally I could solve it.
adambarfi is offline   Reply With Quote

Old   November 11, 2013, 02:06
Default
  #14
New Member
 
sasan
Join Date: Sep 2013
Posts: 28
Rep Power: 12
Sasy is on a distinguished road
Quote:
Originally Posted by adambarfi View Post
Dear Tushar,
yes, after some day hard working, finally I could solve it.
Dear Mostafa
how do you solved this problem?? I have some problem like this,but my problem dont solve by ata or nima offers...
I use interPhasechangeFoam solver and modified this solver for my simulation...
you can see my creatFields and Peqn
Attached Files
File Type: h createFields.H (3.3 KB, 61 views)
File Type: h pEqn.H (1.4 KB, 48 views)
Sasy is offline   Reply With Quote

Old   November 12, 2013, 00:46
Default
  #15
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
hi Sasan,

I get your attached files and I couldn't find any thing that made error!

so, attach your log file + the errors expression
adambarfi is offline   Reply With Quote

Old   November 12, 2013, 03:18
Default
  #16
New Member
 
sasan
Join Date: Sep 2013
Posts: 28
Rep Power: 12
Sasy is on a distinguished road
Quote:
Originally Posted by adambarfi View Post
hi Sasan,

I get your attached files and I couldn't find any thing that made error!

so, attach your log file + the errors expression
Hi Mostafa
Thank you for reply..
my error:
FOAM FATAL ERROR:

gradientInternalCoeffs cannot be called for a calculatedFvPatchField
on patch left of field p in file "/home/Sasan/Desktop/HardtMix/stephanProblem/0/p"
You are probably trying to solve for a field with a default boundary condition.
and attach the log file
Attached Files
File Type: gz log.tar.gz (1.1 KB, 32 views)
Sasy is offline   Reply With Quote

Old   November 12, 2013, 07:10
Default
  #17
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
You have to specify correct boundary conditions for p otherwise you cannot solve the pEqn!

The error message gave you already a hint what you have to do:
Code:
on patch left of field p in file "/home/Sasan/Desktop/HardtMix/stephanProblem/0/p"
    You are probably trying to solve for a field with a default boundary condition.
so, you are using a wrong BC for pEqn. I guess you used calculated type!
try other boundary conditions that are compatible with your solution.
vs1 likes this.
adambarfi is offline   Reply With Quote

Old   November 13, 2013, 02:03
Default
  #18
New Member
 
sasan
Join Date: Sep 2013
Posts: 28
Rep Power: 12
Sasy is on a distinguished road
Quote:
Originally Posted by adambarfi View Post
You have to specify correct boundary conditions for p otherwise you cannot solve the pEqn!

The error message gave you already a hint what you have to do:
Code:
on patch left of field p in file "/home/Sasan/Desktop/HardtMix/stephanProblem/0/p"
    You are probably trying to solve for a field with a default boundary condition.
so, you are using a wrong BC for pEqn. I guess you used calculated type!
try other boundary conditions that are compatible with your solution.
Hi Mostafa
I used this test case with another solver and dont have problem,But for new solver,I have this problem.
my BC is not calculated....!!
you can see:
Sasy is offline   Reply With Quote

Old   November 13, 2013, 02:04
Default
  #19
New Member
 
sasan
Join Date: Sep 2013
Posts: 28
Rep Power: 12
Sasy is on a distinguished road
Quote:
Originally Posted by Sasy View Post
Hi Mostafa
I used this test case with another solver and dont have problem,But for new solver,I have this problem.
my BC is not calculated....!!
you can see:
sorry.I forgot attach my file...
Attached Files
File Type: gz stephan.tar.gz (20.2 KB, 27 views)
Sasy is offline   Reply With Quote

Old   November 13, 2013, 03:07
Default
  #20
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
mhmm, I think there are problems with p BCs.
the userGuide says:

Quote:
At all wall boundaries, the buoyantPressure boundary condition is applied to the pressure
field, which calculates the normal gradient from the local density gradient.

buoyantPressure: Sets fixedGradient pressure based on the atmospheric pressure gradient
I think such same BCs for p and p_rgh is wrong, let the solver calculate the pressure based upon potential function. try "calculated" type for p BCs.

Also, I can't understand these conditions you used for p_rgh:
Code:
        type            buoyantPressure;
        gradient        uniform 0;
        value           uniform 0;
try this one:
Code:
        type            buoyantPressure;
        rho             rhok;
        value           uniform 0;
see the buoyantBoussinesqPimpleFoam and buoyantBoussinesqSimpleFoam solvers. they have tips that may help you.
adambarfi 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
How is the turbulence model called in openfoam? hz283 OpenFOAM 3 May 4, 2017 21:20
terminate called after throwing an instance of 'int' b614910 SU2 10 July 27, 2014 22:16
word::stripInvalid() called for word r error immortality OpenFOAM Running, Solving & CFD 4 May 12, 2013 06:03
understanding how turbulence models are called romant OpenFOAM Programming & Development 0 March 21, 2012 09:22
reconstructParMesh not working with an axisymetric case francesco OpenFOAM Bugs 4 May 8, 2009 05:49


All times are GMT -4. The time now is 16:09.