Keeping other things (fuel, oxidizer, their ratio, mass flow rates, throat diameter, other hardware like pump, injector nozzles & impinging pattern etc.) same, if I changed only the geometry (shape/profile/dimensions) of the "diverging nozzle" of a rocket engine, does it affect the Sp. Impulse value at sea level? I assume that so long as the exhaust pressure at the exit of the D nozzle matches the ambient pressure, specific impulse for a given propellant will not change. am I correct?
For a given propellent system, the shape of the divergent nozzle section can have a large impact on Isp. On another propellent system the effect of nozzle contour can be small. The difference depends on the chemistry (reactants/products) of the system. The divergent section nozzle shape affects the temperature/time (through velocity and expansion rate) history of the effluent combustion product gases. From the composition at the nozzle throat, these gases need to reach (as near as possible) their equilibium concentrations at the nozzle exit to assure that all the energy is released and converted into velocity.
Reactions in the gases occur rapidly but are of a finite measurable rate. A rocket chemical system can gave a hundred or so individual species including ionized atoms. Reaction schemes to be analyzed can compromize hundreds of competing reactions. An ineffectively designed nozzle can keep a propellent from releasing all it's energy into gas velocity and result in a performance decrement. Equilibium nozzle flow is essentially infinite chemical reaction rates and the goal to achieve. Frozen flow is zero chemical kinetic reaction rates. Nozzles are designed to try to approach equilibrium combustion conditions. Losses in not reaching equilibrium are called recombination losses.
Very complex computer analyses involving 3d fluid flows, heat transfer, and chemical kinetic reaction rates are done to optimize the nozzle shape to achieve "best predicted" performance. There are hundreds of papers on this subject in the literature starting in the 1950s. There are dozens of major computer codes designed to analyze recombination losses. A three-dimensional exact reacting gas nozzle flow program is needed for a precise result and is a very extensive development.
This is a short synopsis of a very complex field.