|
[Sponsors] |
How to adress boundary patch from another region in chtMultiRegionFoam? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 20, 2021, 07:17 |
How to adress boundary patch from another region in chtMultiRegionFoam?
|
#1 |
New Member
Join Date: Feb 2021
Posts: 2
Rep Power: 0 |
Hello,
I am simulating a heat transfer model which includes one fluid region and one solid region, using the solver chtMultiRegionFoam in OFv8. The boundary condition codedFixedValue is used for the temperature setting of one fluid region patch A. I need to access the temperature feld of another fluid region patch B and the wallHeatFlux feld of one solid region patch C. It has worked wonderful with following code to read the temperature feld of patch B in fluid region: Code:
word patchName_patchB = "patchB"; const label patchB_ID = this->patch().boundaryMesh().findPatchID(patchName_patchB); const volScalarField &T = db().objectRegistry::lookupObject<volScalarField>("T"); const scalarField &T_patchB_sf = T.boundaryField()[patchB_ID]; scalar T_patchB = Foam::average(T_patchB_sf); The question is:
Anyone has an idea how to solve this problem would be very appreciated, thanks. Last edited by Aniy; July 21, 2021 at 03:17. |
|
October 7, 2021, 08:56 |
|
#2 |
New Member
Marius
Join Date: Aug 2020
Location: Germany
Posts: 11
Rep Power: 6 |
Hi there,
I managed to find a solution to the problem. (Tested with a fixedValue BC in region fluid). Basically you can access the mesh of a different region (i.e. solid) by creating a pointer: Code:
const fvMesh &solidFvMesh = db().parent().objectRegistry::lookupObject<fvMesh>("solid"); Code:
const volScalarField &solidT = solidFvMesh.thisDb().objectRegistry::lookupObject<volScalarField>( "T"); Info << "Average temperature in solid:patchC: " << gAverage( solidT.boundaryField()[solidFvMesh.boundaryMesh().findPatchID("patchC")]) << endl; Code:
solidFvMesh.thisDb().lookupObject<IOdictionary>("thermophysicalProperties") |
|
Tags |
#chtmultiregionfoam, #codedfixedvalue |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Radiation in semi-transparent media with surface-to-surface model? | mpeppels | CFX | 11 | August 22, 2019 08:30 |
Error finding variable "THERMX" | sunilpatil | CFX | 8 | April 26, 2013 08:00 |
Cyclic Boundary Condition | Luiz Eduardo Bittencourt Sampaio (Sampaio) | OpenFOAM Running, Solving & CFD | 36 | July 2, 2012 13:23 |
Convective Heat Transfer - Heat Exchanger | Mark | CFX | 6 | November 15, 2004 16:55 |
Multicomponent fluid | Andrea | CFX | 2 | October 11, 2004 06:12 |