|
[Sponsors] |
Access member function from a class in coded function object |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 25, 2024, 17:19 |
Access member function from a class in coded function object
|
#1 |
Senior Member
Julio Pieri
Join Date: Sep 2017
Posts: 109
Rep Power: 9 |
Hello all,
I'm on OF-11 writing a coded source to consume a specie based on the mass transfer coeff calculated inside Frossling.C massTransferModel. I'm trying to access the K() member function (which returns the mass transfer coeff), but it doesn't work. I tried many things, and the most promising is this one: Code:
codeAddAlphaRhoSup #{ const Time& time = mesh().time(); const scalar startTime = 0.2; // avoid possibility of field not being created yet const vectorField& C = mesh().C(); if (time.value() > startTime) { const Foam::diffusiveMassTransferModels::Frossling& massModel = mesh().thisDb().lookupObject<Foam::diffusiveMassTransferModels::Frossling>("Frossling"); const scalarField& K = massModel .K(); Info << "K = " << K << endl; } // const volScalarField& O2 = mesh().lookupObject<volScalarField>("O2.water"); // scalarField& source = eqn.source(); // source = kLa*(1e-3-O2); #}; Code:
--> FOAM FATAL ERROR: request for Frossling Frossling from objectRegistry region0 failed available objects of type Frossling are 0() Thank you! Here is the source code: https://cpp.openfoam.org/v12/Frossling_8H_source.html Note that I've checked many post, including these: codeInclude in coded function in controlDict, and yPlus Error: Request from objectRegistry failed Extract a member function from a class by using autoPtr -> post number 5 seem to have the answer, but it's beyond my C++ understanding |
|
Tags |
coded, coded source, codedscalarsource, frossling, member function |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] mesh airfoil NACA0012 | anand_30 | OpenFOAM Meshing & Mesh Conversion | 13 | March 7, 2022 18:22 |
[OpenFOAM] Native ParaView Reader Bugs | tj22 | ParaView | 270 | January 4, 2016 12:39 |
latest OpenFOAM-1.6.x from git failed to compile | phsieh2005 | OpenFOAM Bugs | 25 | February 9, 2010 05:37 |
Version 15 on Mac OS X | gschaider | OpenFOAM Installation | 113 | December 2, 2009 11:23 |
Compilation error OF1.5-dev on Suse10.3 | darenyang | OpenFOAM Installation | 0 | April 29, 2009 05:55 |