|
[Sponsors] |
Check if volumetric scalar field exists or is declared |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 3, 2017, 05:50 |
Check if volumetric scalar field exists or is declared
|
#1 |
Member
Rohit George Sebastian
Join Date: May 2017
Posts: 42
Rep Power: 9 |
Hello all!
Is there a way to check if a volumetric scalar field has already been declared? I have the following code for a function: Code:
Foam::tmp<Foam::volScalarField> Foam::viscosityModels::tempPowerLaw::calcNu() const { const volScalarField& T = U_.mesh().lookupObject<volScalarField>("T"); return a_*exp(b_*T) + c_*exp(d_*T); } Any suggestions? Thanks in advance!! |
|
November 12, 2020, 06:34 |
|
#2 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 |
just in case someone looks at this thread:
Code:
U_.mesh().foundObject<volScalarField>("T") returns true if T is found in the database and false if not |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
whats the cause of error? | immortality | OpenFOAM Running, Solving & CFD | 13 | March 24, 2021 08:15 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
issue compiling new turbulence model | perplexed user | OpenFOAM Programming & Development | 1 | January 13, 2012 04:40 |
[Netgen] Installation of Netgen in SuSE Linux 92 | edvardsenpriv | OpenFOAM Meshing & Mesh Conversion | 23 | January 16, 2009 07:12 |
How to get the max value of the whole field | waynezw0618 | OpenFOAM Running, Solving & CFD | 4 | June 17, 2008 06:07 |