Step 2: determining the pressure/density correction

In the second step the pressure is determined for liquids and the density for gases. For liquids this involves the solution of a regular system of equations, the LHS of which has been LU-decomposed. This can be performed in a parallel way if the user has activated the multithreading option for the linear equation solver, e.g. the option -DUSE_MT for SPOOLES in the Makefile and specified the number of cpus by means of the environment variable NUM_CPU_SOLVE. The RHS is obtained by adding a term based on $ \Delta \boldsymbol {V}^*$ to the value calculated in mafillsmv1rhs.f. This is done in mafillprhs.f and e_c3d_prhs.f). For gases a lumped system is solved leading to the density correction. In both cases the corrections are stored on a nodal basis in field v(1..nk,4)). Finally, for fluids the pressure boundary conditions are applied in routine applybounp.f. For gases this has to wait till later, since the gas pressure is not known at this point.