|
[Sponsors] |
May 5, 2024, 15:07 |
Interpolation for fvPatchField
|
#1 |
New Member
Junyu Ni
Join Date: Sep 2022
Posts: 3
Rep Power: 4 |
Hi, everyone. I'm about to write a dynamic boundary with codedFixedValue.
I want to use the pressure to force the boundary deform and move, so I need the pressure value on the boundary points. Now I can successfully obtain the pressure on the volume center on the boundary by the following code: PHP Code:
Maybe there are also some other ways to get boundary points infomation that I don't know, so any suggestions or discussions would be helpful. Thanks in advance! |
|
May 6, 2024, 04:18 |
|
#2 |
New Member
Junyu Ni
Join Date: Sep 2022
Posts: 3
Rep Power: 4 |
OK, I found a way: use primitivePatchInterpolation. It returns the field on the boundary point. Here is the corresponding code and "primitivePatchInterpolation.H" should be included.
Code:
const volScalarField& tempP = this->db().objectRegistry::lookupObject<volScalarField>("p"); const scalarField& cylinderFaceP = tempP.boundaryField()[cylinderID]; primitivePatchInterpolation facePointInterpP(tempP.mesh().boundaryMesh()[cylinderID]); auto cylinderP = facePointInterpP.faceToPointInterpolate(cylinderFaceP)(); By the way, I found that openFoam8 has both "primitivePatchInterpolation" and "PrimitivePatchInterpolation" class. When the upper letter case is selected, the errors will be reported. And also, it is valid to declare cylinderFaceP either as "scalarField&" type or "fvPatchField<scalar>" type, but the latter one cannot match the argument of the interpolation function. |
|
Tags |
boundary, codedfixedvalue, fvpatchfield, interpolate |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mapping (interpolation) between two meshes | Ebrahim | OpenFOAM Programming & Development | 2 | June 15, 2020 14:31 |
[ANSYS Meshing] Error in Workbench "Unable to attach to geometry file" | Jeremie84 | ANSYS Meshing & Geometry | 70 | October 25, 2017 17:03 |
Am I using the Interpolation Function Correctly? | Andrew Norfolk | CFX | 3 | July 21, 2016 11:26 |
Interpolation with multiple weighing criteria | i_m3_mys3lf | Main CFD Forum | 13 | May 11, 2015 12:03 |
Surface interpolation schemes and parallelization | jutta | OpenFOAM Running, Solving & CFD | 0 | February 25, 2010 15:32 |