|
[Sponsors] |
Access field from different region in chtMultiRegionFoam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 21, 2017, 11:35 |
Access field from different region in chtMultiRegionFoam
|
#1 |
New Member
Join Date: Oct 2016
Posts: 20
Rep Power: 10 |
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. |
|
|
|
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 |