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   November 13, 2013, 05:11
Default
  #21
New Member
 
Nazanin
Join Date: Sep 2013
Posts: 22
Rep Power: 13
Nazanin is on a distinguished road
I send for you
Nazanin is offline   Reply With Quote

Old   November 13, 2013, 05:28
Default
  #22
New Member
 
sasan
Join Date: Sep 2013
Posts: 28
Rep Power: 13
Sasy is on a distinguished road
Quote:
Originally Posted by adambarfi View Post
mhmm, I think there are problems with p BCs.
the userGuide says:

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.
Hi
I try this BCs,but the problem is still.
first I try this boundary condition:
type buoyantPressure;
value uniform 0;
and This
type zeroGradient;
but no answer...
NOTE:my case is 1D and I think should use this BCs
Regards,
Sasy is offline   Reply With Quote

Old   March 27, 2014, 16:59
Default
  #23
Member
 
Lucas Mutti
Join Date: Aug 2013
Posts: 47
Rep Power: 14
lramutti is on a distinguished road
Hey guys, I am ran into something similar for a conjugate heat transfer problem. In my case it says:

--> FOAM FATAL ERROR:

gradientInternalCoeffs cannot be called for a calculatedFvPatchField
on patch leftWall of field h in file "/home/meisu/OpenFOAM/meisu-2.2.1/run/Research/ConjugateHeatTransfer/RayleighBenard/caseFourDomeFourWalls/0/leftWall/h"
You are probably trying to solve for a field with a default boundary condition.

From function calculatedFvPatchField<Type>::gradientInternalCoef fs() const
in file fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C at line 199.

The question I have is what h file is OpenFOAM referring to? I only don't have any h scripts.

Thanks!
lramutti is offline   Reply With Quote

Old   March 27, 2014, 18:48
Default
  #24
Member
 
Lucas Mutti
Join Date: Aug 2013
Posts: 47
Rep Power: 14
lramutti is on a distinguished road
Hey guys,

I solved the problem. I did not spell correctly the name of my boundary condition. It should have been labeled as leftWall instead of leftwall. Silly mistakes can consume a lot of time .
esujby likes this.
lramutti is offline   Reply With Quote

Old   April 18, 2014, 00:03
Default
  #25
New Member
 
Zhipeng Zhou
Join Date: Mar 2014
Posts: 8
Rep Power: 12
zhouzhipeng77 is on a distinguished road
Hi Mostafa ,
I have some questions with the following code in createFields.H . ANd I look forward to your help .
1. regarding this code "p_rgh + rhok*gh" , rhok is calculated from temperature T , so it is different in different position , why can we use this formula for uniform rho ?
Quote:
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
p_rgh + rhok*gh
);
2. about the setRefCell function , what is its function with p and a_rgh , or can you explain the process of this function ?
Quote:
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell
(
p,
p_rgh,
mesh.solutionDict().subDict("PIMPLE"),
pRefCell,
pRefValue
);
3. with the following code , how dose it process ?
Quote:
if (p_rgh.needReference())
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell)
);
}
Thanks
Zhipeng
zhouzhipeng77 is offline   Reply With Quote

Old   April 18, 2014, 01:42
Default
  #26
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 Zhipeng and welcome

1-
remember the momentum equation and the Boussinesq approximation for naural convection:
\frac{\partial}{\partial t}\left( \rho u_i \right) +
\frac{\partial}{\partial x_j}
\left[ \rho u_i u_j + p \delta_{ij} - \tau_{ji} \right] = \rho g_{i}, \quad i=1,2,3

(\rho - \rho_{0}) g_{i} = -\rho_{0} g_{i} \beta (T-T_{0})

for the case of constant density and gravity, the term \rho g can be written as grad(\rho g . r), where r is the position vector. then -\rho g_{i} x{i} is the hydrostatic pressure, and it's convenient- and for numerical solution more efficient- to define \overline{p}=p - \rho g_{i} x_{i} as the head and use it in place of the pressure.
In variable density flows, one can split the \rho g_{i} term into two parts: \rho_{0} g_{i} +(\rho - \rho_{0}) g_{i}.

for more information you can refer to Ferziger's textbook (computational methods for fluid dynamics).

2-3
The solver needs to know what and where the reference pressure is. according to the explanation in 1 and below quote, I think you can get the answer of your questions.
Quote:
in OpenFOAM pRef is used only if your boundary conditions are set in such a way not to prescribe any reference for the pressure.

So, for example, if you open a duct open to the athmosphere at the outlet, and you have the velocity specified at the inlet, you should specify p equal to zero at the outlet (in incompressible flows, if you specify 1 it doesn't make any difference, you simply translate the values of the pressure in your whole domain of the same difference).

If you have a simulation where p has only Neumann (zeroGradient) conditions, the pRef value will be used, setting p = pRefVal in the cell of index pRefCell.

The values of pRefCell and pRefValue are always specified in the PISO/SIMPLE/PIMPLE subdictionary in fvSolution.
to find out how the pEqn.H works you can see the below link:
http://foam.sourceforge.net/docs/cpp/a02937.html

Bests,
Mostafa
adambarfi is offline   Reply With Quote

Old   April 20, 2014, 23:58
Default
  #27
New Member
 
Zhipeng Zhou
Join Date: Mar 2014
Posts: 8
Rep Power: 12
zhouzhipeng77 is on a distinguished road
Hi , Mostafa ,
Thank you for your help , and I have understand the question , but I can understand the following code in pEqn.H , though I have read the link you telll me .
Quote:
{
volScalarField rAU("rAU", 1.0/UEqn.A());
surfaceScalarField rAUf("(1|A(U))", fvc::interpolate(rAU));

U = rAU*UEqn.H();

phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, U, phi);

surfaceScalarField buoyancyPhi(rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf( ));
phi -= buoyancyPhi;

while (pimple.correctNonOrthogonal())
{
fvScalarMatrix p_rghEqn
(
fvm::laplacian(rAUf, p_rgh) == fvc::div(phi)
);

p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));

p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.fin alInnerIter())));

if (pimple.finalNonOrthogonalIter())
{
// Calculate the conservative fluxes
phi -= p_rghEqn.flux();

// Explicitly relax pressure for momentum corrector
p_rgh.relax();

// Correct the momentum source with the pressure gradient flux
// calculated from the relaxed pressure
U -= rAU*fvc::reconstruct((buoyancyPhi + p_rghEqn.flux())/rAUf);
U.correctBoundaryConditions();
}
}
Can anybody help me to explain this , or introduce me some papers I should read ?
Thanks
Zhipeng
zhouzhipeng77 is offline   Reply With Quote

Old   April 21, 2014, 00:50
Default
  #28
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 explanation of this algorithm here for me is not very easy!! so I attach you a note about the SIMPLE algorithm for pressure-velocity coupling and 4 links about the PISO and SIMPLE algorithm and the implementation of them with OF:

https://www.dropbox.com/s/lplecnozku...MPLEslides.pdf

The_SIMPLE_algorithm_in_OpenFOAM

The_PISO_algorithm_in_OpenFOAM

BuoyantBoussinesqPisoFoam

SIMPLE_algorithm

hope they can help you
awacs likes this.
adambarfi is offline   Reply With Quote

Old   July 29, 2015, 22:18
Default same error for [b]h[/b] file.. but I don't have such file in my [b]0[/b] folder
  #29
Member
 
Lisandro Maders
Join Date: Feb 2013
Posts: 98
Rep Power: 13
Lisandro Maders is on a distinguished road
Hello,

I have the same error posted before:

Code:
--> FOAM FATAL ERROR: 

    gradientInternalCoeffs cannot be called for a calculatedFvPatchField
    on patch OUTLET of field h in file "/home/lisandro/OpenFOAM/lisandro-2.3.0/run/tutorials/combustion/reactingFoam/ras/counterFlowFlame2D/0/h"
    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 199.

FOAM exiting
The thing is, I don't have this file in my 0 folder, I have the T file instead as well as species files. I am running the counterFlowFlame2D tutorial but I changed the mesh..

Why is it looking for the h file?



Best,

Lisandro
Lisandro Maders is offline   Reply With Quote

Old   September 11, 2015, 10:31
Default
  #30
Member
 
Lisandro Maders
Join Date: Feb 2013
Posts: 98
Rep Power: 13
Lisandro Maders is on a distinguished road
Just as a matter of fact, I solved the issue above by changing the BC type of N2 (inert specie) in the Outlet patch. It was calculated and I put zeroGradient and I got no errors anymore.

Lisandro
Lisandro Maders 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 22:20
terminate called after throwing an instance of 'int' b614910 SU2 10 July 27, 2014 23:16
word::stripInvalid() called for word r error immortality OpenFOAM Running, Solving & CFD 4 May 12, 2013 07:03
understanding how turbulence models are called romant OpenFOAM Programming & Development 0 March 21, 2012 10:22
reconstructParMesh not working with an axisymetric case francesco OpenFOAM Bugs 4 May 8, 2009 06:49


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