[aspect-devel] The syntax for the function expression

Max Rudolph maxwellr at gmail.com
Mon Sep 12 09:35:20 PDT 2016


Nan,
Depth dependent viscosity doesn't allow lateral variation of the prefactor
so there's no need for theta and phi in the list of variables. The
'Variable names' should contain only one variable (depth, usually z). This
is from an example for box geometry in 3 dimensions
(tests/depth_dependent_box_function_simple.prm):
For this type of viscosity structure, it may be easier to use the 'list'
rather then 'function' input. The 'list' input imposes piecewise constant
viscosity prefactor. Note that this is different behavior from using
'File', which uses linear interpolation.

subsection Material model
  set Model name = depth dependent
  subsection Depth dependent model
    set Base model = simple
    set Depth dependence method = Function
    subsection Viscosity depth function
      set Variable names = d
      set Function expression = if(d>6.70e5,3.0e22,1.0e21);
    end
  end
  subsection Simple model
    set Reference density             = 3300.0
    set Reference specific heat       = 1250.0
    set Reference temperature         = 0
    set Thermal conductivity          = 4.0
    set Thermal expansion coefficient = 2e-5
    set Viscosity                     = 1e25
  end
end

Cheers
Max

On Sun, Sep 11, 2016 at 3:53 AM, Nan Zhang <Nan.Zhang at colorado.edu> wrote:

> Hi all,
>
>
> When I use function expression in my material model like:
>
> *****************************************
>
> subsection Material model
>
>   set Model name = depth dependent
>
>
>
>   subsection Depth dependent model
>
>     set Base model = simple
>
>     set Depth dependence method = Function
>
>
>
>     subsection Viscosity depth function
>
>       set Variable names      = r,phi,theta
>
>       set Function expression = if( r>5670000, 5e21, 2e22 )
>
>       #set Function expression = if( r>5670000, 5e21,
> (1e22*(22.72-8*r/2189e3)) )
>
>     end
>
>   end
>
>   subsection Simple model
>
>     set Thermal expansion coefficient = 4e-5
>
>     set Viscosity                     = 1e22
>
>     set Thermal viscosity exponent = 8.0   #following 1 2 3
>
>     set Reference temperature = 1600
>
>     set Density differential for compositional field 1 = 165
>
>   end
>
> end
>
> *****************************************
>
>
>
> I got error report like:
>
> *****************************************
>
> FunctionParser failed to parse
>
> FunctionParser failed to parse
>
> FunctionParser failed to parse
>
>          Viscosity depth function
>
>          Viscosity depth function
>
> with expression
>
> with expression
>
>          Viscosity depth function
>
> FunctionParser failed to parse
>
> with expression
>
> FunctionParser failed to parse
>
> FunctionParser failed to parse
>
>         '       '        Viscosity depth function
>
>         '        Viscosity depth function
>
> with expression
>
> with expression
>
> if( r>5670000, 5e21, 2e22 )     ' 'FunctionParser failed to parse
>
> *****************************************
>
>
>
> I looked at source code like some thing “viscosity_function.parse_
> parameters(prm);”. It is the same as other function expression as in “Compositional
> initial conditions”. I could do the function expression in “Compositional
> initial conditions”, but failed in “set Depth dependence method = Function”?
> How to check the syntax difference between the "Viscosity depth function"
> and "Compositional initial conditions"?
>
>
>
> Cheers,
> Nan
>
> _______________________________________________
> Aspect-devel mailing list
> Aspect-devel at geodynamics.org
> http://lists.geodynamics.org/cgi-bin/mailman/listinfo/aspect-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geodynamics.org/pipermail/aspect-devel/attachments/20160912/52031516/attachment.html>


More information about the Aspect-devel mailing list