Google Groups Home
Help | Sign in
problem with smokefoil example
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Brian  
View profile
 More options Jun 16, 2:54 pm
From: Brian <maxwellbr...@yahoo.ca>
Date: Mon, 16 Jun 2008 11:54:30 -0700 (PDT)
Local: Mon, Jun 16 2008 2:54 pm
Subject: problem with smokefoil example
Hello,

I am having troubles running the examples:

amrcp latex/Chp2/method.3

and

amrcp latex/Chp2/method.4

I want to incorporate the smokefoil tracing into my own program but
when I run these example scripts I get the following error:

Error at line 155 of file /home/bmax/amrita/test/run_smokefoil:
unknown function 'W::VORT'!

Line 155 is:
minmax W::VORT[] -> min, max

error near:
[] -> min, max

It seems there is a problem when the script attempts to get the
vorticity when it reads the SootTraceImage procedure (for making
postscript files).

The version of Amrita I am running is v3.00 and here is the entire
example script I am running (latex/Chp2/method.3):

Latex2eHead {
   dir  = method
   file = smokefoil.tex

}

fold::latex { title
   fold::latex { top matter
      \pagestyle{empty}
   }
   \centerline{\bf\Huge Shock Reflection From A Cylinder}
   \bigskip
}

fold::amrita { run simulation
   fold::amrita { prelims
      EulerEquations {
         add2W = VORT
      }
      fold::amrita { init resources
         fold::amrita { get roe_fl
            if(!&amrso("code/roe_fl")) then
               fold::amrita { build code
                  fold::amrita { generate auxcode
                     fold::print { soot_trace
                        fold>file=code/soot_trace,recursion off,dollar
off
                        fold::amrita { daisy chain Ls
                           AddIntegrationStep {
                              step = soot  (aka
Ls)  :record_vort(IM,JM,NG,DX,DY,W)
                           }
                           set amrita:bcg::integration .= *Ls
                        }
                        fold::print {  record_vort
                           *
                           *
                           *     RECORD_VORT:
                           *
                           *
                                 SUBROUTINE
RECORD_VORT(IM,JM,NG,DX,DY,W)
                           #include "$amrita:bcg::commonblk"
                                 AMRINT IM,JM,NG
                                 AMRDBL DX,DY
                                 AMRDBL W(NW,amrCpatch(IM,JM,NG))
                                 DO I=1,IM
                                    DO J=1,JM
                                       DUDY = (W(2,I,J+1)/W(1,I,J+1)
                                X             -W(2,I,J-1)/W(1,I,J-1))/
(2*DY)
                                       DVDX = (W(3,I+1,J)/W(1,I+1,J)
                                X             -W(3,I-1,J)/W(1,I-1,J))/
(2*DX)
                                       VORT = DVDX-DUDY
                                       IF(ABS(VORT).GE.ABS(W(5,I,J)))
THEN
                                          W(5,I,J) = ABS(VORT)
                                       ENDIF
                                    END DO
                                 END DO
                                 RETURN
                                 END
                        }
                     }
                  }
                  BasicCodeGenerator {
                     solver = roe_fl
                     scheme = flux-limited'operator-split
                     auxcode= code/soot_trace
                  }
               }
            endif
         }
         fold::amrita { define DrawCylinderBody
            proc DrawCylinderBody {
                 fold::amrita { parameters
                    xo = 60
                    yo = 0
                    r  = 25
                    arc = 0 to 180
                 }
               }
               AmritaBlue
               filled circle $xo,$yo,$r sector $arc
            end proc
         }
         fold::amrita { define CylinderProblem
            proc CylinderProblem {
                 fold::amrita { parameters
                    Ms        =  1.25   # shock strength
                    Xs        = 10.00   # shock position
                    lmax      =  2      # grid levels
                    r         =  2      # refinement ratio
                    rad       = 25      # radius of cylinder
                    xo        = 60      # centre of
                    yo        = 0       # cylinder
                 }
               }
               fold::amrita { def Domain
                  def Domain
                     lscale    1
                     patch <+,1,w60,h60>
                     patch <+,1,w60,h60>
                  end def
               }
               fold::amrita { def BoundaryConditions
                  W'quiescent  ::= <RHO=1,U=0,V=0,P=1>
                  fold::amrita { get post-shock state
                     ShockWave Ms=$Ms, state1=quiescent,\
                                       state2=post_shock
                  }
                  def BoundaryConditions
                     Nbdy  domain: reflect
                     Ebdy  domain: extrapolate
                     Wbdy  domain: prescribe   W'post_shock
                     Sbdy  domain: reflect
                     AXS::InternalBoundary {
                        fold::amrita { define internal boundary
                           PSI = ($rad-sqrt((X[]-($xo))**2+(Y[]-
($yo))**2))
                        }
                     }
                  end def
               }
               fold::amrita { def SolutionField
                  def SolutionField
                     setfield W'quiescent
                     setfield W'post_shock X[]<$Xs
                  end def
               }
               fold::amrita { def Mesh Adaption
                  def MeshAdaption
                     adaption  on
                     lmax      $lmax
                     r         $r
                  end def
               }
               fold::amrita { def RefinementCriteria
                  def RefinementCriteria
                     DensityGradient
                     setflags [ooo|oxo|ooo] ON_BODY[]
                  end def
               }
               fold::amrita { now run it!
                  makefield
                  do l=1,$lmax
                     adapt
                     makefield
                  end do
               }
            end proc
         }
         fold::amrita { define SootTraceImage
            proc SootTraceImage {
                 fold::amrita { parameters
                    SOOT               = W::VORT # what to plot
                    exposure [0:1]     = 1       # darkness of image
                    grid               = {G}     # select grid
                    tol                = 0.2     # threshold for amp1
amp2
                    amp1               = 0.5     # weak   features
                    amp2               = 0.25    # strong features
                 }
               }
               minmax $SOOT[] -> min, max
               wt          ::= abs(($SOOT[]-$min)/($max-$min))
               greyshading ::= wt[]<$tol? wt[]**$amp1 : wt[]**$amp2
               plot image $grid m<$exposure*greyshading[]>
            end proc
         }
      }
      plugin amr_sol
      CylinderProblem {
         fold::amrita { parameters
            Ms   = 2
            Xs   = 10
            lmax = 1
            r    = 2
         }
      }
      fold::amrita { init plotting
         fold::amrita { force refinement
            def RefinementCriteria
               setflags [ooo|oxo|ooo] 1
            end def
         }
         logfile logs/roe_fl
         solver  code/roe_fl
         autoscale
         postscript on
         pushcwd $amrita:latex::PS
      }
   }
   do phase=0,4
      march 30 steps with cfl=0.8
      fold::amrita { schlieren
         plotfile sch$phase.ps
            PlotDomain
            SchlierenImage
            DrawCylinderBody
         plotfile
      }
      fold::amrita { soot trace
         plotfile soot$phase.ps
            PlotDomain
            SootTraceImage
            DrawCylinderBody
         plotfile
      }
   end do
}

fold::latex { compose figures
   fold::latex { schlierens
      \noindent\huge schlieren images
      \begin{center}
         \begin{tabular}{ll}
            fold::amrita { get fig
               set fig = sch
            }
            fold::latex { snapshot t1
               \begin{tabular}{l}
                  &latex::fig([width=7cm]{*fig`1})\\[5pt]
                  \LARGE snapshot t1
               \end{tabular}
            }
            &
            fold::latex { snapshot t2
               \begin{tabular}{l}
                  &latex::fig([width=7cm]{*fig`2})\\[5pt]
                  \LARGE snapshot t2
               \end{tabular}
            }
            \\[10pt]
            fold::latex { snapshot t3
               \begin{tabular}{l}
                  &latex::fig([width=7cm]{*fig`3})\\[5pt]
                  \LARGE snapshot t3
               \end{tabular}
            }
            &
            fold::latex { snapshot t4
               \begin{tabular}{l}
                  &latex::fig([width=7cm]{*fig`4})\\[5pt]
                  \LARGE snapshot t4
               \end{tabular}
            }
         \end{tabular}
      \end{center}
   }
   fold::latex { soot trace
      fold::amrita { get fig
         set fig = soot4
      }
      \huge smoke foil
            records vorticity history t1 through t4 \hfill
      \begin{center}
         \begin{tabular}{l}
            &latex::fig([width=14cm]{*fig}) \\[5pt]
         \end{tabular}
      \end{center}
   }
}

LatexTail
Latex

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian  
View profile
 More options Jun 16, 2:58 pm
From: Brian <maxwellbr...@yahoo.ca>
Date: Mon, 16 Jun 2008 11:58:45 -0700 (PDT)
Local: Mon, Jun 16 2008 2:58 pm
Subject: Re: problem with smokefoil example
Also I am wondering if anyone has written any scripts, or has any
examples on plotting RHO*DZ/DT for the reactive euler equations case.

Thanks,

Brian

On Jun 16, 2:54 pm, Brian <maxwellbr...@yahoo.ca> wrote:

...

read more »


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Quirk  
View profile
 More options Jun 16, 3:03 pm
From: James Quirk <j...@galcit.caltech.edu>
Date: Mon, 16 Jun 2008 12:03:45 -0700 (PDT)
Local: Mon, Jun 16 2008 3:03 pm
Subject: Re: [BULK] problem with smokefoil example
Brian,

The problem is caused by a bug in the machinery that sets up an
EquationSet. For the fix, see my posting to Matei in the thread
"shock/detonation interaction with a ramp", May 27.

James  


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Quirk  
View profile
 More options Jun 16, 3:29 pm
From: James Quirk <j...@galcit.caltech.edu>
Date: Mon, 16 Jun 2008 12:29:13 -0700 (PDT)
Local: Mon, Jun 16 2008 3:29 pm
Subject: Re: problem with smokefoil example
Brian,

On Mon, 16 Jun 2008, Brian wrote:

> Also I am wondering if anyone has written any scripts, or has any
> examples on plotting RHO*DZ/DT for the reactive euler equations case.

You'd have to elaborate a bit more on exactly what you want to plot.
Because of the way the mesh adaption works, it's not possible to provide
a general mechanism for accessing time derivatives in the flow solution.
But if you tell me what you want to do, it should be possible to introduce
some custom code to do the trick.

James


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian  
View profile
 More options Jun 16, 5:20 pm
From: Brian <maxwellbr...@yahoo.ca>
Date: Mon, 16 Jun 2008 14:20:20 -0700 (PDT)
Local: Mon, Jun 16 2008 5:20 pm
Subject: Re: problem with smokefoil example
Thanks James,

I fixed the bug and the script works fine now.  Do you have any
examples of using the Add2W = VORT for the reactive euler case?  I
have tried but keeping *** MALLOC FAILED IN GRAB_DSTR *** error... :(

The problem I am working on is examining the stability of a detonation
wave after it passes over a cylinder (or a couple cylinders).  It
would be nice to trace the regions of maximum vorticity as in the
example scripts as well as regions of high reaction rates (RHO*DZ/DT)
integrated over time.

Brian

On Jun 16, 3:29 pm, James Quirk <j...@galcit.caltech.edu> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Quirk  
View profile
 More options Jun 16, 5:33 pm
From: James Quirk <j...@galcit.caltech.edu>
Date: Mon, 16 Jun 2008 14:33:10 -0700 (PDT)
Local: Mon, Jun 16 2008 5:33 pm
Subject: Re: problem with smokefoil example

Brian,

> Thanks James,

> I fixed the bug and the script works fine now.  Do you have any
> examples of using the Add2W = VORT for the reactive euler case?  I

No, but Gary does. But you will see its use is exactly the
same as the for the plain EulerEquations.

> have tried but keeping *** MALLOC FAILED IN GRAB_DSTR *** error... :(

It sounds like you will need to invoke the routine ArraySizes
to increase Amr_sol's storage allocation. For example, you could try:

ArraySizes {
   NGIxJ = 1000000
   NGD   = 4000

}

> The problem I am working on is examining the stability of a detonation
> wave after it passes over a cylinder (or a couple cylinders).  It
> would be nice to trace the regions of maximum vorticity as in the
> example scripts as well as regions of high reaction rates (RHO*DZ/DT)
> integrated over time.

You could keep track of the rate term in exactly the same way that
the vorticity is tracked. But rather than me spoon-feed you,
I would prefer for you to have a stab on your own, first.

James


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian  
View profile
 More options Jun 23, 2:47 am
From: Brian <maxwellbr...@yahoo.ca>
Date: Sun, 22 Jun 2008 23:47:48 -0700 (PDT)
Local: Mon, Jun 23 2008 2:47 am
Subject: Re: problem with smokefoil example
Thanks James,

I will try that.  I also have a problem where I may want to convect
some inert scalar, i'll call it alpha, throughout the domain so that I
can track one gas expanding into another.  For example I will
initially set gas A to have a value of alpha=0 and gas B will have a
value of alpha=1.  Is there a way I can add this scalar to the
equation set for the EulerEquations (not reactive) and take advantage
of the built in solvers (Roe / Godonov), or do I have to write my own
discretization for convecting alpha?

Thanks for your help!

Brian

On Jun 16, 5:33 pm, James Quirk <j...@galcit.caltech.edu> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.