CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Possibility of compressible 1d riemann problem (https://www.cfd-online.com/Forums/cfx/117790-possibility-compressible-1d-riemann-problem.html)

Badi May 15, 2013 05:22

Possibility of compressible 1d shockwave problem
 
3 Attachment(s)
Hello,

I am working on my thesis right now and I already posted a question related to this topic. Since it was about the material propertie I thought it would be better to simply start a new topic on this problem.

With this riemann problem I want to show the speed of a shockwave in a tube. The setup is pretty simple:

- 100 cell in flow, 1 cell thick and high
- first 50 cells domain 1
- second 50 cells domain 2

For the first step I am using air ideal gas. The second and third problem will be water with and without cavitation (therefor I need to make water compressible)

Anyway I am struggeling with the first problem. The properties of the two domains are as following:

Leftdomain: Air Ideal Gas, p= 1 bar, T = 348.4 K
Rightdomain: Air Ideal Gas, p = 0.1 bar, T = 278.8 K

Heat transfer: Total Energy
No Turbulence and adiabatic walls

I already have reference data. My data should be pretty close to it but I have a feeling that something is wrong in the interface of the two domains.
As I move forward on the timesteps the part in the blue circle doesnt move at all, nether left or right. It seems to be a part where the flow goes around. Is my problem doable with CFX?


Thanks for your time

Attachements:
1. Setup
2. Initial situation
3. 1.2e-5 s after the start (no reflection yet)

ghorrocks May 15, 2013 06:36

There is no need to do this with 2 domains. Do it in one domain with an initial condition. The CFX tutorials show how you can set initial conditions like this - see flow over a bump for how they do it with a multiphase simulation for volume fraction - the sam econcept can be used here to set pressure, temperature or velocity.

I have done this validation myself several times and I can assure you with care you can get it to almost exactly match the analytical solution - but with a little smearing of the shock wave.

And a final point - the ideal gas simulation has very little in common with the cavitation model. You are going to need very different settings for these two models.

Badi May 15, 2013 06:43

Thanks for the hint, I will definitly have a look at it.

I already worked a little bit on the cavitating problem, getting some sort of approximation of the density-pressure relation for H2O and H2Ol.
But my professor wanted to get clean results for the ideal gas problem.
I think I'll have a look at it in the next couple of days/weeks.

ghorrocks May 15, 2013 08:41

No problem, the ideal gas model is an excellent model to do as it has analytical answers to compare against. No need for sensitivity analysis, you can compare directly against exact answers. And this is a great exercise in CFD accuracy - if you can get this accurate to less than 1% you have shown that you know what you are doing with CFD.

Just don't think the setup you use for that model will guide the setup of the cavitation model in anyway.

Badi May 15, 2013 09:50

Thanks I think thats what my prof. wants to see ;)

In my head there are two options now:

1. Set up 2 fluids with different initialisation in one domain (volume fraction: if (x<5 , 1, 0)
2. Set up 1 fluid with initialisation functions for temperature and pressure

Problem with:

1. When I go for heat transfer total energy I have to go for a fluid interaction heat transfer (nusselt number etc.) which I have no clue about
2. My "functions" for temperature and pressure dont work since x is [m] and the dimensions of the true or false cond. are dimensionless.

Could you give me a hint about that? I dont really have experience in CEL

ghorrocks May 15, 2013 18:23

I thought you were going to do an ideal gas model first. Then you just set one side a high pressure and the other low and let it go from there. There will be a shock and rarefaction wave which bounces around and you can compare these results to analytical solutions.

This question seems to be about settign up a cavitation model. I am not sure what your two options are referring to - I do not know what you are modelling. What is the initial condition of the thing you are modelling?

On your questions:
1) Best do some reading on this and understand it before proceeding.
2) Simple fix: divide by 1[m] and then your expression is unitless.

Badi May 16, 2013 03:12

Hey, sorry for if I didnt make my statement so clear. I am not a native english speaker.
I did quite alot of reading about this topic and I know "theoretically" what to do and expect.
Currently I am working on the ideal gas problem and i know that I have to give different start values for x>5m and x<5 m. The 2 options I posted are for the ideal gas problem. I dont really know how to give a single domain 2 different startvalues in different regions.

I would be glad if you coul help me with this technical problem on cfx :)

ghorrocks May 16, 2013 03:19

Make the domain just a single domain. Then use a CEL expression like this to set your initial condition:

Pressure = if(x<0.5[m],1[bar],0[bar])

To set the pressure at 1bar up to x=0.5m, and 0bar beyond 0.5m. You cna also set temperature or velocity initial conditions by adapting this as well.

Your English is fine. If I tried to speak your language we would not get very far at all I suspect.

Badi May 16, 2013 06:34

Thanks thats exactly what I meant. =)

Its pretty strange, yesterday it did both the expressions and somehow it didnt work (its enough to put the if statement in the expression). Today I did exactly the same and didnt get an error. Now I have pretty decent results. Gonna do the comparison to analytical now.

Thanks for your help I really appreciate it.

Badi May 29, 2013 08:16

Hi, after reevaluating the results to this problem with some others it seems that there are still a couple of errors. Maybe you can help me on this cause I was already working on it quite long again and didnt solve it yet.
The shape of the x-density plot looks like the analytical one but its very "humpy" and breaks out at certain points. All in all there is a pretty big error compared to the analytical solution.

Other than that I would like to know how fast the shockwave travels but I dont really know how to get it from my data.

ghorrocks May 29, 2013 19:11

"Wiggles" at shockwaves is a common problem in CFD simulations of shock waves. The high resolution differencing scheme helps here but does not eliminate it generally. Also they tend to be time step sensitive, you can reduce it with careful choice of time step. But you will have to live with some degree of wiggle.

But you should still be able to see the correct general flow regardless of the wiggles, and everything should line up with analytical solutions to a high accuracy.

Getting the speed of the shock wave is straight forward - define a threshold of pressure (or any another variable which jumps in the shock wave) which is half way between the values in the initial conditions. The find the x location where the variable crosses your threshold, and do that for a few time steps - and there you have it, shock wave velocity.


All times are GMT -4. The time now is 18:32.