|
[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:16 |
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(m^2/s^2) 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 |
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 | ordinary | OpenFOAM Installation | 19 | September 3, 2019 18:13 |
Problem compiling a custom Lagrangian library | brbbhatti | OpenFOAM Programming & Development | 2 | July 7, 2014 11:32 |
Trouble compiling utilities using source-built OpenFOAM | Artur | OpenFOAM Programming & Development | 14 | October 29, 2013 10:59 |
[swak4Foam] build problem swak4Foam OF 2.2.0 | mcathela | OpenFOAM Community Contributions | 14 | April 23, 2013 13:59 |
DecomposePar links against liblamso0 with OpenMPI | jens_klostermann | OpenFOAM Bugs | 11 | June 28, 2007 17:51 |