|
[Sponsors] |
July 6, 2012, 22:04 |
conjugateHeatFoam for 4 different regions
|
#1 |
Member
jack
Join Date: Jul 2011
Posts: 52
Rep Power: 15 |
Hello everybody,
I am going to use conjugateHeatFoam to simulate a conduction problem in a multi region case, thus including solid regions and fluid regions. I am using OF 1.6-ext. There are 4 different regions, corresponding to different materials: A and C are solids, B and D is fluid (laminar). All the mesh is hexa, Can solver conjugateHeatFoam realize my need?Do I need to modify the solver code? thank you very much! regards! lg88 |
|
July 9, 2012, 18:29 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings lg88,
In response to the private message you sent me: I'm not familiar with conjugateHeatFoam. But I think that chtMultiRegionFoam should be able to solve this issue, but again, I'm not very familiar with either one of these solvers. Best regards, Bruno
__________________
|
|
July 9, 2012, 22:20 |
|
#3 |
Member
jack
Join Date: Jul 2011
Posts: 52
Rep Power: 15 |
Thank you for your suggestion.But I am familiar with conjugateHeatFoam and my new solver is based on it.I hope use the solver to solve my problem.I found some information about the same problem I meet at [url]http://www.cfd-online.com/Forums/openfoam/89684-conjugateheatfoam-arbitrary-number-region.html.But there is not detailed construction.
Can anyone give me some idea? Thank you very much! lg88 Last edited by lg88; July 9, 2012 at 23:46. |
|
July 9, 2012, 22:34 |
|
#4 | |
Senior Member
|
Quote:
Regards, Junwei |
||
July 11, 2012, 01:25 |
|
#5 |
Member
jack
Join Date: Jul 2011
Posts: 52
Rep Power: 15 |
hello
Thank you for your suggestion .I have checked in the forum and found that some people had applied conjugateHeatFoam to multi-regions successfully.And my new foam is developed based on the conjugateHeatFoam. regards! lg88 |
|
July 13, 2012, 18:43 |
|
#6 |
Senior Member
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 19 |
You need to edit the files attachPatches.H and detachPateches.H. You then have a main region and all other regions are treated as submeshes of the main region.
I've only done this for 3 regions, but 4 or more is definitely possible. attachPatches.H (for 3 regions): Code:
{ const polyPatchList& patches = mesh.boundaryMesh(); forAll (patches, patchI) { if (isType<regionCouplePolyPatch>(patches[patchI])) { const regionCouplePolyPatch& rcp = refCast<const regionCouplePolyPatch>(patches[patchI]); // Attach it here rcp.attach(); } } // Force recalculation of weights mesh.surfaceInterpolation::movePoints(); const polyPatchList& patches1 = separatorMesh.boundaryMesh(); forAll (patches1, patchI) { if (isType<regionCouplePolyPatch>(patches1[patchI])) { const regionCouplePolyPatch& rcp = refCast<const regionCouplePolyPatch>(patches1[patchI]); // Attach it here rcp.attach(); } } // Force recalculation of weights separatorMesh.surfaceInterpolation::movePoints(); const polyPatchList& patches2 = positiveMesh.boundaryMesh(); forAll (patches2, patchI) { if (isType<regionCouplePolyPatch>(patches2[patchI])) { const regionCouplePolyPatch& rcp = refCast<const regionCouplePolyPatch>(patches2[patchI]); // Attach it here rcp.attach(); } } // Force recalculation of weights positiveMesh.surfaceInterpolation::movePoints(); } Code:
{ const polyPatchList& patches = mesh.boundaryMesh(); forAll (patches, patchI) { if (isType<regionCouplePolyPatch>(patches[patchI])) { const regionCouplePolyPatch& rcp = refCast<const regionCouplePolyPatch>(patches[patchI]); // Detach it here rcp.detach(); } } // Force recalculation of weights mesh.surfaceInterpolation::movePoints(); const polyPatchList& patches1 = separatorMesh.boundaryMesh(); forAll (patches1, patchI) { if (isType<regionCouplePolyPatch>(patches1[patchI])) { const regionCouplePolyPatch& rcp = refCast<const regionCouplePolyPatch>(patches1[patchI]); // Detach it here rcp.detach(); } } // Force recalculation of weights separatorMesh.surfaceInterpolation::movePoints(); const polyPatchList& patches2 = positiveMesh.boundaryMesh(); forAll (patches2, patchI) { if (isType<regionCouplePolyPatch>(patches2[patchI])) { const regionCouplePolyPatch& rcp = refCast<const regionCouplePolyPatch>(patches2[patchI]); // Detach it here rcp.detach(); } } // Force recalculation of weights positiveMesh.surfaceInterpolation::movePoints(); } Then in case/constant you have: polyMesh/... (for the main mesh) positive/polyMesh/... (for one submesh) separator/polyMesh/... (for the other submesh) In case/0 you have: {fields for main mesh} positive/{fields for positive mesh} separator/{fields for separator mesh} |
|
July 14, 2012, 11:53 |
|
#7 |
New Member
kob
Join Date: Nov 2011
Posts: 28
Rep Power: 15 |
Thank you for your detailed construction.I am also looking for the multi-region function of conjugateHeatFoam.
Regards! kob |
|
July 14, 2012, 12:01 |
|
#8 |
Member
jack
Join Date: Jul 2011
Posts: 52
Rep Power: 15 |
@benk
Thank you very much.I have modified my code as you said. Now it can work fluently and I am waiting for the results.Hoping it will work. Regards! lg88 |
|
August 25, 2012, 16:17 |
|
#9 |
New Member
reza
Join Date: May 2012
Posts: 3
Rep Power: 14 |
can anyone send me a simple tutorial of conjugateHeatFoam for multiregion (2fluid & 1solid) ?
Can anyone give me some idea? thanks |
|
October 19, 2013, 23:35 |
|
#10 | |
New Member
Maosong Cheng
Join Date: Aug 2012
Posts: 19
Rep Power: 14 |
Quote:
In your case, can the boudaryField fully show in the solution file (such as T) using conjugateHeatFoam? Thanks! CHENG |
||
July 30, 2020, 22:35 |
|
#11 |
New Member
Hailong
Join Date: Sep 2019
Posts: 8
Rep Power: 7 |
Hi, benk
I modified my code like these attachPatches.H (for 4 regions): Code:
{ const polyPatchList& patches = mesh.boundaryMesh(); forAll (patches, patchI) { if (isType<regionCouplePolyPatch>(patches[patchI])) { const regionCouplePolyPatch& rcp = refCast<const regionCouplePolyPatch>(patches[patchI]); // Attach it here rcp.attach(); } } // Force recalculation of weights mesh.surfaceInterpolation::movePoints(); //solidone const polyPatchList& patches1 = solidMesh1.boundaryMesh(); forAll (patches1, patchI) { if (isType<regionCouplePolyPatch>(patches1[patchI])) { const regionCouplePolyPatch& rcp = refCast<const regionCouplePolyPatch>(patches1[patchI]); // Attach it here rcp.attach(); } } // Force recalculation of weights solidMesh1.surfaceInterpolation::movePoints(); //solidtwo const polyPatchList& patches2 = solidMesh2.boundaryMesh(); forAll (patches2, patchI) { if (isType<regionCouplePolyPatch>(patches2[patchI])) { const regionCouplePolyPatch& rcp = refCast<const regionCouplePolyPatch>(patches2[patchI]); // Attach it here rcp.attach(); } } // Force recalculation of weights solidMesh2.surfaceInterpolation::movePoints(); //solidthree const polyPatchList& patches3 = solidMesh3.boundaryMesh(); forAll (patches3, patchI) { if (isType<regionCouplePolyPatch>(patches3[patchI])) { const regionCouplePolyPatch& rcp = refCast<const regionCouplePolyPatch>(patches3[patchI]); // Attach it here rcp.attach(); } } // Force recalculation of weights solidMesh3.surfaceInterpolation::movePoints(); } Code:
{ const polyPatchList& patches = mesh.boundaryMesh(); forAll (patches, patchI) { if (isType<regionCouplePolyPatch>(patches[patchI])) { const regionCouplePolyPatch& rcp = refCast<const regionCouplePolyPatch>(patches[patchI]); // Detach it here rcp.detach(); } } // Force recalculation of weights mesh.surfaceInterpolation::movePoints(); //solidone const polyPatchList& patches1 = solidMesh1.boundaryMesh(); forAll (patches1, patchI) { if (isType<regionCouplePolyPatch>(patches1[patchI])) { const regionCouplePolyPatch& rcp = refCast<const regionCouplePolyPatch>(patches1[patchI]); // Detach it here rcp.detach(); } } // Force recalculation of weights solidMesh1.surfaceInterpolation::movePoints(); //solidtwo const polyPatchList& patches2 = solidtMesh2.boundaryMesh(); forAll (patches2, patchI) { if (isType<regionCouplePolyPatch>(patches2[patchI])) { const regionCouplePolyPatch& rcp = refCast<const regionCouplePolyPatch>(patches2[patchI]); // Detach it here rcp.detach(); } } // Force recalculation of weights solidMesh2.surfaceInterpolation::movePoints(); //solidthree const polyPatchList& patches3 = solidMesh3.boundaryMesh(); forAll (patches3, patchI) { if (isType<regionCouplePolyPatch>(patches3[patchI])) { const regionCouplePolyPatch& rcp = refCast<const regionCouplePolyPatch>(patches3[patchI]); // Detach it here rcp.detach(); } } // Force recalculation of weights solidMesh3.surfaceInterpolation::movePoints(); } Code:
In file included from createFields.H(80), from conjugateHeatThreesSimpleFoam.C(51): attachPatches.H(20): error: identifier "solidMesh1" is undefined const polyPatchList& patches1 = solidMesh1.boundaryMesh(); ^ In file included from createFields.H(80), from conjugateHeatThreesSimpleFoam.C(51): attachPatches.H(39): error: identifier "solidMesh2" is undefined const polyPatchList& patches2 = solidMesh2.boundaryMesh(); ^ In file included from createFields.H(80), from conjugateHeatThreesSimpleFoam.C(51): attachPatches.H(57): error: identifier "solidMesh3" is undefined const polyPatchList& patches3 = solidMesh3.boundaryMesh(); ^ In file included from conjugateHeatThreesSimpleFoam.C(67): detachPatches.H(20): error: identifier "solidMesh1" is undefined const polyPatchList& patches1 = solidMesh1.boundaryMesh(); ^ In file included from conjugateHeatThreesSimpleFoam.C(67): detachPatches.H(39): error: identifier "solidtMesh2" is undefined const polyPatchList& patches2 = solidtMesh2.boundaryMesh(); ^ In file included from conjugateHeatThreesSimpleFoam.C(67): detachPatches.H(54): error: identifier "solidMesh2" is undefined solidMesh2.surfaceInterpolation::movePoints(); ^ In file included from conjugateHeatThreesSimpleFoam.C(67): detachPatches.H(58): error: identifier "solidMesh3" is undefined const polyPatchList& patches3 = solidMesh3.boundaryMesh(); ^ In file included from conjugateHeatThreesSimpleFoam.C(87): attachPatches.H(20): error: identifier "solidMesh1" is undefined const polyPatchList& patches1 = solidMesh1.boundaryMesh(); ^ In file included from conjugateHeatThreesSimpleFoam.C(87): attachPatches.H(39): error: identifier "solidMesh2" is undefined const polyPatchList& patches2 = solidMesh2.boundaryMesh(); ^ In file included from conjugateHeatThreesSimpleFoam.C(87): attachPatches.H(57): error: identifier "solidMesh3" is undefined const polyPatchList& patches3 = solidMesh3.boundaryMesh(); ^ compilation aborted for conjugateHeatThreesSimpleFoam.C (code 2) Thank you very much |
|
Tags |
conjugateheatfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how the interface between 2 solid regions is treater in chtMultiRegionFoam ? | Cyp | OpenFOAM | 2 | March 15, 2023 06:35 |
[CAD formats] beginners how to convert binarySTL to asciiSTL with regions (good for SHM tutorial) | soonic | OpenFOAM Meshing & Mesh Conversion | 11 | July 28, 2017 16:46 |
isolated fluid regions were found | alfin | CFX | 14 | October 8, 2015 02:36 |
Splitting regions | king_steve | STAR-CCM+ | 1 | September 27, 2010 13:48 |
conjugateHeatFoam: Problems adding 3rd region | benk | OpenFOAM | 5 | April 21, 2010 13:46 |