If your desktop case doesn't have enough clearance for a CPU cooler with a height of 158mm or taller, you still have several options available to keep your Ryzen CPU cool.
1. Low-profile CPU cooler: Consider getting a low-profile CPU cooler designed specifically for smaller cases. These coolers are typically shorter in height, allowing them to fit in compact cases. They might not provide the same level of cooling performance as larger coolers, but they can still do a decent job of keeping your CPU temperatures in check.
2. All-in-one liquid cooler: Another option is to use an all-in-one liquid cooler. These coolers typically have a shorter pump/block unit that can fit into smaller cases. The radiator can be mounted at the front or top of the case, depending on your case's design. Liquid coolers can provide efficient cooling while taking up less space inside the case.
3. Top-down cooler: Top-down coolers, also known as downdraft coolers, blow air directly onto the motherboard and CPU. These coolers have a horizontal orientation and can be a good option for cases with limited height clearance. The cooler's fan blows air across the motherboard's VRMs and surrounding components, aiding in overall system cooling.
4. Undervolting and fan control: If your case doesn't allow for a larger cooler, you can still optimize the cooling performance by undervolting your CPU. Undervolting reduces the voltage supplied to the processor, resulting in lower temperatures. Additionally, you can tweak fan curves and control fan speeds to maximize cooling efficiency.
Remember to check the specifications of any cooler you consider purchasing to ensure it fits within your case's height limitations. Additionally, consider the overall airflow and cooling capabilities of your case to ensure efficient cooling for your entire system.