There is a general model of Stellar Structure (Stellar Structure 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 (EMR) (i.e., Radiative Transfer (RT)) and/or convection, 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 (Z)), 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 most basic mathematical model includes four differential equations relating changes in mass, Temperature, Luminosity (L), and pressure to the distance from the center of the star. They presume Local Thermodynamic Equilibrium (LTE) and Hydrostatic Equilibrium.
dm —— = 4πr²ρ dr
(density is assumed constant at distance r from the center)
dP Gmρ —— = - ——— dr r²
(pressure counteracts Gravity at distance r from the center)
dL —— = 4πr²ε dr
(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. 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.)
Opacity, density, and energy generation are functions of temperature and pressure and it is key that simple-but-effective approximate models have been developed (Equations of State (EoS)).
To model a star with these equations, a set of consistent Boundary Conditions also 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.
Stellar Temperature Determination