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:16
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(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				
	)
      );
     }	
}
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
[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


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