View Issue Details

IDProjectCategoryView StatusLast Update
0004164OpenFOAMBugpublic2024-10-15 16:35
ReporterLilla Kapa Koloszar Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
PlatformGNU/LinuxOSOtherOS Version(please specify)
Product Version12 
Summary0004164: coded source cellZone
DescriptionWhen I select a coded source be active in a cellZone, it is still applied for every cell. The only way to restrict is to put it into the code:

        codeAddRhoSup
        #{
                const scalarField& V = mesh().V();
                vectorField& USource = eqn.source();
                vector zVector(0,0,1);
        
        scalar volume = 0.32;
        
        scalar head = 2.2e5/volume; // nominal 2.2e5

        label zoneID = mesh().cellZones().findZoneID("zone_pump1");
        const List<label> zoneCells = mesh().cellZones()[zoneID];

        
        forAll(zoneCells, i)
        {
          label cellI = zoneCells[i];
          USource[cellI] -= head*V[cellI]*zVector;
        }

        #};

I can set up an easy case, if it can help with this issue.
TagsNo tags attached.

Activities

henry

2024-10-15 16:35

manager   ~0013431

The code you supplied is correct as far as I can see, any further help would come under user-support.

Issue History

Date Modified Username Field Change
2024-10-15 16:14 Lilla Kapa Koloszar New Issue
2024-10-15 16:35 henry Assigned To => henry
2024-10-15 16:35 henry Status new => closed
2024-10-15 16:35 henry Resolution open => no change required
2024-10-15 16:35 henry Note Added: 0013431