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

Access boundary face temperatures in parallel run

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 11, 2019, 08:11
Default Access boundary face temperatures in parallel run
  #1
New Member
 
Kaan Menekşedağ
Join Date: Jul 2017
Location: İstanbul,Türkiye
Posts: 3
Rep Power: 8
kaanm is on a distinguished road
Hi Foamers,
I want to access boundary face temperatures in chtMultiRegionFoam (I am using OpenFoam1612+).
I can reach temperature values when running in serial.

// For the boundary region 6

forAll(thermoFluid[i].T().boundaryField()[6], faceI)
{
internaltemp[faceI]=thermoFluid[i].T().boundaryField()[6][faceI];
}

But in parallel run, I can only take procesor0 values.
How can i access other processor's temperature values?

Thanks for any help
Kaan
kaanm is offline   Reply With Quote

Old   March 1, 2019, 03:19
Thumbs up
  #2
New Member
 
Kaan Menekşedağ
Join Date: Jul 2017
Location: İstanbul,Türkiye
Posts: 3
Rep Power: 8
kaanm is on a distinguished road
I found that it already runs on parallel processors but i could not visualize the following line for all processors:

Info<<"totalNCoarseFaces: "<<totalNCoarseFaces_<<" Local:"<<nLocalCoarseFaces_<<" Pmaster: "<<Pstream::myProcNo() <<endl;

Info, cout, fprintf are only working on master node. Hence, they were not the commands i require for this case. To be able to print variables on the terminal screen Pout or Sout should be use.
Following code prints on terminal for each processors:

Sout<<"totalNCoarseFaces: "<<totalNCoarseFaces_<<" Local:"<<nLocalCoarseFaces_<<" Pmaster: "<<Pstream::myProcNo() <<endl;

Temperature access on each processor is handling with this code. All the processors reads their own mesh and faces of boundaryfield 6. Nothing is changed apart from internaltemp[treshold+faceI] for other processors:

if(Pstream::myProcNo()==0){
internaltemp[faceI]=thermoFluid[i].T().boundaryField()[6][faceI];
if(faceI==4928){
Pout <<" Sout myProcNo():"<< Pstream::myProcNo()<<" i:"<< faceI << ":T:"<<internaltemp[faceI] ;
}
}
if(Pstream::myProcNo()==1){
internaltemp[4929+faceI]=thermoFluid[i].T().boundaryField()[6][faceI];
Pout <<" Pout myProcNo():"<< Pstream::myProcNo()<<" i:"<< faceI << ":T:"<<internaltemp[4929+faceI] ;
}
}
kaanm 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
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 07:38
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' muth OpenFOAM Running, Solving & CFD 3 August 27, 2018 04:18
[Netgen] Import netgen mesh to OpenFOAM hsieh OpenFOAM Meshing & Mesh Conversion 32 September 13, 2011 05:50
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 14:00
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 15:55


All times are GMT -4. The time now is 13:19.