CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Modifications on Transonic option in compressibleInterFoam (https://www.cfd-online.com/Forums/openfoam-solving/199411-modifications-transonic-option-compressibleinterfoam.html)

kal1943335 March 5, 2018 21:55

Modifications on Transonic option in compressibleInterFoam
 
Dear all,
I'm trying to simulate high pressure gas atomization using compressibleInterFoam. However, I'm having a really hard time dealing with high pressure gas inlets (around 30atm) and temperature fluctuations. I'm using OF 4.0 and recently I found that transonic option in compressibleInterFoam isn't working well. However, they made some modifications in the development versions. When I cross checked the modifications, I found that they have modified pEqn.H and TEqn.H.

I managed to add the modifications in the TEqn.H into my solver successfully. (adding the ContErr terms and I separated the positive and negative source terms in order to improve the diagonal dominance). However, making the changes in pEqn.H seems little bit complex. It compiled without giving me any error, but giving me a runtime error. It refers to the modifications made in src/finiteVolume. (As you can see below the scalarmatrix p_rghEqnComp1 is scaled by pos(alpha1) and apparently it's not allowed in OF40 src).

PHP Code:

        p_rghEqnComp1 =
            
pos(alpha1)
           *(
                (
                    
fvc::ddt(alpha1rho1) + fvc::div(alphaPhi1*rho1f)
                  - (
fvOptions(alpha1mixture.thermo1().rho())&rho1)
                )/
rho1
              
fvc::ddt(alpha1) - fvc::div(alphaPhi1)
              + (
alpha1/rho1)
               *
correction
                
(
                    
psi1*fvm::ddt(p_rgh)
                  + 
fvm::div(phid1p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh)
                )
            ); 

According to the bug report it's already implemented in of 5.x and development version. However, I have to stick with OF 4.0 as our school cluster only has that version. I think this can be solved by adding the modifications to the finiteVolume library (May be by having a localized finiteVolumeNew library inside the solver and use it only for the compressibleInterFoam solver). I have some programming knowledge in c++ but don't have much experience dealing with libraries and I really don't want to mess the installation.

Really appreciate if someone can help me with this.

Thanking you in advance,
Kalpana


All times are GMT -4. The time now is 11:08.