[aspect-devel] The syntax for the function expression

Max Rudolph maxwellr at gmail.com
Mon Sep 12 21:57:50 PDT 2016


Nan,
Jacky Austermann and I wrote the code for the depth-dependent material
model at the 2015 hackathon, and we added tests using each of the methods
to prescribe depth dependence in 2D and 3D, so you can look at these for
examples. The format of the function is described in the deal.ii manual for
the class ParsedFunction. If you want a linear increase in the lower
mantle, I agree that the function may be the easiest way to achieve this.
It works in 3D spherical geometry and also 2D annulus. Each geometry model
provides a means to query the depth from the boundary.

Max

On Mon, Sep 12, 2016 at 8:42 PM, Nan Zhang <Nan.Zhang at colorado.edu> wrote:

> Hi Max,
>
> Thanks for your comments! Do you think if it works for the spherical
> geometry? I am going to try.
>
> The reason that I prefer using "function" option is the need for a
> linear-increasing viscosity prefactor for the lower mantle. The "List"
> option won't work. I guess the "File" option should work too. Is there any
> example in the manual?
>
> My concern is there are many "function expression" within various
> subsections. It seems that they have different syntax or format. When I
> checked the source code as I mentioned in my previous email, it is hard to
> see the difference because they all kind of use "parse_parameters()".
>
> How did you find there examples in the user manual? I have read the
> manual, while certainly forgot it quickly.
>
> Cheers,
> Nan
>
>
> On Tue, Sep 13, 2016 at 12:35 AM, Max Rudolph <maxwellr at gmail.com> wrote:
>
>> 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_para
>>> meters(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/24d9ac0e/attachment-0001.html>


More information about the Aspect-devel mailing list