CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Comparing a dimensioned volScalarField to a constant in LES model's .C file

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 7, 2022, 13:17
Default 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
Teresa Sun is on a distinguished road
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				
	)
      );
     }	
}
The error message is
Code:
'q1' was not declared in this scope

Any point would be great appreciated!
Teresa
Teresa Sun is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 03:24.