|
[Sponsors] |
a bug when correctting the flux in dynamicRefineFvMesh? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 11, 2016, 05:01 |
a bug when correctting the flux in dynamicRefineFvMesh?
|
#1 |
Member
Yu CAO
Join Date: May 2013
Posts: 76
Rep Power: 13 |
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 |
|
January 12, 2016, 05:16 |
|
#2 |
Member
Yu CAO
Join Date: May 2013
Posts: 76
Rep Power: 13 |
Well. I think I have found out the reason. Thank you all for your attention.
|
|
|
|
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 |