|
[Sponsors] |
January 25, 2022, 14:59 |
coded energysource in fvModels
|
#1 |
New Member
Per Nilsson
Join Date: Mar 2009
Location: Lund, Sweden
Posts: 21
Rep Power: 17 |
In OF8, I used "scalarCodedSource" in fvOptions to add a source to the field e. The source term is a function of coordinate and resides in a field, sourceTerm.
In OF9, I had to rephrase a bit to "coded" in fvModels to get it running. It does however not seem to add any source in the energy equation - the temperatures are unaffected by it. Would you have an idea why (or alternatives how to add a constant heat source which is a function of coordinate)? Code:
energySource { type coded; selectionMode all; field e; codeAddSup #{ Pout<< "**codeAddSup**" << endl; volScalarField ST ( IOobject ( "sourceTerm", "0", mesh(), IOobject::MUST_READ, IOobject::NO_WRITE ), mesh() ); const scalarField& V = mesh().V(); scalarField& heSource = eqn.source(); //heSource = 1e8; heSource = -1*ST*V; #}; } |
|
Tags |
coded, fvmodels, fvoptions, heatsource |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Accessing species in coded function object | Swirl | OpenFOAM Programming & Development | 2 | January 24, 2022 04:52 |
coded functionObjects behaving not as expected | alexfells | OpenFOAM | 2 | October 28, 2020 03:58 |
Coded function object in openfoam v5 | kit607 | OpenFOAM Post-Processing | 3 | September 29, 2020 15:43 |
Unknown character in name of output variable when using coded function object | pvergnol | OpenFOAM Post-Processing | 5 | August 12, 2020 13:29 |
codeInclude in coded function in controlDict, and yPlus | LuisAlberto | OpenFOAM Programming & Development | 4 | August 18, 2015 12:48 |