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

Prossible wrong in the LimitedScheme.C ?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 24, 2009, 01:38
Default Prossible wrong in the LimitedScheme.C ?
  #1
New Member
 
Liu Huafei
Join Date: Mar 2009
Location: Shanghai, China
Posts: 20
Rep Power: 17
liuhuafei is on a distinguished road
Prossible wrong in the LimitedScheme.C
In LimitedScheme.C
template<class Type, class Limiter, template<class> class LimitFunc>
tmp<surfaceScalarField> LimitedScheme<Type, Limiter, LimitFunc>::limiter
(
const GeometricField<Type, fvPatchField, volMesh>& phi
) const
{
..... for internal faces .................
forAll(pLim, face)
{
label own = owner[face];
label nei = neighbour[face];
pLim[face] = Limiter::limiter
(
CDweights[face],
this->faceFlux_[face],
lPhi[own],
lPhi[nei],
gradc[own],
gradc[nei],
C[nei] - C[own]
);
}
question 1: why the distance vector is C[nei]-C[own],
no correction for the nonorthgonal grid?

-----------for the boundary----------------------
GeometricField<typename Limiter::gradPhiType, fvPatchField, volMesh>
gradc(fvc::grad(lPhi));
forAll(bLim, patchi)
{
scalarField& pLim = bLim[patchi];
if (bLim[patchi].coupled())
{
Field<typename Limiter:hiType> plPhiN =
lPhi.boundaryField()[patchi].patchNeighbourField();
Field<typename Limiter::gradPhiType> pGradcN =
gradc.boundaryField()[patchi].patchNeighbourField();
// Build the d-vectors
vectorField pd =
mesh.Sf().boundaryField()[patchi]
/(
mesh.magSf().boundaryField()[patchi]
*mesh.deltaCoeffs().boundaryField()[patchi]
);
if (!mesh.orthogonal())
{
pd -= mesh.correctionVectors().boundaryField()[patchi]
/mesh.deltaCoeffs().boundaryField()[patchi];
}
forAll(pLim, face)
{
pLim[face] = Limiter::limiter
(
pCDweights[face],
pFaceFlux[face],
plPhiP[face],
plPhiN[face],
pGradcP[face],
pGradcN[face],
pd[face]
);
}
}
else
{
pLim = 1.0;
}
}
question 2:
The pGradcN[face] is neighbour cell's gradient. For the coupled boundary, for examples,the neighbour cell is virtual N',not the real cell?
The virtual N' is got by rotated by N? How can we get the gradient of N'? The gradient of N' is equal to that of N?
liuhuafei is offline   Reply With Quote

Old   August 24, 2009, 19:53
Default
  #2
New Member
 
Liu Huafei
Join Date: Mar 2009
Location: Shanghai, China
Posts: 20
Rep Power: 17
liuhuafei is on a distinguished road
For example

For the cycle boundary,We have a pair of cell, P and N. We need rotate the N to N' by transformation. On calculation of the limiter function,we need the gradient of N' cell. How can we get it. The gradient function of openFoam doesn't treat the coupled boundary.

But the gradient of N' is equal to that of N?
We need the transformation of the gradient of N to get the gradient of N' like other vector variable?



template<class Type> void gaussGrad<Type>::correctBoundaryConditions
( const GeometricField<Type, fvPatchField, volMesh>& vsf,
GeometricField <typename outerProduct<vector, Type>::type, fvPatchField, volMesh >& gGrad){
forAll(vsf.boundaryField(), patchi)
{
if (!vsf.boundaryField()[patchi].coupled())
{
vectorField n =
vsf.mesh().Sf().boundaryField()[patchi]
/vsf.mesh().magSf().boundaryField()[patchi];
gGrad.boundaryField()[patchi] += n *
(
vsf.boundaryField()[patchi].snGrad()
- (n & gGrad.boundaryField()[patchi])
);
}
}
}
liuhuafei is offline   Reply With Quote

Old   August 24, 2009, 19:54
Default
  #3
New Member
 
Liu Huafei
Join Date: Mar 2009
Location: Shanghai, China
Posts: 20
Rep Power: 17
liuhuafei is on a distinguished road
liuhuafei is offline   Reply With Quote

Old   August 24, 2009, 19:56
Default
  #4
New Member
 
Liu Huafei
Join Date: Mar 2009
Location: Shanghai, China
Posts: 20
Rep Power: 17
liuhuafei is on a distinguished road
Quote:
[IMG]file:///c:/Clip_12.jpg[/IMG]
the figure of cycle boundary
liuhuafei is offline   Reply With Quote

Old   July 22, 2014, 06:41
Default
  #5
Senior Member
 
Yogesh Bapat
Join Date: Oct 2010
Posts: 102
Rep Power: 15
ybapat is on a distinguished road
Hello Liu,

This is very old post from you, but if you can tell if gradients near cyclic AMI boundaries are calculated correctly?
ybapat is offline   Reply With Quote

Old   July 23, 2014, 05:05
Default
  #6
Senior Member
 
T. Chourushi
Join Date: Jul 2009
Posts: 321
Blog Entries: 1
Rep Power: 17
Tushar@cfd is on a distinguished road
Quote:
Originally Posted by liuhuafei View Post
Prossible wrong in the LimitedScheme.C
In LimitedScheme.C
template<class Type, class Limiter, template<class> class LimitFunc>
tmp<surfaceScalarField> LimitedScheme<Type, Limiter, LimitFunc>::limiter
(
const GeometricField<Type, fvPatchField, volMesh>& phi
) const
{
..... for internal faces .................
forAll(pLim, face)
{
label own = owner[face];
label nei = neighbour[face];
pLim[face] = Limiter::limiter
(
CDweights[face],
this->faceFlux_[face],
lPhi[own],
lPhi[nei],
gradc[own],
gradc[nei],
C[nei] - C[own]
);
}
question 1: why the distance vector is C[nei]-C[own],
no correction for the nonorthgonal grid?

-----------for the boundary----------------------
GeometricField<typename Limiter::gradPhiType, fvPatchField, volMesh>
gradc(fvc::grad(lPhi));
forAll(bLim, patchi)
{
scalarField& pLim = bLim[patchi];
if (bLim[patchi].coupled())
{
Field<typename Limiter:hiType> plPhiN =
lPhi.boundaryField()[patchi].patchNeighbourField();
Field<typename Limiter::gradPhiType> pGradcN =
gradc.boundaryField()[patchi].patchNeighbourField();
// Build the d-vectors
vectorField pd =
mesh.Sf().boundaryField()[patchi]
/(
mesh.magSf().boundaryField()[patchi]
*mesh.deltaCoeffs().boundaryField()[patchi]
);
if (!mesh.orthogonal())
{
pd -= mesh.correctionVectors().boundaryField()[patchi]
/mesh.deltaCoeffs().boundaryField()[patchi];
}
forAll(pLim, face)
{
pLim[face] = Limiter::limiter
(
pCDweights[face],
pFaceFlux[face],
plPhiP[face],
plPhiN[face],
pGradcP[face],
pGradcN[face],
pd[face]
);
}
}
else
{
pLim = 1.0;
}
}
question 2:
The pGradcN[face] is neighbour cell's gradient. For the coupled boundary, for examples,the neighbour cell is virtual N',not the real cell?
The virtual N' is got by rotated by N? How can we get the gradient of N'? The gradient of N' is equal to that of N?

......

LimitedScheme is actually correct, Prof. H. Jasak used different technique.

Have you seen Prof. H. Jasak PhD thesis?

It is recommended to check his explanation for these face variable calculation. You will get answer to all your queries.

In your case may be this boundary condition could be problematic but not Limitedscheme.

Anyways..
-
Best Luck!
Tushar@cfd is offline   Reply With Quote

Old   July 23, 2014, 05:46
Default
  #7
Senior Member
 
Yogesh Bapat
Join Date: Oct 2010
Posts: 102
Rep Power: 15
ybapat is on a distinguished road
Hello Tushar,

Can you please elaborate which section in thesis you are talking about? Are you talking about interpolation schemes?

To give you more background on my question, I am trying pressure jump BC(This is derived from cyclicAMI). I am not able to converge simulation if I do not use faceLimited gradients. Moment I switch on cellLimited gradient simulation diverges,. Even with faceLimited if I change form "faceLimited Gauss linear 1.0" to "faceLimited Gauss linear 0.99" simulation diverges.

Regards,
-Yogesh
ybapat is offline   Reply With Quote

Old   July 23, 2014, 06:55
Default
  #8
Senior Member
 
T. Chourushi
Join Date: Jul 2009
Posts: 321
Blog Entries: 1
Rep Power: 17
Tushar@cfd is on a distinguished road
Hello Yogesh,

I don't understand why you are writing your problem case to me.

I answered the previous post of "liuhuafei", as he specifically pointed "Possible wrong in the LimitedScheme.C ?". I clarified that post as there isn't any mistake with the code. (reference for same can be understood by reading the PhD thesis of Prof. H. Jasak)

About your case, you didn't mention any detail so it's hard to guess how come your case failed.

-
Best Luck!
Tushar@cfd is offline   Reply With Quote

Old   July 23, 2014, 07:08
Default
  #9
Senior Member
 
Yogesh Bapat
Join Date: Oct 2010
Posts: 102
Rep Power: 15
ybapat is on a distinguished road
Hello Tushar,

I thought you are replying to my post, as liuhuafei's post is very old.

-Yogesh
ybapat is offline   Reply With Quote

Old   July 23, 2014, 07:22
Default
  #10
Senior Member
 
T. Chourushi
Join Date: Jul 2009
Posts: 321
Blog Entries: 1
Rep Power: 17
Tushar@cfd is on a distinguished road
Hello Yogesh,

If you wish to share your problem case then you can post here. I will try to see if I can help you.

-
Best Regards!
Tushar@cfd 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
udf error srihari FLUENT 1 October 31, 2016 14:18
What's wrong? Non-conform mesh problem!!! Neo FLUENT 1 March 31, 2013 15:00
Warning: Dynamic zone with wrong CG using 6DOF Manoj Kumar FLUENT 1 August 11, 2012 04:03
Pressure contour seems wrong??? Harry Qiu FLUENT 1 June 29, 2001 05:53
What's wrong with my UDF? olivia FLUENT 1 June 23, 2001 17:06


All times are GMT -4. The time now is 07:54.