[FLASH-USERS] Problem with Diffuse module

Klaus Weide klaus at flash.uchicago.edu
Mon Dec 4 12:17:42 EST 2017

On Thu, 30 Nov 2017, ascenzi wrote:

> Hi Klaus, thank you for your reply.
> > I would expect that you also see extremely small dt_hydro timesteps
> > at this point.
> Yes, I have also a small dt_hydro.
> > In your grid boundary condition, you should make sure that the guard cells
> > are filled in a thermodynamically consistent manner. Call Eos if
> > necessary.
> > 
> > How are you setting the boundary conditions for the diffusion solver?
> > Are they consistent with the grid boundary conditions used by Hydro etc.?
> I call the EOS in the user define boundary condition so I expect that all the
> thermodynamic
> quantities are consistent.
> However I did not define any boundary condition for diffusion solver. In the
> FLASH4 user guide I
> found the list with all the boundary conditions but it is not clear to me how
> to define them. Are there any runtime parameters to define these boundary
> conditions (as diff_eleXlBoundaryType for electron thermal conduction ?)

Hi Stefano,

The list of diffusion boundary conditions in the User's Guide in Boundary Conditions

is what you can choose from, and you can set diff_eleXlBoundaryType 
(for the 'X'-(aka R)-direction 'l'eft boundary) to one of the string 
values "DIRICHLET", "NEUMANN", "VACUUM", or "OUTSTREAM" to select one of 
the implemented bcs. However, the last two are for specific situations
that don't match your application, so you are left to choose between
DIRICHLET and NEUMANN - which really means *homogeneous* Dirichlet and 
Neumann bc in the existing code.

I suspect that the diffusion bc appropriate for your problem is more 
complex than homogeneous Dirichlet or Neumann. Perhaps you want to specify 
a fixed temperature (inhomogenious Dirichlet); or specify a mixed bc that 
does not specify either values or derivatives at a boundary separately but 
specifies some relation between them. The former could be possible quite
easily, the latter with a bit more effort. Either will require at least 
some code changes.

The lower-level implementation of the diffusion bcs can be found in 

  source/Grid/GridSolvers/HYPRE/gr_hypreApplyBcToFace.F90 .

If you can formulate what your bc should do in terms of 1D stencils 
(normal to the boundary) acting on discrete temperature cell values, 
adding an implementation as a new case in gr_hypreApplyBcToFace.F90 should 
be straightforward.  Some additional changes in various routines would be 
needed so that the choice of bc (including e.g. a fixed temperature value) 
can be specified as input and is passed down to the lower-level routines.


More information about the flash-users mailing list