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?
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.
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
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.
Jimmy wrote:
> 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:
> 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?
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
On Aug 27, 10:10 am, Jimmy <jimmy.verrea...@mail.mcgill.ca> wrote:
> 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:
> 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?
> 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.
> > 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.
> 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: