CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Issue while reading labelList cells_ of cellSetOption

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 4, 2024, 09:06
Default Issue while reading labelList cells_ of cellSetOption
  #1
Member
 
Marķa Rosales
Join Date: Mar 2023
Location: Spain
Posts: 48
Rep Power: 3
MMRC is on a distinguished road
Good day,

I wanted to implement some new features to actuationdisksource in Openfoam ESI 2012 and 2306 versions. I wanted to check if the scalar T computed was of the same value that the total amount applied in Usource[celli], so I added some new line codes to verify if there was a balance.

I checked it by adding to each method (Froude and variableScaling) something like:
Code:
     // (BJSB:Eq. 3.9)
    const scalar a = 1.0 - Cp/Ct;
    const scalar T = 2.0*rhoRef*diskArea_*magSqr(Uref & diskDir_)*a*(1 - a);
    scalar magSource = 0.0;
                scalar cellInCellSet = 0.0;
                scalar volumenCheck = 0.0; 
    for (const label celli : cells_)
    {
        Usource[celli] += ((cellsV[celli]/V())*T)*diskDir_;
        magSource += mag(Usource[celli] & diskDir_);
        cellInCellSet += 1.0;
        volumenCheck += (cellsV[celli]/V());
    }
                        /* DEBUG PART IV*/
                Info << "the variable cells_ is = " << cells() << endl;
                Info << "Volumen check via (cellsV[celli]/V()) " << volumenCheck << endl;
                Info << "Volumen check via V() " << V() << endl;
                Info << "Total cells check via cellInCellSet " << cellInCellSet << endl;
                Info << "Total thrust " << T << endl;
                Info << "Total Usource " << magSource << endl;

By running turbineSiting tutorial of ESI2306, the cellSets are of 484 cells but the counter 'cellInCellSet ' inside the for-loop finds 374, that is the same value seen when printing on screen cells(), that at the end is a ratio of 0.77 seen in volumenCheck. This also ends that magSource does not match with T



What could be the reason that original fvOption is not receiving the full list of cells selected in the cellZone/cellSet?


Or are there issues in my line codes?
MMRC is offline   Reply With Quote

Old   April 5, 2024, 16:26
Default
  #2
Member
 
Marķa Rosales
Join Date: Mar 2023
Location: Spain
Posts: 48
Rep Power: 3
MMRC is on a distinguished road
I'd say, issue solved! by adding this, magic happens:
reduce(magSource, sumOp<scalar>());
A new thing learned
MMRC is offline   Reply With Quote

Reply

Tags
actuationdisk, actuationdisksource, cellsets, fvoptions, programming


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[snappyHexMesh] snappyHexMesh sticking point natty_king OpenFOAM Meshing & Mesh Conversion 11 February 20, 2024 10:12
Averaging over iterations for steady-state simulation CFD student Fluent UDF and Scheme Programming 8 September 22, 2022 04:39
Postprocess: sampleDict works but creates no output folder shock77 OpenFOAM Post-Processing 14 November 15, 2021 09:27
Possible Bug in pimpleFoam (or createPatch) (or fluent3DMeshToFoam) cfdonline2mohsen OpenFOAM 3 October 21, 2013 10:28
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 06:42


All times are GMT -4. The time now is 01:42.