|
[Sponsors] |
scalarCodedSource how to access to field instance |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 29, 2019, 15:24 |
scalarCodedSource how to access to field instance
|
#1 |
New Member
Join Date: Jun 2019
Posts: 15
Rep Power: 7 |
Hello
I am using scalarCodedSource in fvOptions. Currently, I am solving my case with laplacianFoam. I want to access to the T field from the codeAddSup section I tried the following: Code:
... codeAddSup #{ Info << "Inside codeAddSup" << endl; scalarField& T = this->db(); // This doesn't work scalarField& T = *this // This also doesn't work #}; ... In general, for other solvers, say, (simpleFoam, pimpleFoam, ...etc) how can I access other fields, say: velocity, pressure, epsilon, ....etc? Thank you |
|
June 30, 2019, 21:51 |
|
#2 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
Have you tried
Code:
volScalarField T = mesh().lookupObject<volScalarField>("T") |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Access and compare volume Scalar Field value of a cell with neighbouring cell | upuli | OpenFOAM Programming & Development | 0 | November 5, 2018 00:05 |
New Solver error Foam::error::printStack | upuli | OpenFOAM Running, Solving & CFD | 4 | May 11, 2018 02:43 |
potential flows, helmholtz decomposition and other stuffs | pigna | Main CFD Forum | 1 | October 26, 2017 09:34 |
access to field data | sepp | OpenFOAM Programming & Development | 0 | February 15, 2011 10:13 |
Access to field data | sepp | OpenFOAM | 2 | February 10, 2011 12:45 |