|
[Sponsors] |
December 15, 2011, 04:33 |
Type conversion question
|
#1 |
Member
Yuri Feldman
Join Date: Mar 2011
Posts: 30
Rep Power: 15 |
Dear forum,
I need to compare the value of z coordinate of my boundary mesh with some variable, let say of a double or scalar type scalar min=10.0; forAll (ccSph.boundaryField(), patchI) { ccSph.boundaryField()[patchI] = sph.localVector(mesh.C().boundaryField()[patchI]); if (ccSph.boundaryField()[patchI].component(vector::Z)>max) {do something }; } Unfortunately this code does not pass compilation, since the first argument in if return reference to a surface field. How can I circumvent the problem? Is there any standard way of type conversion in OpenFoam. Many thanks, Yuri |
|
December 15, 2011, 04:50 |
|
#2 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
Hi Yuri
You are comparing a scalarField with a scalar, which does not make much sense. Instead, you should loop over the scalarField and make the comparison one boundary face at the time. Best regards, Niels |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
compilation problem with "fvPatch::lookupPatchField" | Ya_Squall2010 | OpenFOAM Programming & Development | 9 | November 15, 2021 23:01 |
[Commercial meshers] Fluent3DMeshToFoam | simvun | OpenFOAM Meshing & Mesh Conversion | 50 | January 19, 2020 16:33 |
[CGNS] CGNS converters available | mbeaudoin | OpenFOAM Meshing & Mesh Conversion | 137 | December 14, 2018 05:20 |
boundary conditions for simpleFoam calculation | foam_noob | OpenFOAM Running, Solving & CFD | 8 | July 1, 2015 09:07 |
[Other] cgnsToFoam problems with "QUAD_4" cells | lentschi | OpenFOAM Meshing & Mesh Conversion | 1 | March 9, 2011 05:49 |