|
[Sponsors] |
couple cells from different meshes in parallel |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 3, 2009, 09:48 |
couple cells from different meshes in parallel
|
#1 |
Member
Roland
Join Date: Mar 2009
Location: Netherlands
Posts: 93
Rep Power: 17 |
Hi,
To calculate the thermal interaction between the coolant in a radiator and the air flowing through the radiator, I want to couple the cells of two overlapping regions (air/coolant) in order to match their heat transfer (in a later part of the code). The coolant mesh has identical cells as the radiator zone in the air mesh. In serial the coupling is achieved without problems with the following code: Code:
const volVectorField& CAir = meshAir.C(); //Air cell centres labelList cellIDAir.setSize(meshCoolant.nCells()); //initilize list of matching Air cell ID's labelList cellIDCoolant.setSize(meshAir.nCells()); //initilize list of matching Coolant cell ID's label cellZoneID = meshAir.cellZones().findZoneID(radiatorZone); //radiatorZone is located in Air const cellZone& zoneAir = meshAir.cellZones()[cellZoneID]; const cellZoneMesh& zoneMeshAir = zoneAir.zoneMesh(); const labelList& cellsAirZone = zoneMeshAir[cellZoneID]; //list of all radiatorZone cell ID's //loop over all cells in radiatorZone forAll(cellsAirZone, cellI) { // take one cell out of cellsAirZone list cellAirZone = cellsAirZone[cellI]; //take cell centre of this Air cell vector AirCellCentre = CAir[cellAirZone]; //locate matching Coolant cell cellIDCoolant[cellAirZone] = meshCoolant.findCell(AirCellCentre); //this fails in parallel //set matching Air cell cellIDAir[cellIDCoolant[cellAirZone]] = cellAirZone; } This causes the .findCell function to fail when running in parallel. How can I best solve (or circumvent) this problem? Any help is much appreciated. Best regards, Sylvester |
|
September 7, 2009, 15:40 |
|
#2 |
Senior Member
Matvey Kraposhin
Join Date: Mar 2009
Location: Moscow, Russian Federation
Posts: 355
Rep Power: 21 |
||
September 9, 2009, 06:57 |
|
#3 |
Member
Roland
Join Date: Mar 2009
Location: Netherlands
Posts: 93
Rep Power: 17 |
Hi Matvej,
I circumvented the problem by making sure that all water cells are on the same processor as the associated air cells. This leaves some processors without any water cells, but this does not seem to cause any problems. regards, Sylvester |
|
September 9, 2009, 15:45 |
|
#4 |
Senior Member
Matvey Kraposhin
Join Date: Mar 2009
Location: Moscow, Russian Federation
Posts: 355
Rep Power: 21 |
Hi, Sylvester
thank you for your reply. But i think, that it is not an elegant way of organizing parallel computations. After looking through forum, i found that this problem can be solved by using MPI API. As i understand, this could be done in a such way: In master process: 1) Gather values of field from slave processes 2) Assembly whole field (for whole domain) 3) Update field 4) Send updated field values (parts of the field) to slave processes But i still don't understand how to do this. For now, i'm examining OpenFOAM source code and forum for examples or similar cases. |
|
September 10, 2009, 06:36 |
|
#5 |
Member
Roland
Join Date: Mar 2009
Location: Netherlands
Posts: 93
Rep Power: 17 |
Hi Matvej,
Yes, my solution might not be very elegant, but it works. And it works for me now, which is very important to me. I'm still interested in a proper solution though, so please share it when you find it. regards, Sylvester |
|
September 11, 2009, 16:05 |
|
#6 |
Senior Member
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20 |
Sylvester,
how do you ensure all cells to be on the same cpu? Which entry do you use in decomposParDICT? Thanks. BastiL |
|
September 14, 2009, 07:37 |
|
#7 |
Member
Roland
Join Date: Mar 2009
Location: Netherlands
Posts: 93
Rep Power: 17 |
Hi BastiL,
First decompose the first mesh with the -cellDist argument. Next map the created cellDist file to the second mesh using mapFields. Then make the new cellDist file suitable for decomposePar by deleting the unnecessary stuff. Finally decompose the second mesh with the method specified as 'manual' in decomposeParDict. Make sure it uses your new cellDist file. regards, Sylvester |
|
September 29, 2009, 04:32 |
|
#8 |
Senior Member
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20 |
Sylveser, mkraposhin,
your parallelisation seems quite complex to me. Would a preserveFaceZones (zonename); in decomposepardict not do the job? I am interested in how your code looks like? Is it in a solver or a functionObject? Would it be possible sharing it with me? Thanks BastiL |
|
September 29, 2009, 05:04 |
|
#9 |
Member
Roland
Join Date: Mar 2009
Location: Netherlands
Posts: 93
Rep Power: 17 |
Hi BastiL,
As the coupling required by me was on the volume cell level, I do not expect that preserveFaceZones would have been sufficient. But with the method described in my previous message I can get the code running without problems. The code snippet I have given before is used in a solver. I cannot release more of it, but that snippet should be enough to get you started. regards, Sylvester |
|
Tags |
cell, coupling, mesh, parallel, region |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Netgen] Import netgen mesh to OpenFOAM | hsieh | OpenFOAM Meshing & Mesh Conversion | 32 | September 13, 2011 06:50 |
ChannelOodles in parallel | maka | OpenFOAM Bugs | 3 | August 21, 2007 18:30 |
Question about ghost cells in parallel processing | vishwas | Main CFD Forum | 3 | March 12, 2006 22:46 |
physical boundary error!! | kris | Siemens | 2 | August 3, 2005 01:32 |
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues | michele | OpenFOAM Meshing & Mesh Conversion | 2 | July 15, 2005 05:15 |