|
[Sponsors] |
![]() |
![]() |
#21 |
New Member
Vittorio Nardin
Join Date: Jun 2023
Posts: 5
Rep Power: 3 ![]() |
You must create a loop inside your code to assign the source in the the cells even using selectionMode cellZone:
volScalarField myField ( IOobject ( "myField", "0", mesh(), IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh() ); const labelList& myCells = mesh().cellZones()["myZone"]; then forAll(myCell, i) { myField[myCell[i]] = 1; } scalarField& mySource = eqn.source(); mySource += myField; |
|
![]() |
![]() |
![]() |
![]() |
#22 |
New Member
Shubham
Join Date: Jan 2024
Posts: 8
Rep Power: 2 ![]() |
Thank you for your prompt responses.
The absence of a loop in my implementation is a major issue. I presumed that specifying the "cellZone" within the "selectionMode" parameter would inherently apply the source term to the designated zone. Thanks once again ![]() ![]() |
|
![]() |
![]() |
![]() |
Tags |
coded, fvmodels, fvoptions, heatsource |
|
|
![]() |
||||
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 |