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

Accessing boudaryField

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 1, 2017, 15:29
Default Accessing boundaryField
  #1
Member
 
Sugajen
Join Date: Jan 2012
Location: Tempe, USA
Posts: 52
Rep Power: 14
Sugajen is on a distinguished road
Hi all,

I am trying to access the boundaryField of velocity and modify that and use it for the next time step calculations. I read in the post New problem in version 4.0! The boundary field become read only! that we have to use boundaryFieldRef inorder to access it, else it throws an error saying the field is read only. I did as suggested but still the values are not reflected on the output. Are Ref fields only for reference and not for next time step or post-processing?

Below is my piece of code in the solver that converts a scalarField'Jw' into a vectorField 'U'.
Code:
 label upMem = mesh.boundaryMesh().findPatchID("upperMembrane");
forAll( U.boundaryFieldRef()[upMem], i)
{
	U.boundaryFieldRef()[upMem][i].component(vector::X) = 0;
	U.boundaryFieldRef()[upMem][i].component(vector::Y) = 0;
	U.boundaryFieldRef()[upMem][i].component(vector::Z) = Jw.boundaryFieldRef()[upMem][i];

}

Last edited by Sugajen; June 2, 2017 at 14:14. Reason: typo
Sugajen is offline   Reply With Quote

Old   June 2, 2017, 14:17
Default Solved
  #2
Member
 
Sugajen
Join Date: Jan 2012
Location: Tempe, USA
Posts: 52
Rep Power: 14
Sugajen is on a distinguished road
I was using noSlip boundary condition for U on the patches where I wanted to change the values. When I changed it to fixed Value (0,0,0), the code that I wrote in the solver was implemented. Hope that helps anyone else with similar issue!
Sugajen 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
Problem accessing material properties in UDF for Multiphase Multispecies pmtgt Fluent Multiphase 3 January 17, 2021 07:11
Accessing node values using a UDF Nico FLUENT 2 December 20, 2007 02:50
How to define a Macro accessing rad intensity Grey FLUENT 0 May 21, 2007 00:12
Problem accessing Temp. Gradient . . . Satish FLUENT 16 December 16, 2003 13:44
Accessing solution data in UDF Ale FLUENT 1 June 12, 2002 00:25


All times are GMT -4. The time now is 07:57.