|
[Sponsors] |
February 18, 2024, 16:45 |
How to access field values in openFOAM
|
#1 |
New Member
hesam
Join Date: Dec 2013
Posts: 9
Rep Power: 13 |
Hello,
My question is how to access openFOAM fields (density, velocity, temperature, user-defined scalar, etc.) in openFOAM functions. For example, how can I define my energy source in the following scalarCodedSource as a function of my user-defined scalar "wT"? I'm using chtMultiRegionSimpleFoam solver. ---Here's my function to add the scalar transport equation "wT" in the controlDict dictionary: functions { Adsorption { type scalarTransport; libs (solverFunctionObjects); resetOnStartUp no; field wT; D 0.1; fvOptions { } } } ---Here's the scalarCodedSource in my fvOptions: codedSource { type scalarCodedSource; selectionMode all; fields (h); name sourceVelocity; codeCorrect #{ #}; codeConstrain #{ #}; codeAddSup #{ // How do I access w_T here? const scalarField& cellx = mesh_.C().component(0); forAll(cellx, i) { heSource[i] += "I need to use w_T here"; }; #}; } Thank you very much. |
|
Tags |
field values, function objects, openfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to contribute to the community of OpenFOAM users and to the OpenFOAM technology | wyldckat | OpenFOAM | 17 | November 10, 2017 16:54 |
OpenFOAM 4.0 Released | CFDFoundation | OpenFOAM Announcements from OpenFOAM Foundation | 2 | October 6, 2017 06:40 |
Direction of B field and electric field in OpenFOAM (mhdFOAM) | adkar | Electromagnetics | 1 | April 26, 2016 01:02 |
OpenFOAM v3.0.1 Training, London, Houston, Berlin, Jan-Mar 2016 | cfd.direct | OpenFOAM Announcements from Other Sources | 0 | January 5, 2016 04:18 |
Setting patch field values equal to internal field values | leroyv | OpenFOAM Programming & Development | 1 | October 21, 2014 16:49 |