timevary_comsol

  • Upload
    ayaoba

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

  • 8/9/2019 timevary_comsol

    1/3

    2007 Cornell University

    BEE453, Professor Ashim Datta

    Authored by Vineet Rakesh

    Software: COMSOL Multiphysics 3.3

    Specifying time varying Boundary Conditions

    Suppose you want to model a flow where the boundary conditions are changing with time. Take the

    case of diffusion of drug from a patch into the skin. The drug concentration in the patch falls down with

    time and hence we need a time varying flux condition on the skin boundary where the drug is diffusing

    into the skin. This is an example of time varying boundary condition applied to the species transfer

    equation. The same may be true in case of the energy or the momentum equation. For example, take

    the case of air intake through the nose. If a full cycle of inhalation and exhalation is considered, it can

    be seen that the velocity of air flowing in varies with time. We can implement these models in

    COMSOL. The following example uses heat flux as the variable for the time varying input.

    Temperature, species concentration, flux (heat and species), velocity and material property values can

    be defined as time varying quantities similarly. These variables will be denoted as dependant

    variables in the subsequent discussion.

    COMSOL provides us with 2 options to specify time varying boundary conditions.

    The dependant variable can be defined as a function of time by specifying a set of data points

    (dependant variable vs. time) (see Method 1 below) similar to how we specified properties

    varying with temperature for the CRYOSURGERY Tutorial.

    The second option in COMSOL is to specify the dependant variable as any function of time.

    (see Method 2 below)

  • 8/9/2019 timevary_comsol

    2/3

    2007 Cornell University 2

    Example 1: Specifying Data Points

    1) Open the Boundary Settings window:

    Physics >> Boundary Settings >> Select

    Heat Flux under Boundary Condition from

    the drop-down menu for the Boundary you

    want to specify the time varying heat flux

    for.

    2) In the Inward Heat Flux, q0, field, enter

    heat_flux(t). heat_flux(t) tells COMSOL that

    heat_flux (to be specified in Step 4 later) is

    a function of time. heat_flux is any arbitrary

    user defined name chosen for the function.

    3) Click on OK. We will now define the

    function, heat_flux(t).

    4) Under Options, click on Functions

    5) Click on the New button

    6) Next to Function name: type in heat_flux

    7) Check Interpolation. By checking this, we

    are directing the solver to interpolate values

    of heat flux between different times.

    8) Select Table next to the Use data from box

    9) Click OK

    10) Enter the time and the corresponding heat

    flux values in the text boxes. The first

    column (under x) shows the values of time

    and f(x) represents the corresponding heat

    flux values. Click on Ok

    4

    5

  • 8/9/2019 timevary_comsol

    3/3

    2007 Cornell University 3

    Example 2: Specifying an Exponential Function

    1) Open the Boundary Settings window:

    Physics >> Boundary Settings >>

    Select Heat Flux under Boundary

    Condition from the drop-down menu

    for the Boundary you want to specify

    the time varying heat flux for.

    2) In the Inward Heat Flux, q0, field, enter

    heat_flux. heat_flux tells COMSOL

    that heat_flux (to be specified in Step

    4 later) is a function of some other

    variables. heat_flux is any arbitrary

    user defined name chosen for thefunction.

    3) Click on OK. We will now define the

    function, heat_flux.

    4) Under Options, click on Expressions >>

    Global Expressions

    5) In the Global Expressions window,

    define heat_flux a s function of time. In

    this example we say heat_flux =

    1.4t+0.7t2. heat_flux can be defined as

    a function of any independent

    variables using this method.

    6) Click Ok.

    Note: The expression can directly be input

    in theInward Heat Flux, q0.