Page 1 of 1

Variable volumetric source term

Posted: Sun Nov 09, 2014 11:51 pm
by fomeh
Hello guys,

I'm trying to implement volumetric heat source in a domain. The sources are not constant and they change with temperature. For constant terms, I've used ustssc.f90 with:

Code: Select all

	volf  = 0.d0
	
	
	CALL GETCEL(argument, NLELT,LSTELT)

	do ilelt = 1, nlelt
	  iel = lstelt(ilelt)
	  volf = volf + volume(iel)
	enddo

	do ilelt = 1, nlelt
	  iel = lstelt(ilelt)
	! No implicit source term
	  crvimp(iel) = 0.d0
	! Explicit source term
	  crvexp(iel) = volume(iel)*pwatt/volf
	enddo
	
enddo
Now pwatt should change with a linear equation as a function of temprature.

Any comment is appreciated.

Re: Variable volumetric source term

Posted: Mon Nov 10, 2014 3:26 pm
by Brian Angel
Hello,

You should be able to code pwatt directly in the ustssc routine. This routine has access to the rtp, rtpa and propce arrays which store the following:

rtp - all flow variables at the cell centres at the current time step / iteration
rtpa - all flow variables at the cell centres at the previous time step / iteration
propce - physical properties at the cell centres

Hence, once you have identified the cells with the source term you will have access to the temperature in these cells via the rtp and rtpa arrays and you can then code the equation for pwatt.

To see how rtp, rtpa and propce are structured, please refer to ยง3.9.3.3 of the V3.2.1 user manual.

Regards,

Brian Angel.

Re: Variable volumetric source term

Posted: Sun Nov 16, 2014 8:55 pm
by fomeh
Thanks you Brian
This works fine :)
Regards