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

How to access boundary field values located on other processors?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 8, 2023, 09:11
Default How to access boundary field values located on other processors?
  #1
New Member
 
Sreehari Perumanath
Join Date: Jun 2022
Posts: 28
Rep Power: 4
sreehahaha is on a distinguished road
Dear Foamers,

Hope you're having a great day.

I'm solving a scalar transport equation which happens to have a fvc::div(traction) in the governing equation. The field traction here is a 'surfaceScalarField'. For trial purposes, I initialised traction = scalar(1.0) uniformly. However, I'm using cyclic boundaries, and so I changed the values of one boundary (say leftPatch) to be the negative of its cyclic neighbourPatch (i.e. rightPatch). Now when I evaluate fvc::div(traction) to add to the governing equation, which will be a volScalarField, it is uniformly 0 everywhere. This is expected and I'm happy.

However, when I run the same code in parallel, the output of fvc::div(traction) is not uniformly 0 everywhere as it should be. I think this is because a given processor is not able to access boundaryField data that is located on another processor.

Is there a way to solve this issue? Please let me know.

Cheers,
S
sreehahaha is offline   Reply With Quote

Old   October 10, 2023, 16:21
Default
  #2
Senior Member
 
Klaus
Join Date: Mar 2009
Posts: 281
Rep Power: 22
klausb will become famous soon enough
Quote:
"...I think this is because a given processor is not able to access boundaryField data that is located on another processor. ..."
You may have to write the code to process data across processes or to transfer data between processes. A good starting point to learn about it is the following programming tutorial:

https://github.com/UnnamedMoose/Basi.../OFtutorial5.C
klausb is offline   Reply With Quote

Old   October 11, 2023, 04:25
Default
  #3
New Member
 
Sreehari Perumanath
Join Date: Jun 2022
Posts: 28
Rep Power: 4
sreehahaha is on a distinguished road
Thank you Klausb. The link you sent will be definitely helpful.

Furthermore,
1. Could you please tell me how I can change the values of the "surfaceScalarField traction" at processor boundaries? Preferably using a loop. I saw some posts here suggesting to use pos(), neg() functions that avoid using a loop. However, in my case, I will have to give certain values to 'traction' at run time. I'm not sure if this can be done without using a for loop.

2. What does correctBoundaryConditions() do exactly? I read that it corrects the pressure values at processor boundaries when you give p.correctBoundaryConditions(). However, in my case, I only have a surfaceScalarField. So, I cannot do traction.correctBoundaryConditions(). I'm a bit confused how it works.

Thanks again,
S
sreehahaha is offline   Reply With Quote

Old   October 11, 2023, 07:03
Default
  #4
Senior Member
 
Klaus
Join Date: Mar 2009
Posts: 281
Rep Power: 22
klausb will become famous soon enough
Dealing with processor boundaries is tricky.

Regarding 1: Read the following but you'll have to develop your own solution. Pout and Info are your friends to see what's going on at local and global level during develoment.

#4: Access patch points (on different processor) in parallel
http://www.wolfdynamics.com/training...g_openfoam.pdf
Flux at processor boundary
Neighbouring processor number for a patch
Access processor patches in parallel run
klausb is offline   Reply With Quote

Old   October 12, 2023, 03:06
Default
  #5
New Member
 
Sreehari Perumanath
Join Date: Jun 2022
Posts: 28
Rep Power: 4
sreehahaha is on a distinguished road
Thank you so much Klausb, I will have a look at these.

Have a great day!
SP
sreehahaha is offline   Reply With Quote

Reply

Tags
boundary condition, field acces, parallel computaion


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
Foam::error::PrintStack almir OpenFOAM Running, Solving & CFD 92 May 21, 2024 08:56
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 08:38
[Other] dynamicTopoFVMesh and pointDisplacement RandomUser OpenFOAM Meshing & Mesh Conversion 6 April 26, 2018 08:30
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 18:44
Low Mixing time Problem Mavier CFX 5 April 29, 2013 01:00


All times are GMT -4. The time now is 20:33.