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

Access field from different region in chtMultiRegionFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By JoeFriend

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 21, 2017, 11:35
Smile Access field from different region in chtMultiRegionFoam
  #1
New Member
 
Join Date: Oct 2016
Posts: 20
Rep Power: 10
JoeFriend is on a distinguished road
Hi, I'm programming a boundary condition for a multi region case (based on compressible::turbulentTemperatureCoupledBaffleMix ed), and I need to access the temperature value of an specific cell in a patch called "maxY".

This is what I've been doing:

const volScalarField& T = db().lookupObject<volScalarField>("T");
const fvMesh& mesh = patch().boundaryMesh().mesh();
label PatchId = mesh.boundaryMesh().findPatchID("maxY");
scalar firstT = T.boundaryField()[PatchId][0]; // face value of the first cell in the patch called "maxY"

I want to assign this value (firstT) to "refGradient" in the BC "turbulentTemperatureCoupledBaffleMixedFvPatchScal arField". The BC compilation is ok, but the solver crashes when it has to solve the temperature fields.

(1) Is there something wrong with the code I wrote?
(2) Does the cell indexes change when decomposing the mesh?
(3) Is it possible to access a field value from an specific cell in a different region? I couldn't find related issues in forums.

I would appreciate any help! Thanks.
ssc0109 and parthigcar like this.
JoeFriend 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
chtMultiRegionFoam connection between solid and fluid region of heat exchanger ahab OpenFOAM 1 December 18, 2019 01:37
conjugate heat transfer in OpenFOAM skuznet OpenFOAM Running, Solving & CFD 99 March 16, 2017 06:07
chtMultiRegionFoam - solving only energy equation with freezing low field phsieh2005 OpenFOAM Running, Solving & CFD 0 July 6, 2016 12:38
modified chtMultiRegionFOAM: how to exchange the pressure field between two regions? rou OpenFOAM Programming & Development 4 December 28, 2015 12:31
[Commercial meshers] Using starToFoam clo OpenFOAM Meshing & Mesh Conversion 33 September 26, 2012 05:04


All times are GMT -4. The time now is 15:00.