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

Defining power distribution to a region

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 29, 2024, 15:26
Post Defining power distribution to a region
  #1
New Member
 
george
Join Date: Feb 2021
Posts: 16
Rep Power: 5
scfd is on a distinguished road
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 08:43. Reason: grammer
scfd is offline   Reply With Quote

Reply

Tags
fvoptions, power, source


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
Problem with chtMultiregionFoam radiation boundary condition baran_foam OpenFOAM Running, Solving & CFD 10 December 17, 2019 18:36
Defining the region between two layers of fluid in a reacting flow bamidoao FLUENT 0 February 15, 2017 22:49
Taking too much for run Grimoli OpenFOAM Running, Solving & CFD 5 November 26, 2013 21:07
Variable distribution over a Region LittleBart CFX 1 August 7, 2011 19:52
Defining wall boundary region saleem Siemens 3 August 31, 2005 04:58


All times are GMT -4. The time now is 11:23.