# Using PengRobinson eq with sonicFoam

 Register Blogs Members List Search Today's Posts Mark Forums Read

 July 24, 2017, 16:28 Using PengRobinsonGas equation with sonicFoam #1 New Member   Wellorzzon Join Date: Mar 2017 Posts: 1 Rep Power: 0 Hello, I am a Master's Degree student and I am working on a project that uses sonicFoam as a solver. The cases I am simulating are basically a fluid in supersonic flow within an ejector. I used the type of cell "wedge" to simulate just one cell (1° of the total cylinder from the original ejector design) in the radial direction and refined the mesh in the longitudinal direction (x and y planes). However, the cases are diverging, i.e., the Mass Flux Error between Inlet and Outlet is high, mainly when I increase the mesh refinement just in the longitudinal direction . I tried to use the PengRobinson equation but the solver restricted me to use just sensibleInternalEnergy as option to energy in the thermophysicalProperties, so I coudn't use polynomial and hPolynomial as option to transport and thermo, respectively. Thinking on it, I recompiled the solver (based on rhoPimpleFoam) using the sensibleEnthalpy instead of sensibleInternalEnergy and used the PengRobinson equation, which gave me very good results. But I wanted to know: Which aspects of the calculation those changes affects the simulated physics of the sonicFoam? Notes: Changes in the sonicFoam are described below. ---------------------------------------------------------------------------------------- 1. createFieldRefs.H Commented the term "volScalarField& e = thermo.he();"; 2. createFields.H In the line "thermo.validate(args.executable(), "e");", the term "h" was added next to "e", resulting in "thermo.validate(args.executable(), "h", "e");"; 3. EEqn.H The terms "e" were replaced for "he"; Added a line after the "{" with the information "volScalarField& he = thermo.he();". ---------------------------------------------------------------------------------------- Thanks for helping me. Last edited by Zon; July 31, 2017 at 15:51.

 Tags pengrobinson, pengrobinsongas, rhopimplefoam, sensibleenthalpy, sonicfoam