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