stellar structure

(the presumed internal structure of stars)

There is a general model of stellar structure
(stellar structure model or stellar model) consisting of
a hot region in the center where fusion is
releasing energy (the stellar core), a region near the apparent
surface of the star that generates the light that escapes
(the photosphere), and regions in between that transfer the
energy from core to photosphere via electromagnetic radiation (i.e., radiative transfer)
and/or convection
(transfer of heat by movement of bulk amounts the material holding the heat)
with conduction
(transfer of heat by collision of particles)
generally only a minor factor.
The structural details depend nearly entirely
on the mass and age of the star, the smaller or rarer
factors including the initial chemical composition
(characterized by its metallicity),
the degree of spin, and nearby companions.

Large mass stars have CNO cycle fusion in
the core, with a region surrounding it
conveying energy via radiative transfer,
the inner part of which also has some proton-proton chain
fusion, which can be triggered by somewhat
lower temperatures.

Small mass stars such as red dwarves have only
proton-proton chain fusion in the core, and
transfer energy through convection.

Between are stars like the Sun, which have an inner
portion much like a large star, with a convection
layer surrounding it.

(The luminosity equation: energy is conserved,
any addition is from fusion at that level)

dT 3κρL
—— = ————————
dr 64πr²σT³

(Opacity directly affects the rate at which temperature changes with radius,
i.e., the temperature gradient.
This is the equation for radiative transfer, i.e., energy transfer via
EMR; Other equations are needed if heat conduction is significant
or if there is convection, which can happen if the temperature
gradient is sufficiently high.)

r - distance from the center of the star, i.e., radius of a spherical portion of the star centered at the star's center.

m - mass of the star within distance r from the center.

ρ - density, a function of r, i.e., the same at all points equidistant from the center.

L - luminosity, the rate at which energy is flowing from inside r to outside r.

T - temperature at r, also modeled as being the same at all points equidistant from the center.

P - pressure at r, also modeled as being the same at all points equidistant from the center.

To model a star,
these are generally solved using difference equations, approximating
the differential equations by calculating differences over a small value.
A star with these equations, a set of consistent
boundary conditions needs to be determined/selected.
Some are clear: m, L must be zero at the center (where r = 0), while
ρ, P, and T must be (essentially) zero at the surface
(the maximum value of r).
Since any numerical calculations must begin at a point
with values for all the variables,
guessing is required and multiple calculation attempts
are likely needed to satisfy the above five constraints.

Codes using this approach are called Eulerian codes:
an alternative is Lagrangian codes, that specify (changes in)
values in relation to dm rather than dr, i.e., mass rather than
radius.