On Fri, 4 Jul 2008, Carlos wrote:
>
> I've gone back and ran the old pulsate file using the 3cb model, but
> the simulation seems to get stuck when it tries to march in time, even
> after changing the node spacing and letting it run for a whole day. It
> seems to be able to build the znd code and the solver code fine. I
> simply took one part of the code and modified it to look like:
>
> plugin amr_sol
> utilize 2step::Machinery
> ReactiveEulerEquations {
> space = 1D
> model = 3cb
> }
>
> I was wondering whether I didn't implement the model properly, or
> whether the 3cb model is really that much more expensive than the 1a
> model
>
There is clearly a problem with your implementation.
Post a mailit and I'll take a look at it.
James
In the directory where the script is contained, I have the sub-directory
/3step/Machinery, where the cloned solver/znd/equation set files are
stored, as well as a AmritaUtilize.amr
Thanks,
Carlos
On Sun, 6 Jul 2008, cleu...@uottawa.ca wrote:
> When I try to make the mailit, I get the same problem. The process freezes
> and the mailit can't get created. I've attached my script.
You could have made a mailit of your directory tree
without actually running the script. That way I'd have
a complete record of what you're doing.
>
> In the directory where the script is contained, I have the sub-directory
> /3step/Machinery, where the cloned solver/znd/equation set files are
> stored, as well as a AmritaUtilize.amr
AMRITA is a system that helps those who help themselves.
Here you've sent me your driver script but the details
I need to look at are in 3step/Machinery directory
and the AmritaUtilize.amr procedure, both of which
are missing.
Have another go. But this time, copy all the relevant
file to a directory xyz, preserving whatever directory
structure you're using then run:
amrita -mailit xyz
You could simply run amrita -mailit on the directory
tree where you're working, but that would pack binary
files as well as text files and so, depending on
what you've done, may result in a file that is
too big to mail.
James
Gary,
I haven't finished modifying the files yet. I was just testing the 3 step
chain branching files that you sent me so that I know how to implement it
into the 1-D galloping detonation script. I'll post what I've done and the
list of modifications I've made here
ReactiveEulerEquations.amr - I put in all of the parameters that the model
uses here. I also got rid of the Q in the induction zone that I had when
you last saw it
Startup.amr/model.h - Modified so that it grabs the problem specific
parameters for the 2 step model instead of the 3 step model
PartialDerivatives.amr - I basically modified it so that the pressure reads:
P = (GMz-1)*(D*i-D*Q*y)
and did the appropriate partial derivatives based on that
SourceTerms.amr - I modified the P and T equations and put in the
equations DfDt and DyDt as described in previous posts
I believe the ComputeZndProfile.amr is the only file that needs to be
modified that I haven't yet touched.
I've had a look at the ComputeZnd file
Do you think we can get rid of the chunk of code that re-scales the value
for RS? I believe we can scale Ki without all those calculations
Is the QR term simply the local chemical heat energy term? So for us, for
our second progress variable YR, going from 0 to 1, it should read
something like
QR = - YR * Q ?
I'm happy with how the problem is scaled currently. I believe the speed,
U, right now is scaled with the post-shock sound speed
I've modified the ComputeZndProfile script and uploaded what I've changed
so far. I've deleted what was previously lines 144-199, with the scaling
of Ki. I've deleted RI = ..., RB = ..., RC = ... and I've changed QR as
discussed above.
I've also changed FX1, YX1, QX1 to:
IF (FR.LE.0.D0) THEN
FX1 = 0
YX1 = (Ke*(1-YR)**ETA)/UR
ELSE
FX1 = -(Ki*EXP(-E/TR))/UR
YX1 = 0
END IF
QX1 = -Q*YX1
and likewise with FX2, YX2 and QX2.
However, when I try to run the script, it writes the data for one point,
but stops the computation there.
I suspect it has something to do with these lines:
IF((FR.GE.Ftol).OR.(YR.GE.Ytol)) GO TO 300
IF(X.LT.Xc) GO TO 300
and that the program doesn't want to loop, but looking at the data
inputted, it seems that the program should loop (FR > FTol so it should
loop).
When the mass fraction of the fuel in the induction zone approaches 0, all
of the profiles start to blow up (P goes from 1 to -315000). When I make a
some computations by hand, I don't run into the same problem, so this may
be a matter of weak programming on my part
For the fuel mass fraction, I have something like:
FR = MAX(0.0 D0,FRL+(FX1+FX2)*DX/2.)
However when I look at the znd profile produced, the mass fraction dips to
negative numbers. Any idea what may be causing this?
Carlos
I am now running a simulation to see if the model actually runs. Depending
on the results, I may have to go back and modify the files in the bcg
directory
Carlos
The script runs just fine, but there is definitely something wrong with
the simulation. The pressure does not behave as it ought to. I've attached
a .ps file of the P history. I may have mistyped an equation or forgot to
change something in the solver files. I'll need to peruse through the
modified files in the bcg directory with a closer eye
On Thu, 24 Jul 2008, Gary Sharpe wrote:
>
> James, can you assist on this one at this stage...?
> Carlos, I'm am not sure what solver is getting built in your script
> ..in build solver you still have
> scheme = roe'3cb.
> However, when I change this to roe'2ie, it reports
> ***********************************************
> BCG can't produce a 1d'cartesian'roe'2ie scheme
> ***********************************************
> However, if I look at the source files created in directory
> "code" with scheme = roe'3cb,
> it does seem to have built the solver with your modified
> 2ie bits. So I am unclear what is happening here.
> James could you advise?
What you're seeing is a limitation of the current implementation
of BCG. As it stands, BCG allows you to overload its innards,
but it does not allow you to add to its innards, at least
not in a convenient fashion. Thus here Carlos is more or less
forced to retain the "3cb" handle when requesting a solver,
even though the code-generating routines now produce a 2ie code.
As it happens, BCG has now risen to the top of my todo list
in terms of revamping AMRITA's sub-systems and I hope to provide
a much cleaner means of users adding reaction models, thus
removing many of the hoops that Carlos is currently jumping through.
James
>
> Carlos, some observations:
> (i)the ZND setup looks to be working fine.
> (ii) you need to change your refinement criteria,
> if you look at the profiles, you will see that is refining
> everywhere behind the shock not just the reaction zone,
> so that your calculations are very expensive
> (iii) for initial testing you don't need to run with
> the very high resolution .. I would set Npts=4
> and lmax=1 initially. I would also set E to be small
> or zero such that the ZND wave is definetly stable.
> (iv) when it runs, the Zi and Ze profiles remain
> looking reasonable, while the flow variables go
> 'haywire'. This suggests the reaction source terms
> are correct, but that the coupling through Q isn't
> quite right, but until the solver issue above is resolved
> its unclear why....
There is no solver issue other than a mismatch in nomenclature.
>
> > What you're seeing is a limitation of the current implementation
> > of BCG. As it stands, BCG allows you to overload its innards,
> > but it does not allow you to add to its innards, at least
> > not in a convenient fashion. Thus here Carlos is more or less
> > forced to retain the "3cb" handle when requesting a solver,
> > even though the code-generating routines now produce a 2ie code.
>
> OK, I guess what I'm not clear about is why it still finds and builds
> the 2ie routines even though you have specified 3cb handle .. i.e.
> how does it know to look in the right place with the wrong handle?
BCG is just a collection of code-generating routines which happen
to be arranged in a tree. When you run:
plugin amr_sol
ReactiveEulerEquations {
model = 3cb
}
BasicCodeGenerator {
scheme = roe'3cb
code = abc
}
BCG switches to amr_sol's code-generating tree then jumps
to the sub-tree used for the Reactive Euler equations. It then
uses the model identifier, or handle, to jump to the sub-sub-tree
of generating routines. At that point it looks for a file,
bcg.schemes, which lists the available schemes. In this instance
the file looks like:
def NamingConvention
convention for reactive-euler-code is space'grid'solver'model
where space = {1d:one-dimensional|2d:two-dimensional}
where grid = {c:cartesian|b:body-fitted:curvilinear}
where solver = {roe|contrib}
where model = {1a:1step-Arrhenius:OneStepArrhenius:Arrhenius}
where model .= {sd:sqrt-Depletion:SquareRootDepletion}
where model .= {3cb:3step-ChainBranching:ThreeStepChainBranching:ChainBranching}
where model .= {axs}
exclude names 1d'b'*'*
exclude names *'*'roe'axs
end def
which explains why you can't run:
utilize 2steplib
plugin amr_sol
ReactiveEulerEquations {
model = 2ie
}
BasicCodeGenerator {
scheme = roe'2ie
code = abc
}
The utilize command does rejig AMRITA's search path such
that the call to ReactiveEulerEquations invokes Carlos's
version rather that the one in:
$AMRITA/stdlib/equations
However it does not inform BCG that it has a private
code-generating tree and so BCG still sees the original
bcg.schemes file and so fails to recognize 2ie as a
known model.
Now when you run:
utilize 2steplib
plugin amr_sol
ReactiveEulerEquations {
model = 2ie
}
BasicCodeGenerator {
scheme = roe'3cb
code = abc
}
BCG sees the known model '3cb' and starts generating a 3cb code.
But since the utilize command includes an:
autopath <stdlib> ++$amrita::thisdir/bcg/2ie
when BCG invokes a routine such as PartialDerivatives,
it is tricked into finding Carlos's version for 2ie rather
than the original 3cb routine. Hence your confusion.
The code produced is the one you want, but the nomenclature
is messed up.
>
> > As it happens, BCG has now risen to the top of my todo list
> > in terms of revamping AMRITA's sub-systems and I hope to provide
> > a much cleaner means of users adding reaction models, thus
> > removing many of the hoops that Carlos is currently jumping through.
>
> OK thats good, in the meantime Carlos and should perservere so we have
> a working model.
Yes.
BCG was cobbled together back in 1995 and has provided
a reasonable service, for a wide range of people, ever since.
But for some time it has been clear that the implementation
needed to be revamped to keep pace with peoples' needs.
Therefore if you and Carlos keep plugging away I will
use whatever you produce as a test in ensuring that
the revamped BCG does indeed provide a more convenient
means of being overloaded with different reaction models
and the like.
James
>
>
> >
> Looking closely at the late time solution, there is a slight
> difference
> between the numerical structure and the initial ZND profile. Looking
> closely, Ze actually starts to rise slightly above 0 before
> Zi reaches zero (I attached a plot - ZeZi58.jpg)
> It is probably something to do with the way you have done the source
> terms
I notice that this happens when Zi is very close to 0. See attached ZiZe.
I think that it may be due to the 2 step integration in the SourceTerms
file. It's possible that the first step of the integration predicts that
Zi would reach 0, so that in the second step of the integration, Ze starts
prematurely, before Zi reaches 0 completely.
I haven't noticed this. In the ZiZe graph that I've attached, Ze actually
hits 1. What were the variables that you used?
I was able to reproduce E=10 almost identically to what was in the paper.
Right now, I'm running tests to try to find the neutral stability boundary
for different activation energies. There are small differences between the
results, but I suspect it may be a rounding issue when converting from one
normalization to the other
Carlos