|
[Sponsors] |
Problem compiling solver using lookupOrDefault() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 17, 2022, 12:41 |
Problem compiling solver using lookupOrDefault()
|
#1 |
Member
Join Date: Jun 2020
Posts: 49
Rep Power: 6 |
Hello everyone,
I am currently trying to modify the reactingFoam solver. I am adding the function to define Schmidt numbers for each species using a subdict in the combustionProperties file. In the first stage this was done using a simple lookup() command and worked perfectly. Now I want to add a functionality, that sets the Schmidt number to 1 for all species, where there is no entry in the dict. For that I intend to use lookupOrDefault(). This is the line of code I am using for that particular operation: Code:
scalar Sck = readScalar(SchmidtNrDict.lookupOrDefault(Y[i].name(), 1.0)); Code:
no matching function for call to 'readScalar(double)' It would be great if someone could help me find the mistake! Thanks! |
|
January 17, 2022, 12:54 |
Solved
|
#2 |
Member
Join Date: Jun 2020
Posts: 49
Rep Power: 6 |
Ok, I solved the problem. In case anyone ever runs into this problem again (or perhaps I am just extremely bad at programming ) the lookupOrDefault() function automatically returns the value of the entry you are searching for. This means that readScalar() was unnecessary.
Correct code is: Code:
scalar Sck = SchmidtNrDict.lookupOrDefault<scalar>(Y[i].name(), 1.0); |
|
Tags |
compilation error, lookupordefault, readscalar |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem in compiling Euler Local Ddt scheme in existing solver? | BSengupta | OpenFOAM | 0 | March 17, 2020 22:15 |
Is there a problem in the Euler solver? | Combas | SU2 | 4 | March 28, 2014 16:48 |
Problem with compiling new solver | palazi88 | OpenFOAM Programming & Development | 2 | December 24, 2013 20:52 |
Problem in Compiling the solver | m.maneshi | OpenFOAM Running, Solving & CFD | 4 | November 3, 2010 03:07 |
Mashing Problem? | ji | CFX | 2 | April 4, 2002 06:03 |