# Defining power distribution to a region

 Register Blogs Members List Search Today's Posts Mark Forums Read

 May 29, 2024, 14:26 Defining power distribution to a region #1 New Member   george Join Date: Feb 2021 Posts: 16 Rep Power: 5 Hello, Below, there is a power distribution that varies only with height for a solid channel. 1)Since we are defining enthalpy, is the energy generation for each cell defined in Joules or Joules per kilogram? If it is in Joules per kilogram, does it require any changes in fvOptions?2)Why is source[i] -= Equation used in the syntax instead of source[i] = Equation even though there is no increase or decrease over time? Also, when I change it to source[i] += Equation, no power generation occurs. 3)Despite having a constant defined power value for each cell in the first iteration, why do the expected temperatures occur after a certain iteration? Could it be due to the initial conditions? Code: ```powerDist { type scalarCodedSource; name PS; scalarCodedSourceCoeffs { selectionMode cellZone; cellZone solidRegion; fields (h); codeInclude #{ #}; codeCorrect #{ #}; codeAddSupRho #{ const scalarField& zAx = mesh_.C().component(2); //const scalarField& cellVolumes = mesh_.V(); scalarField& source = eqn.source(); forAll(zAx, i) { scalar zValue = zAx[i]; //scalar cellVolume = cellVolumes[i]; scalar eqq = sin(zValue); // long polynomial source equation source[i] -= eqq; } #}; codeConstrain #{ #}; } }``` regards scfd Last edited by scfd; June 5, 2024 at 07:43. Reason: grammer

 Tags fvoptions, power, source