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

How could I access temperature T and density rho from a turbulenceModel library?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 23, 2022, 16:11
Default How could I access temperature T and density rho from a turbulenceModel library?
  #1
New Member
 
Anuar Giménez
Join Date: Feb 2022
Location: Spain
Posts: 15
Rep Power: 4
anuargimenez is on a distinguished road
Hello Foamers,

I am trying to add a temperature dependent viscosity model to use it in a compressible solver (rhoSimpleFoam). For that, I need to modify the CrossPowerLaw model in src/TurbulenceModels/turbulenceModels/laminar/generalizedNewtonian/generalizedNewtonianViscosityModels/CrossPowerLaw and add a Temperature and Density dependent expression.

I tried to acces theese variables with:

const volScalarField& T = U_.mesh().lookupObject<volScalarField>("T");
const volScalarField& rho = U_.mesh().lookupObject<volScalarField>("rho");

But when I compile i get this error:
Code:
CrossWLF.C: In member function ‘virtual Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::laminarModels::generalizedNewtonianViscosityModels::CrossWLF::nu(const volScalarField&, const volScalarField&) const’:
CrossWLF.C:119:28: error: ‘U_’ was not declared in this scope; did you mean ‘m_’?
  119 |  const volScalarField& T = U_.mesh().lookupObject<volScalarField>("T");
      |                            ^~
      |                            m_
CrossWLF.C:119:65: error: expected primary-expression before ‘>’ token
  119 |  const volScalarField& T = U_.mesh().lookupObject<volScalarField>("T");
      |                                                                 ^
Any advice would be very helpfull.
Thank you very much in advance for your help!!
anuargimenez is offline   Reply With Quote

Reply

Tags
openfoam


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] libOpenSMOKE Tobi OpenFOAM Community Contributions 562 January 25, 2023 10:21
Ansys CFX problem: unexpected very high temperatures in premix laminar combustion faizan_habib7 CFX 4 February 1, 2016 18:00
Water subcooled boiling Attesz CFX 7 January 5, 2013 04:32
REAL GAS UDF brian FLUENT 6 September 11, 2006 09:23
Warning 097- AB Siemens 6 November 15, 2004 05:41


All times are GMT -4. The time now is 16:15.