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

couple cells from different meshes in parallel

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   September 3, 2009, 08:48
Default couple cells from different meshes in parallel
  #1
Member
 
Roland
Join Date: Mar 2009
Location: Netherlands
Posts: 62
Rep Power: 8
sylvester is on a distinguished road
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;
}
As the coolant mesh is much smaller than the total air mesh, the overlapping cells will, in general, not be assigned to the same processor.
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
sylvester is offline   Reply With Quote

Old   September 7, 2009, 14:40
Default
  #2
Senior Member
 
mkraposhin's Avatar
 
Matvej Kraposhin
Join Date: Mar 2009
Location: Moscow, Russian Federation
Posts: 204
Rep Power: 10
mkraposhin is on a distinguished road
Hi, sylvester

I have the same trouble. Had you got any ideas?
mkraposhin is offline   Reply With Quote

Old   September 9, 2009, 05:57
Default
  #3
Member
 
Roland
Join Date: Mar 2009
Location: Netherlands
Posts: 62
Rep Power: 8
sylvester is on a distinguished road
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
sylvester is offline   Reply With Quote

Old   September 9, 2009, 14:45
Default
  #4
Senior Member
 
mkraposhin's Avatar
 
Matvej Kraposhin
Join Date: Mar 2009
Location: Moscow, Russian Federation
Posts: 204
Rep Power: 10
mkraposhin is on a distinguished road
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.
mkraposhin is offline   Reply With Quote

Old   September 10, 2009, 05:36
Default
  #5
Member
 
Roland
Join Date: Mar 2009
Location: Netherlands
Posts: 62
Rep Power: 8
sylvester is on a distinguished road
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
sylvester is offline   Reply With Quote

Old   September 11, 2009, 15:05
Default
  #6
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 471
Rep Power: 11
bastil is on a distinguished road
Sylvester,

how do you ensure all cells to be on the same cpu? Which entry do you use in decomposParDICT? Thanks.

BastiL
bastil is offline   Reply With Quote

Old   September 14, 2009, 06:37
Default
  #7
Member
 
Roland
Join Date: Mar 2009
Location: Netherlands
Posts: 62
Rep Power: 8
sylvester is on a distinguished road
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
sylvester is offline   Reply With Quote

Old   September 29, 2009, 03:32
Default
  #8
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 471
Rep Power: 11
bastil is on a distinguished road
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
bastil is offline   Reply With Quote

Old   September 29, 2009, 04:04
Default
  #9
Member
 
Roland
Join Date: Mar 2009
Location: Netherlands
Posts: 62
Rep Power: 8
sylvester is on a distinguished road
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
sylvester is offline   Reply With Quote

Reply

Tags
cell, coupling, mesh, parallel, region

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import netgen mesh to OpenFOAM hsieh Open Source Meshers: Gmsh, Netgen, CGNS, ... 32 September 13, 2011 05:50
ChannelOodles in parallel maka OpenFOAM Bugs 3 August 21, 2007 17:30
Question about ghost cells in parallel processing vishwas Main CFD Forum 3 March 12, 2006 22:46
physical boundary error!! kris CD-adapco 2 August 3, 2005 00:32
Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 2 July 15, 2005 04:15


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