|
[Sponsors] |
![]() |
![]() |
#1 |
Senior Member
Guilherme
Join Date: Apr 2017
Posts: 246
Rep Power: 10 ![]() |
Hi,
I'm having trouble implementing if logic in my code (OpenFOAM 9). I need help. Code:
const volScalarField Lt(this->Lt()); const volScalarField delta(this->delta()); const scalar tmp = 0; if (Lt == delta) { tmp = Ck_*sqrt(k_)*Lt; } this->nut_ = tmp this->nut_.correctBoundaryConditions(); fvConstraints::New(this->mesh_).constrain(this->nut_); ERROR: Code:
error: no match for ‘operator==’ (operand types are ‘const volScalarField’ {aka ‘const Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>’} and ‘const volScalarField’ {aka ‘const Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>’}) 229 | if (Lt == delta) | ~~ ^~ ~~~~~ | | | | | GeometricField<[...],[...],[...]> | GeometricField<[...],[...],[...]> error: assignment of read-only variable ‘tmp’ 231 | tmp = Ck_*sqrt(k_)*Lt; Thanks |
|
![]() |
![]() |
![]() |
![]() |
#2 |
New Member
Jim Park
Join Date: Nov 2020
Posts: 5
Rep Power: 6 ![]() |
Have you tried .internalField()?
For example, if (Lt.internalField() == delta.internalField()) ... |
|
![]() |
![]() |
![]() |
Tags |
openfoam9 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[mesh manipulation] [Error] Wedge patch 'frontAndBackPlanes' is not planar | Danny_cfd | OpenFOAM Meshing & Mesh Conversion | 0 | June 4, 2021 10:32 |
[Error] SIGSERV when continuing simulation | Luiz | FLUENT | 0 | March 28, 2019 18:52 |
[Error] Fluent Not Responding on Workbench Environment | Luiz | FLUENT | 8 | September 5, 2018 22:55 |
can anyone explian the logic behind defining the vertices | gandesk | OpenFOAM | 3 | November 11, 2010 01:18 |
Streamline plotting logic | soggy316 | Main CFD Forum | 8 | July 10, 2009 09:14 |