Supersonic wedge into combustible gas

6 views
Skip to first unread message

Jimmy

unread,
Aug 27, 2009, 10:10:49 AM8/27/09
to amrita-ebook
I'm a PhD student at McGill University, and I intend to use AMRITA to
investigate different flowfields around a projectile travelling at
hypersonic velocities into a combustible gas.

So far I've been able to run a simulation with a sphere as the
projectile. Here is a part of the script specifying the boundary
conditions:


fold::amrita { Boundary Conditions
import znd::{Dcj}
W'quiescent ::= <RHO=.05,U=0,V=0,P=.05,Z=0>
W'freestream ::= <RHO=1,U=$dp*
($znd::Dcj),V=0,P=1,Z=1>
fold::amr_sol'BoundaryConditions{
Nbdy domain: extrapolate
Ebdy domain: extrapolate
Wbdy domain: prescribe W'freestream
Sbdy domain: reflect
fold::amrita { define PSI
PSI ::= ($rad-sqrt((X[]-($xo))**2+(Y[]-($yo))
**2))
}
AXS::InternalBoundary {
PSI = PSI[]
}
}
where the location is specified (xo, yo) and the radius of the sphere
(rad).

Now I would like to run a simulation where the projectile is a wedge.
So instead of specifying a sphere for the body, I would like to
specify a triangle using 3 points for the 3 apex of the triangle. How
can I specify that in the boundary conditions? In other words, what
expression do I have to put for the PSI expression?

Charles Basenga Kiyanda

unread,
Aug 27, 2009, 1:36:56 PM8/27/09
to amrita...@googlegroups.com
Jimmy,

How about trying something as below? It takes into account that you
define the apex of the wedge as $Xa,$Ya, the angle of the top-half of
the wedge, $alphaT, the angle of the bottom half of the wedge $alphaB
and the length of the wedge, $Lr. This will work for a general symmetric
or asymmetric projectile with zero angle of attack. If you want a
projectile with an angle of attack, you'd have to modify this a bit.
This would be a bit more work to define, but it seems (at least to me,
call me pedantic if you will) like the length of the projectile, the
angle(s) of the wedge and the angle of attack are a more natural
coordinate system than three points in space for a triangle.

fold::amrita { Boundary Conditions
import znd::{Dcj}
W'quiescent ::= <RHO=.05,U=0,V=0,P=.05,Z=0>
W'freestream ::= <RHO=1,U=$dp* ($znd::Dcj),V=0,P=1,Z=1>
fold::amr_sol'BoundaryConditions{
Nbdy domain: extrapolate
Ebdy domain: extrapolate
Wbdy domain: prescribe W'freestream
Sbdy domain: reflect
fold::amrita { define PSI
d1 ::= cos(rad($alphaT))*(Y[]-$Ya)-sin(rad($alphaT))*(X[]-$Xa)
d2 ::=
cos(rad($alphaB))*(Y[]-$Ya)+sin(rad($alphaB))*(X[]-$Xa)
d3 ::= d1[]*d2[]
proj1 ::= X[]<$Xa? -Y[] : -d3[]
PSI ::= X[]>$Xa+$Lr? -Y[] : proj1[]
}
AXS::InternalBoundary {
PSI = PSI[]
}
}


I was originally a bit baffled by the three points definition of your
shape, but writing the above made me think there's probably a simple
solution. In the following, (Xa,Ya) is the apex and (X1,Y1) and (X2,Y2)
are the other two points. I put this together assuming

Xa < X1 < X2
and
Y1 > Ya > Y2.

I think it would also work for

Y1 > Y2 > Ya.

fold::amrita { Boundary Conditions
import znd::{Dcj}
W'quiescent ::= <RHO=.05,U=0,V=0,P=.05,Z=0>
W'freestream ::= <RHO=1,U=$dp* ($znd::Dcj),V=0,P=1,Z=1>
fold::amr_sol'BoundaryConditions{
Nbdy domain: extrapolate
Ebdy domain: extrapolate
Wbdy domain: prescribe W'freestream
Sbdy domain: reflect
fold::amrita { define PSI
db ::= (Y[]-$Ya)*($X2-$Xa)-(X[]-$Xa)*($Y2-$Ya)
d1 ::= (Y[]-$Ya)*($X1-$Xa)-(X[]-$Xa)*($Y1-$Ya)
d2 ::= (Y[]-$Y2)*($X2-$X1)-(X[]-$X2)*($Y2-$Y1)
dL ::= db[]*d1[]
dR ::= db[]*d2[]
proj1 ::= X[]<$Xa? -Y[] : -dL[]
proj2 ::= X[]<$X1? proj1[] : -dR[]
PSI ::= X[]<$X2? proj2[] : -Y[]

}
AXS::InternalBoundary {
PSI = PSI[]
}
}


I make no claim that this will work out of the box. I didn't test it
here and I fear I always get confused with the sign of psi the first
time around. There is a shock interaction with a double wedge in the vki
notes (2nd document, page 5). I believe the ramp mailit is distributed
with amrita, so you should be able to look at that. I base myself off of
that whenever I need to specify obstacles with straight edges.

Charles

matei

unread,
Aug 27, 2009, 2:04:20 PM8/27/09
to amrita-ebook
Jimmy,
I have just uploaded a working script called shockCD_EZ that shows the
problem of a shock passing over a triangle. Remember that PSI gives
the distance from any grid point to the closest solid boundary. Based
on this rationale, you can easily construct any desired shape.
matei

James Quirk

unread,
Aug 27, 2009, 2:33:03 PM8/27/09
to amrita-ebook
Matei,

On Thu, 27 Aug 2009, matei wrote:

>
> Jimmy,
> I have just uploaded a working script called shockCD_EZ that shows the
> problem of a shock passing over a triangle. Remember that PSI gives
> the distance from any grid point to the closest solid boundary. Based
> on this rationale, you can easily construct any desired shape.
> matei

Your simulation looks fine, but your definition of PSI is actually
incorrect. From the apex of the triangle the level set should appear as a
sector of concentric arcs and not as a sharp corner as you have it. This
sector is bounded by the normals to the front and back sides of
the obstacle.

Jimmy, first try plotting Matei's PSI. You can do this by adding:

rgb<1,0,0>
plot PSI[] contours

to the end of the procedure DrawObstacleBody. You should then convince
yourself that the distance to the apex, in the aforementioned sector, is
indeed a series of concentric arcs. When you've done that, try modifying
the PSI function to give the correct distance function. Don't worry if you
get stuck, as I will post a model solution next week. But it's important
that you try it yourself first.

In this particular instance Matei's error in the distance function
is probably unimportant. Nevertheless, for completeness I
thought I should point it out.

James

Jimmy

unread,
Aug 28, 2009, 1:09:32 PM8/28/09
to amrita-ebook
Thank you all,

I uploaded the working script "Shock_triangle", which produces
concentric circles at the triangle apex for the shortest distance
function.

Let me know if there are other ways of doing it.

Jimmy

James Quirk

unread,
Aug 28, 2009, 4:02:34 PM8/28/09
to Jimmy, amrita-ebook
Jimmy,

On Fri, 28 Aug 2009, Jimmy wrote:

>
> Thank you all,
>
> I uploaded the working script "Shock_triangle", which produces
> concentric circles at the triangle apex for the shortest distance
> function.
>
> Let me know if there are other ways of doing it.

Your approach is about the best that can be done, although
I would have written the script slightly differently.
For instance, I would lean towards using:

S1 ::= cos(rad($alpha+90))*(Y[]-$Y2)-sin(rad($alpha+90))*(X[]-($X1+$Y2/tan(rad($alpha))))
S2 ::= ($Y2-Y[])
PSI1 ::= -cos(rad($alpha))*(Y[]-$Y1)+sin(rad($alpha))*(X[]-$X1)
PSI2 ::= -sqrt((Y[]-$Y2)**2+(X[]-($X1+$Y2/tan(rad($alpha))))**2)
PSI3 ::= ($X1+$Y2/tan(rad($alpha)))-X[]
PSI ::= S1[]<0 && S2[]<0 ? PSI2[] : min(PSI1[],PSI3[])

where S1 and S2 mark the sector in which one needs to consider the
distance to the apex.

I would then have refactored it to:

set X2 #= $X1+$Y2/tan(rad($alpha))
S1 ::= cos(rad($alpha+90))*(Y[]-$Y2)-sin(rad($alpha+90))*(X[]-$X2)
S2 ::= ($Y2-Y[])
PSI1 ::= -cos(rad($alpha))*(Y[]-$Y1)+sin(rad($alpha))*(X[]-$X1)
PSI2 ::= -sqrt((Y[]-$Y2)**2+(X[]-$X2)**2)
PSI3 ::= $X2-X[]
PSI ::= S1[]<0 && S2[]<0 ? PSI2[] : min(PSI1[],PSI3[])

which, with the aid of complex variables, can then be reduced to:

set alpha = rad($alpha)
set X2 #= $X1+$Y2/tan($alpha)
Z ::= {X[]-$X2,Y[]-$Y2}
S1 ::= Im(Z[]*exp({0,PI+$alpha})))
S2 ::= -Im(Z[])
PSI1 ::= Im(Z[]*exp({0,PI-$alpha}))
PSI2 ::= -abs(Z[])
PSI3 ::= -Re(Z[])
PSI ::= S1[]<0 && S2[]<0 ? PSI2[] : min(PSI1[],PSI3[])

James

>
> Jimmy

Reply all
Reply to author
Forward
0 new messages