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

a bug when correctting the flux in dynamicRefineFvMesh?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 11, 2016, 05:01
Default a bug when correctting the flux in dynamicRefineFvMesh?
  #1
Member
 
Yu CAO
Join Date: May 2013
Posts: 76
Rep Power: 13
cctv is on a distinguished road
Hi:
I was confused of the code correcting the flux in the function autoPtr<mapPolyMesh> dynamicRefineFvMesh::refine of the file dynamicRefineFvMesh.C

It is written like this
// Correct the flux for modified/added faces. All the faces which only
// have been renumbered will already have been handled by the mapping.
{
const labelList& faceMap = map().faceMap();
const labelList& reverseFaceMap = map().reverseFaceMap();

// Storage for any master faces. These will be the original faces
// on the coarse cell that get split into four (or rather the
// master face gets modified and three faces get added from the master)
labelHashSet masterFaces(4*cellsToRefine.size());

forAll(faceMap, faceI)
{
label oldFaceI = faceMap[faceI];

if (oldFaceI >= 0)
{
label masterFaceI = reverseFaceMap[oldFaceI];

if (masterFaceI < 0)
{
FatalErrorIn
(
"dynamicRefineFvMesh::refine(const labelList&)"
) << "Problem: should not have removed faces"
<< " when refining."
<< nl << "face:" << faceI << abort(FatalError);
}
else if (masterFaceI != faceI)
{
masterFaces.insert(masterFaceI);
}
}
}

I am not sure why the size of the masterfaces is 4*cellsToRefine.size(). What is more, I am quite confused about the condition when filling up masterfaces. It is (masterFaceI != faceI), in my view, the masterface refers to faces with the same faceID, and it should be (masterFaceI == faceI). I am not sure if there is anything wrong with my understanding.
when calculating the new internal faces, it is written like this
// Recalculate new internal faces.
for (label faceI = 0; faceI < nInternalFaces(); faceI++)
{
label oldFaceI = faceMap[faceI];

if (oldFaceI == -1)
{
// Inflated/appended
phi[faceI] = phiU[faceI];
}
else if (reverseFaceMap[oldFaceI] != faceI)
{
// face-from-masterface
phi[faceI] = phiU[faceI];
}
}
I am not sure why it is phi[faceI] = phiU[faceI], I think it should be phi[faceI] = phiU[reverseFaceMap[oldFaceI]]. otherwise, why not use
forAll(phi,faceI)
phi[faceI] = phiU[faceI];
directly? Does anybody know the reason? Thank.
Yu
cctv is offline   Reply With Quote

Old   January 12, 2016, 05:16
Default
  #2
Member
 
Yu CAO
Join Date: May 2013
Posts: 76
Rep Power: 13
cctv is on a distinguished road
Well. I think I have found out the reason. Thank you all for your attention.
cctv 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
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 08:30
Udf for moving heat flux in 2D cylindrical geometry devia21 Fluent UDF and Scheme Programming 0 April 20, 2015 01:27
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 07:28
Replace periodic by inlet-outlet pair lego CFX 3 November 5, 2002 21:09


All times are GMT -4. The time now is 04:42.