|
[Sponsors] | |||||
How to access an another patch from fvPatchFields? |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
New Member
Eduardo Paiva
Join Date: Jul 2020
Posts: 5
Rep Power: 7 ![]() |
Hey guys, this is my first post here and I'm beginner on OpenFOAM and undergraduating.
I'm using of1812 and I need to develop a new boundary condition. Basiclly, I have a duct and that boundary condition is for p_rgh of outlet face. So, I need access the wall patch to apply a correlation that outlet face. What can I do for that? I'm found in this forum something like this: // Get the mesh const fvMesh& mesh(patch().boundaryMesh().mesh()); label patchID = mesh.boundaryMesh().findPatchID(wallName_); const polyPatch& cPatch = mesh.boundaryMesh()[patchID]; const surfaceScalarField& magSf = mesh.magSf(); scalar patchArea = 0.0; forAll(cPatch, facei) { patchArea += magSf.boundaryField()[patchID][facei]; } I want to do something similar, but I cannot do mesh.p_rgh(), for exampĺe. Someone knows how can I code this? Thanks for helping
|
|
|
|
|
|
|
|
|
#2 |
|
New Member
Eduardo Paiva
Join Date: Jul 2020
Posts: 5
Rep Power: 7 ![]() |
A colleague helped me, here's the answer:
// Get the mesh const fvMesh& mesh(patch().boundaryMesh().mesh()); label patchID = mesh.boundaryMesh().findPatchID(wallName_); const volScalarField& p_rgh_ = this->db().lookupObject<volScalarField>("p_rgh"); const scalarField& pp_rgh_ = p_rgh_.boundaryField()[patchID]; const scalar pWall = gAverage(pp_rgh_); |
|
|
|
|
|
![]() |
| Tags |
| access, boundary condition., fvpatchfield, patches |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Commercial meshers] Fluent3DMeshToFoam | simvun | OpenFOAM Meshing & Mesh Conversion | 50 | January 19, 2020 16:33 |
| [snappyHexMesh] SHM Layer Addition Phase | dickcruz | OpenFOAM Meshing & Mesh Conversion | 4 | November 1, 2018 08:05 |
| [Other] dynamicTopoFVMesh and pointDisplacement | RandomUser | OpenFOAM Meshing & Mesh Conversion | 6 | April 26, 2018 08:30 |
| Cyclic Boundary Condition | Luiz Eduardo Bittencourt Sampaio (Sampaio) | OpenFOAM Running, Solving & CFD | 36 | July 2, 2012 13:23 |
| [Gmsh] Import gmsh msh to Foam | adorean | OpenFOAM Meshing & Mesh Conversion | 24 | April 27, 2005 09:19 |