How does one calculate the B field for core loss in Steinmetz equation? I have a single turn inductor in a magnetic material. Is the core material shape relevant? Wouldn't the B field be variable at different parts of the core, so how is this done as a single number?
The B you need to use for Steinmetz equation is the peak of the AC component of your B field. This means that if your current has a DC component (also called DC bias or offset), you have to take it out before doing the following calculations. This DC bias will introduce an error in the prediction, but more on that at the end.
About the variability of the B field: Yes, in theory, the B field is different at every point of the core. In practice every shape can be modeled by some effective parameters: effective length, area, and volume; which represent the same parameters of the equivalent toroid. So basically, what we do is make a transformation from our shape (PQ, RM, etc.) to a virtual equivalent toroid, and we calculate the fields and losses there. There parameters are calculated following the standard IEC 60205.
So, yes, the shape of the core is very relevant, we use its effective area (the "average" area that the B field sees as it circulates through our core) to calculate its Reluctance, and in with that we calculate the B field with the following formula:
Bpeak = Ipeak * N / (R * Ae)
where Ipeak is the amplitude of your current, N the number of turns, R the reluctance of your core (which is calculated with the Resistance–reluctance model) and Ae the effective area. In case your core has no gap, you can use:
Bpeak = Ipeak * N / (mu * le)
where mu is the absolute permeability of your core material, and le is es effective length.
With all this said, Steinmetz Equation is a method from 1896, and many improvement have done over the years. Unless you have to implement this into an Excel sheet, I suggest you take a look at the Improved Generalized Steinmetz Equation, from Professor Sullivan (Improved Calculation of Core Loss With Nonsinusoidal Waveforms) And just to complete the answer, there are other methods for calculating the core losses, like Roshen model: A Practical, Accurate and Very General Core Loss Model for Nonsinusoidal Waveforms, or Albach model: Calculating core losses in transformers for arbitrary magnetizing currents a comparison of different approaches.