
[Sponsors] 
August 3, 2011, 08:49 
Problem simulating wave propagation in a tube

#1 
New Member
Claas Knoop
Join Date: Aug 2011
Posts: 7
Rep Power: 7 
Hi everyone,
I’m facing a problem solving the case of propagating sound waves in a tube using rhoPisoFoam (OF 1.7.0). The case is laminar, the BC's for U and p are as follows: U: internalField uniform (0 0 0); boundaryField { inlet { type groovyBC; value uniform (0 0 0); valueExpression "(20*sin(125640*time()))*vector(1,0,0)"; } channel { type fixedValue; value uniform (0 0 0); } frontAndBack { type empty; } outlet { type groovyBC; valueExpression "vector(0,0,0)"; gradientExpression "vector(0,0,0)"; fractionExpression "(phi > 0) ? 0 : 1"; value uniform (0 0 0); } } p: dimensions [1 1 2 0 0 0 0]; internalField uniform 101325; boundaryField { inlet { type waveTransmissive; value uniform 101325; field p; phi phi; rho rho; psi psi; gamma 1.4; fieldInf 101325; lInf 0; } channel { type zeroGradient; } frontAndBack { type empty; } outlet { type waveTransmissive; value uniform 101325; field p; phi phi; rho rho; psi psi; gamma 1.4; fieldInf 101325; lInf 0; } } I managed to get a converging solution and the results (frequency, amplitude) initially agree with the analytic solution. However, as the wave reaches the outlet (after 0.1 ms) the pressure level decreases considerably. While the pressure oscillates at ambient pressure in the beginning, it oscillates at 76.000 Pa after 1 ms and at 20.500 Pa after 5 ms. Besides that, the damping of the wave seems to be higher than it should. I've been struggling with this for a while now, so any help is much appreciated. Regards 

August 5, 2011, 05:19 

#2 
Senior Member
Mohammad
Join Date: Feb 2010
Location: Shiraz, Iran
Posts: 109
Rep Power: 9 
hi,
I'm not sure but I think trying this may help: U:inlet:groovy outlet: zeroGradient P:inlet:zeroGradient outlet:wavetransmitive and as a comment, with the frequency you used in groovy, very small timesteps should be used to run! and about wavetransmitive: I think linf=0 is somewhat equivalent to fixedvalue. linf is the distant from boundary faces to a virtual point having pressure specified as "value". so set outlet linf a large enough length depending scale of the case. I hope it helps, 

August 5, 2011, 08:43 

#3 
New Member
Claas Knoop
Join Date: Aug 2011
Posts: 7
Rep Power: 7 
Hi Mohammad,
thank you for your reply. You are right about the time step. I'm running with a step size of 0.1e6 s, so we're fine here. Regarding linf I can tell you that I’ve varied this length between 0 and 1000 and couldn’t determine any influence of linf on the solution at all. I also ran the BCsetup you suggested but unfortunately the result is (qualitatively) the same as observed before. In fact, I tried various combinations of BC's with no success and I begin to question the solver choice. Does anyone know if there is a more appropriate solver for my problem? Regards Claas 

August 8, 2011, 09:11 

#4 
Senior Member
Mohammad
Join Date: Feb 2010
Location: Shiraz, Iran
Posts: 109
Rep Power: 9 
hi claas,
I dont know the exact problem but I think changing schemes of grads, divergences and laplacians may help. limitedlinear is mostly more stable than other schemes in my experiences. yours... 

August 18, 2011, 03:29 

#5 
New Member
Claas Knoop
Join Date: Aug 2011
Posts: 7
Rep Power: 7 
hey Mohammad,
sorry for the late reply, have been quite busy lately..... So, here’s my fvSchemesfile: ddtSchemes { default Euler; } gradSchemes { default Gauss linear; grad(p) Gauss linear; } divSchemes { default none; div(phi,U) Gauss limitedLinear 1; div(phid,p) Gauss limitedLinear 1; div(phiU,p) Gauss limitedLinear 1; div(phi,h) Gauss limitedLinear 1; div(phi,k) Gauss limitedLinear 1; div(phi,epsilon) Gauss limitedLinear 1; div(phi,R) Gauss limitedLinear 1; div(phi,omega) Gauss limitedLinear 1; div((rho*R)) Gauss limitedLinear 1; div(R) Gauss limitedLinear 1; div(U) Gauss limitedLinear 1; div((muEff*dev2(grad(U).T()))) Gauss linear; } laplacianSchemes { default none; laplacian(muEff,U) Gauss linear corrected; laplacian(mut,U) Gauss limitedLinear 1; laplacian(DkEff,k) Gauss limitedLinear 1; laplacian(DepsilonEff,epsilon) Gauss limitedLinear 1; laplacian(DREff,R) Gauss limitedLinear 1; laplacian(DomegaEff,omega) limitedLinear 1; laplacian((rho*(1A(U))),p) Gauss linear corrected; laplacian(alphaEff,h) Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } fluxRequired { default no; p ; } I played with the schemes as you advised, trying also upwind and OUICK schemes but it didn’t change much. regards Claas 

August 22, 2011, 09:24 

#6 
New Member
Claas Knoop
Join Date: Aug 2011
Posts: 7
Rep Power: 7 
Hi Foamers,
after trying different BC configurations I found that the change in direction of flow seems to cause the above described pressure loss. When changing the applied wave from "(20*sin(125640*time()))*vector(1,0,0)" to "(1+1*sin(125640*time()))*vector(1,0,0)"; meaning a pulsating flow without changing flow direction, the results appear to be correct. Unfortunately I couldn’t find a BC configuration which works for my setup. So, if you have any ideas/knowledge about that, feel free to share… 

August 22, 2011, 15:28 

#7 
Senior Member
Mohammad
Join Date: Feb 2010
Location: Shiraz, Iran
Posts: 109
Rep Power: 9 
hi claas,
I have a basic question: if you want to model sound waves or something like that, why do you set wavy BC for U? not for p? sound waves and similar waves are pressure waves not velocity waves. I had solved incompressible flow in a pipe with fluctuating pressure gradient and the flow is some time in positive direction and in some time in negative direction. the answer of flow velocity profile in space and time was really good compared to analytical solution. so if setting wavy U inlet is not really your problem, change it to pressure. you can set pressure inlet as groovy and outlet as fixed value=0 . and U inlet and outlet both as zerogradient. yours, mohammad 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
analytical solution of 1D shock tube problem  ma  Main CFD Forum  10  May 11, 2015 05:20 
Simulating air injects thru. a tube to water in a  Howard Wang  FLUENT  11  September 30, 2009 16:24 
Baffle cell problem in shock tube  AB  CDadapco  4  November 15, 2004 09:44 
Shock tube problem  AB  CDadapco  1  November 9, 2004 01:25 
Shock tube problem  ger  Main CFD Forum  1  September 24, 2003 07:41 