synthetik-technologies / blastfoam

A CFD solver for multi-component compressible flow with application to high-explosive detonation, explosive safety and air blast
Other
215 stars 96 forks source link

NSCBC implement in openfoam-9 #55

Open jiaqiwang969 opened 2 years ago

jiaqiwang969 commented 2 years ago

Hi, I am Jiaqi, a phd student in aeroacoustic.

I try a lot repository of compressible foam, finally I choose blastfoam for my dlr-buffet project.

But, for blastfoam, the boundary condition now is only limited in waveTransimision, which is not really good for inter-flow simulation (with terrible dirft). I have developed NSCBC to solve it. However, I am only testing it in Openfoam-v2006,v2012.

See the shockTube example using waveTransimision in balstFoam when Ux is not zero:

Now, I am troubled with implement it in openfoam-9. Could you help me to debug?

jheylmun commented 2 years ago

Hi Jiaqi, I would be happy to. One thing that may help would for the initial port would be to use blastReactingFoam instead of blastFoam since the way in which the speed of sound would be calculated is different between the standard OpenFOAM thermo and blastFoam's.

Thanks, Jeff

jiaqiwang969 commented 2 years ago

Right, I found this diffenrence when I try to use thermo:psi. For BlastFoam is not avaiable. May I ask what's the different between blastReactingFoam and blastFoam. Right now, my another prohect "DLR-buffet", using blastFoam, the turbulence model is include by adding fvModel. I am a little confuse about how it works.

jheylmun commented 2 years ago

Really the only difference between the solvers is that blastReactingFoam uses the standard OpenFOAM thermo classes, just like rhoCentralFoam, but also has ability to use the ODE time integration, flux schemes, and other numerical tools that rhoCentralFoam does not. Reactions and combustion models are also included.

What do you mean it is "included by adding fvModels"? As long as you have a non-zero viscosity specified in phaseProperties (blastFoam) or thermophysicalProperties (blastReactingFoam), you should be required to provide either turbulenceProperties or momentumTransportProperties.

jheylmun commented 2 years ago

One other thing I just noticed in the implementation that will make using your boundary conditions with more difficult with blastFoam is that you are using the ddt scheme to calculate the boundary which is not actually used. Instead there are ODE coefficients that are used to blend both the starting values as well as the changes in the advancing variables. This results in the calculation of the refValue and refGrad values not being consistent.

jiaqiwang969 commented 2 years ago

Really the only difference between the solvers is that blastReactingFoam uses the standard OpenFOAM thermo classes, just like rhoCentralFoam, but also has ability to use the ODE time integration, flux schemes, and other numerical tools that rhoCentralFoam does not. Reactions and combustion models are also included.

What do you mean it is "included by adding fvModels"? As long as you have a non-zero viscosity specified in phaseProperties (blastFoam) or thermophysicalProperties (blastReactingFoam), you should be required to provide either turbulenceProperties or momentumTransportProperties.

But It seems the blastReactingFoam solver is more unstable than blastFoam or rhoCentralFoam. I test the same case, with those three solver. blastReactingFoam is always broken up.

jheylmun commented 2 years ago

Could you provide the case you are using? The set up may be slightly different between the three

jiaqiwang969 commented 2 years ago

Sorry for the late reply,I haved upload three cases in https://github.com/jiaqiwang969/ExampleCase-blastFoam

jiaqiwang969 commented 2 years ago

For this setting,blastFoam & rhoCentralFoam is running well. blastReactingFoam is broken up.

While the results between blastFoam and rhoCentralFoam is different, when both with Kurganov fluxSchme and same parameter setting. rhoCentralFoam sound like more dissipative than blastFoam. rhoCentralFoam is more close to experiments.

jheylmun commented 2 years ago

The was unable to run the cases you provided, but one thing that I noticed was the schemes you used varied between the solvers. The quadraticMUSCL scheme used in the blastFoam and blastReactingFoam cases will tend to be less dissipative that the vanLeer schemes used in the rhoCentralFoam case. I would also recommend using the Euler timeIntegrationScheme for consistency. While it would probably be worth while to compare Euler and higher order time integration schemes in blastFoam, I would suggest using the same schemes to compare to rhoCentralFoam.