|
[Sponsors] |
Comparing a dimensioned volScalarField to a constant in LES model's .C file |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 7, 2022, 13:17 |
Comparing a dimensioned volScalarField to a constant in LES model's .C file
|
#1 |
New Member
Teresa Sun
Join Date: Jun 2021
Posts: 21
Rep Power: 5 |
The issue happens while implementing an eddy-viscosity model that is based on Smagorinsky model.
We want to compare the dimensioned volScalarField to a constant in .C file, for instance, Smagorinsky.C. Code:
template<class BasicTurbulenceModel> tmp<volScalarField> QR<BasicTurbulenceModel>::k ( const tmp<volTensorField>& gradU ) const { volSymmTensorField D(symm(gradU)); volScalarField r(max(-det(D),dimensionedScalar("r",dimensionSet(0, 0, -3, 0, 0, 0, 0), 0.0))); new volScalarField ( IOobject ( "q1", this->runTime_.timeName(), this->mesh_, IOobject::NO_READ, IOobject::NO_WRITE ), this->mesh_, dimensionedScalar("q1", dimensionSet(0,0,-2,0,0,0,0), 1e-6) ); if ( q < q1 ) { volScalarField r1(0.0*(-det(D))); return tmp<volScalarField> ( new volScalarField ( IOobject ( IOobject::groupName("k",this->alphaRhoPhi_.group()), this->runTime_.timeName(), this->mesh_ ), r1 ); } else { return tmp<volScalarField> ( new volScalarField ( IOobject ( IOobject::groupName("k", this->alphaRhoPhi_.group()), this->runTime_.timeName(), this->mesh_ ), mag(r)/q ) ); } } Code:
'q1' was not declared in this scope Any point would be great appreciated! Teresa |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[openSmoke] LaminarSMOKE compilation error | mdhfiz | OpenFOAM Community Contributions | 8 | July 2, 2024 10:32 |
[swak4Foam] swak4foam for OpenFOAM 4.0 | mnikku | OpenFOAM Community Contributions | 80 | May 17, 2022 08:06 |
Trouble compiling utilities using source-built OpenFOAM | Artur | OpenFOAM Programming & Development | 14 | October 29, 2013 10:59 |
[swak4Foam] Error bulding swak4Foam | sfigato | OpenFOAM Community Contributions | 18 | August 22, 2013 12:41 |
[swak4Foam] funkySetFields compilation error | tayo | OpenFOAM Community Contributions | 39 | December 3, 2012 05:18 |