Corrosion models used in the oil and gas industry are generally aimed at conditions found in pipelines and topside facilities at moderate temperature and pressure where ideal behavior and solubility for gases can be assumed. The conditions downhole in wells can be very different with high temperature and high pressure often found especially in deep wells and ideal gas and liquid behavior no longer applies. A corrosion model was developed to take into account the non-ideality that can be found in downhole tubing under production. In this model Peng-Robinson equation of state replaces the ideal gas assumption and fugacity is used rather than partial pressures. Henry’s law was replaced by Duan’s models to calculate solubility of CO2 and H2S for higher range of temperature and pressure. Furthermore the Pitzer activity model is used to account for non-ideality of the concentration of ionic species in the water phase. The user interface of the model has been designed to fit the type and format of typical well production data. The model is tested against lab data compared with other corrosion models and then finally to field experience caliper data from wells and the result of a downhole corrosion monitoring probe. The model shows an improvement from similar models that don’t take non-ideality into an account and can reasonably predict general corrosion downhole although it deviates from caliper data especially when mineral scaling takes place. Examples of input and output from the model will be presented and discussed to highlight the remaining gaps to be targeted in future work.