Applying a pressure load Answered

Hello, I keep getting an error when I run my script. I would like to apply a pressure load in the Y direction starting at the PZT and water interface. Can someone help me understand what I am doing wrong and why I am getting this error. I included the script below. Thank you! 

 

c mem 800 200 /* Allocate 800 megawords of memory - 3 GigaBytes (Not necesarry for Windows Operating Systems)
c NOTE: MEM Command must be first command in file, if used. (Line 1)
rest no

c *************************************************************************************************************
c
c Generated Flex Input File
c
c *************************************************************************************************************
c
c DESIGNER :OnScale - Designer Generated
c MODEL DESCRIPTION :
c DATE CREATED :11 Jul 2020
c VERSION :1.0
c *************************************************************************************************************

mp
omp * * /* Number of CPUs to be used in the execution.
end

titl PZTDisc_2

c *************************************************************************************************************
c
c Define User Variables
c
c *************************************************************************************************************
c
c These variables have been set by the user through the interface.
c
c *************************************************************************************************************

symb coordFactor = 1.0 /* Coordinate conversion factor
symb timeFactor = 1.0 /* Time conversion factor
symb dMassFactor = 1.0 /* Mass conversion factor
c symb freqint = 1e+6 /* Determined Drive Frequency (Hz)
symb freqint = 500e+3 /* Determined Drive Frequency (Hz)
c *************************************************************************************************************
c
c Define Meshing
c
c *************************************************************************************************************
c
c Set the variable for the approximate element size for the model. Must be
c sufficient to represent the wavelengths of interest. Recommended that at least
c 15 elements per wavelength are used.

c
c *************************************************************************************************************

symb freqdamp = $freqint
symb wavevel = 1496 /* Longitudinal wave velocity in material (m/s)
symb wavelgth = $wavevel / $freqint /* Wavelength of sound in material (m)
symb nmesh = 30 /* Elements per wavelength
symb box = $wavelgth / $nmesh

c *************************************************************************************************************
c
c Geometry Locations (XYZ)
c
c *************************************************************************************************************


c Scale Parameters
symb xmin = 0.0 * $coordFactor
symb x_particle = 0.00052 * $coordFactor
symb x_pzt = 0.034 * $coordFactor
symb xmax = 0.034 * $coordFactor

symb ymin = 0.0 * $coordFactor
symb y_pzt_b = 0.004 * $coordFactor
symb y_pzt_t = 0.006 * $coordFactor
symb y_particle_b = 0.016 * $coordFactor
symb y_particle_t = 0.0165 * $coordFactor
symb ymax = 0.046 * $coordFactor


c Determine lengths of the model
symb xlen = ( $xmax - $xmin )
symb ylen = ( $ymax - $ymin )

c ***************************************************
c
c Keypoints in the X-Direction
c
c ***************************************************

symb #keycord x 1 $xmin $x_particle $x_pzt $xlen
symb #get { idx } rootmax x

c ***************************************************
c
c Keypoints in the Y-Direction
c
c ***************************************************

symb #keycord y 1 $ymin $y_pzt_b $y_pzt_t $y_particle_b $y_particle_t $ylen
symb #get { jdx } rootmax y

c *************************************************************************************************************
c
c Indices Locations (IJK)
c
c *************************************************************************************************************

c Grid in I direction, using approximately element size of 'box' and at least 1 element
symb #keyindx i 1 $idx 1 $box 1
symb indgrd = $i$idx

c Grid in J direction, using approximately element size of 'box' and at least 1 element
symb #keyindx j 1 $jdx 1 $box 1
symb jndgrd = $j$jdx


c *************************************************************************************************************
c
c GCON Grid & Geometry Allocation
c
c *************************************************************************************************************

grid $i$idx $j$jdx axiy
geom
keypnt $idx $jdx
end

c *************************************************************************************************************
c
c Driving Conditions
c
c *************************************************************************************************************
c
c A number of predefined waveform functions can be accessed in OnScale. The DATA
c HIST option is used below, other examples include wavelets, gaussians and step
c functions. The manual details the function entries

c
c *************************************************************************************************************

symb freqtimefunc_1 = $freqint
symb timeperiod = 1 / $freqint
symb numbercyc = 3 * ( $xlen / $wavelgth ) /* change the number to multiply the transiant time

c func
c name timefunc_1
c sine $freqtimefunc_1 1.0 0. $numbercyc 0. 0.0 /*frequency amplitude phaseshift nperiod valuadd rampcycle tdelay
c end
func sine $freqint 50.0 0. $numbercyc 0. 0.0 /*drfine (freq amp phaseshift #cycles)

c --------------------------------------------------------------
c Project Material List
c --------------------------------------------------------------


c -------------------------------------------------------------------------
c Global variables used in all the material definitions
c -------------------------------------------------------------------------
c
symb epvacm = 8.854e-12 /* dielectric constant for vacumn
symb freqdamp = 1.e6 if noexist /* specified frequency for damping model
symb rmu0 = 1.2566e-6

symb #msg 5
********************************************************
Damping matched at $freqdamp Hz
Redefine variable 'freqdamp' if device centre frequency
varies significantly from this value
********************************************************


c
c -------------------------------------------------------------------------
c Now define the axis transformation - only posx used in this file
c -------------------------------------------------------------------------

axis
form vctr
defn posx car2 0. 0. 0. 1. 0. 0. 0. 1. 0.
defn negx car2 0. 0. 0. -1. 0. 0. 0. 1. 0.
defn posy car2 0. 0. 0. 0. 1. 0. 0. 0. 1.
defn negy car2 0. 0. 0. 0. -1. 0. 0. 0. 1.
defn posz car2 0. 0. 0. 0. 0. 1. 1. 0. 0.
defn negz car2 0. 0. 0. 0. 0. -1. 1. 0. 0.
end

c -------------------------------------------------------------------------
c Input material properties to program
c -------------------------------------------------------------------------

matr
c --------------------------------------------------------------
c type : BIOLOGICAL :
c name : watr :
c desc : Water at 25C :
c --------------------------------------------------------------


wvsp on
type elas
prop watr 1054.00 1540.00 0.00000 0.010000
vdmp watr $freqdamp db 0.500000 0.00000 1e+6 1.00000 0.010000 1.00000
symb eps = 1
symb aeps = $epvacm * $eps
elec watr $aeps



c --------------------------------------------------------------
c type : GAS :
c name : air :
c desc : Air, room temp :
c --------------------------------------------------------------


wvsp on
type elas
prop air 1.24000 343.000 0.00000 0.
symb eps = 1
symb aeps = $epvacm * $eps
elec air $aeps

c --------------------------------------------------------------
c type : PIEZO :
c name : pmt3 :
c desc : CTS 3203HD :
c --------------------------------------------------------------


symb rho = 7820.00 /* density
symb qdmp = 90.0000 /* Mechanical Q at 1e6
symb qsdmp = 90.0000 /* Mechanical Q at 1e6
symb freqdamp = 1.e6 if noexist
symb freqloss = 1.00000e+06 if noexist /* Frequency that loss was measured at

wvsp off
type lean

c define baseline stiffness coefficients (Constant electric field)

symb c11 = 1.3745e+11
symb c12 = 8.79e+10
symb c13 = 9.23e+10
symb c14 = 0
symb c15 = 0
symb c16 = 0
symb c22 = 1.3745e+11
symb c23 = 9.23e+10
symb c24 = 0
symb c25 = 0
symb c26 = 0
symb c33 = 1.2574e+11
symb c34 = 0
symb c35 = 0
symb c36 = 0
symb c44 = 2.2279e+10
symb c45 = 0
symb c46 = 0
symb c55 = 2.2279e+10
symb c56 = 0
symb c66 = 2.4779e+10

prop pmt3 $rho
$c11 $c12 $c13 $c14 $c15 $c16 $c22
$c23 $c24 $c25 $c26 $c33 $c34 $c35
$c36 $c44 $c45 $c46 $c55 $c56 $c66

c define baseline dielectric coefficients

symb epxx = 1305.8
symb epyy = 1305.8
symb epzz = 1200.2

c scale material properties as specified above
symb aepxx = $epvacm * $epxx
symb aepyy = $epvacm * $epyy
symb aepzz = $epvacm * $epzz

elec pmt3 $aepxx $aepyy $aepzz

c define baseline piezoelectric coupling coefficients

symb ex1 = 0 /* coupling constant
symb ex2 = 0 /* coupling constant
symb ex3 = 0 /* coupling constant
symb ex4 = 0 /* coupling constant
symb ex5 = 16.054 /* coupling constant
symb ex6 = 0 /* coupling constant
symb ey1 = 0 /* coupling constant
symb ey2 = 0 /* coupling constant
symb ey3 = 0 /* coupling constant
symb ey4 = 16.054 /* coupling constant
symb ey5 = 0 /* coupling constant
symb ey6 = 0 /* coupling constant
symb ez1 = -9.44 /* coupling constant
symb ez2 = -9.44 /* coupling constant
symb ez3 = 22.495 /* coupling constant
symb ez4 = 0 /* coupling constant
symb ez5 = 0 /* coupling constant
symb ez6 = 0 /* coupling constant

piez pmt3 1 1 $ex1 1 2 $ex2 1 3 $ex3 1 4 $ex4 1 5 $ex5 1 6 $ex6 &
2 1 $ey1 2 2 $ey2 2 3 $ey3 2 4 $ey4 2 5 $ey5 2 6 $ey6 &
3 1 $ez1 3 2 $ez2 3 3 $ez3 3 4 $ez4 3 5 $ez5 3 6 $ez6

rdmp pmt3 $freqdamp q $qdmp $qsdmp 1e+6 1.0

axis pmt3 posy /* relate materials local system to global system


c --------------------------------------------------------------
c type : MISC :
c name : si :
c desc : Silicon, generic :
c --------------------------------------------------------------


wvsp on
type elas
prop si 2330 7526 4346 0.01
vdmp si $freqdamp db 0.1 0.3 1e+6 1 0.01 1
thrm si 702 124 124 124 1.0 0 0 27
symb eps = 11.9
symb aeps = $epvacm * $eps
elec si $aeps

elec void $epvacm


c --------------------------------------------------------------
c type : EPOXY :
c name : arald1 :
c desc : Araldite MY750/HY956EN :
c --------------------------------------------------------------


wvsp on
type elas
prop arald1 1146 2658 1237 0.01
vdmp arald1 $freqdamp db 4 12.59 1e+6 1 0.01 1
symb eps = 3.5
symb aeps = $epvacm * $eps
elec arald1 $aeps

elec void $epvacm

end

 

 

 

c *************************************************************************************************************
c
c Primitive Definitions
c
c *************************************************************************************************************

site
c regn void
blok watr $i1 $i4 $j3 $j6
c blok si 0.0 0.001 0.026 0.027 0.0 0.0 /* rectangle chip location
c blok watr 0.0 0.0005 0.026 0.027 0.0 0.0 /* square chip location
blok arald1 $i1 $i2 $j4 $j5 /* rectangle chip location (X: 0-0.00052, Y: 0.016-0.0165)
blok air $i1 $i4 $j1 $j2
blok pmt3 $i1 $i3 $j2 $j3
end


c Plot Model
grph
nvew 2 1 /* Set up 2 views
plot matr i $i1 $i4 j $j1 $j6 /* Plot Model
mirr x on /* Apply visual symmetry
plot matr /* Replot Model
end
term

c *************************************************************************************************************
c
c Boundary Definitions
c
c *************************************************************************************************************

boun
side xmin symm
side xmax absr
side ymin absr
side ymax absr
end

c *************************************************************************************************************
c
c Calculated Properties
c
c *************************************************************************************************************
c
c By default, Flex only calculates the minimum required data set, typically this
c means only velocities. This is done for memory efficiency. Should other
c properites be required (e.g. displacements, stresses, strains, pressure), then
c these must be requested by the CALC command. The manual lists all these options

c
c *************************************************************************************************************

calc
pres acoustic /* calculate acoustic pressure
max aprs none apmx /* calculate min/max acoustic pressure
disp y /* calculate displacements
end

c *************************************************************************************************************
c
c Piezoelectric Load Definitions
c
c *************************************************************************************************************

c piez
c wndo auto piez
c defn load_1 6.28
c symb bxmin = 0.0 * $coordFactor - $box
c symb bymin = 0.006 * $coordFactor - $box
c symb #get { is js * } clsnode $bxmin $bymin *
c symb bxmax = 0.01 * $coordFactor + $box
c symb bymax = 0.006 * $coordFactor + $box
c symb #get { ie je * } clsnode $bxmax $bymax *
c nod2 pmt3 watr $is $ie $js $je * *
c bc load_1 volt functimefunc_1 10.0 0.0
c
c defn load_2 6.28
c nod2 pmt3 air
c bc load_2 grnd
c slvr drct
c end

 

c *************************************************************************************************************
c
c Pressure Load Definitions
c
c *************************************************************************************************************

plod
pdef pld1 func /*define a load
c matr vctr1 air out
vctr vct1 0 1 0 /*define the vector
c sdef load_1 vector_1 $i1 $i2 $j2 $j2 /*apply a load in the vector direction
c sdef pld1 vct1 $i1 $i3 $j3 $j3 /*apply a load in the vector direction

end


time * * 0.95

c *************************************************************************************************************
c
c Process Model
c
c *************************************************************************************************************
c
c Issue process (PRCS) command. Checks model integrity, and calculates stable
c time step. NOTE: Process command must always be issued

c
c *************************************************************************************************************

c symb #msg c Checking Model Integrity......
prcs

grph
colr user size 5 /* how many materials are defined in this model
colr user 1 0.0 0.0 1.0
colr user 2 0.0 1.0 1.0
colr user 3 0.0 1.0 0.0
colr user 4 1.0 0.0 0.0 /* Si chip (red)
colr user 5 1.0 1.0 0.0 /* arald1 chip (yellow)

colr tabl matr 7
map watr 1
map air 2
map pmt3 3
map si 4
map arald1 5

end

grph
line off
nvew 2 1
arrow pole
plot piez
plot matr piez
arrow off
end

term

c *************************************************************************************************************
c
c Choose Time Histories To Store
c
c *************************************************************************************************************
c
c Save field (such as displacement or pressure) from a node or element for all
c time steps with POUT command. Histories are referenced by order of
c specification. Histories will be saved in the Flex History file (flxhst).

c
c *************************************************************************************************************

pout
rate 1
symb xloc = 0.0 * $coordFactor
symb yloc = 0.015 * $coordFactor
hist xyz aprs $xloc * * $yloc * *
hist functimefunc_1
histname electrode vq all
end

c *************************************************************************************************************
c
c Run the Model
c
c *************************************************************************************************************
c
c Specify the number of time steps to be run. Can be set to auto by using
c 'Ringdown'.

c
c *************************************************************************************************************

c User defined runtime for the model
symb #get { step } timestep
symb ttime = 4e-5
c symb ttime = 8e-5
c symb ttime = 12e-5
c symb ttime = 3 * $numbercyc * $timeperiod

symb nexec = $ttime / $step
symb nloops = 10
symb nexec2 = $nexec / $nloops


c Set up Plotting
grph
nvew 1 1
set imag tiff
end

c Set up Snapshot file


c Create run plot procedure
proc plot save

c Run some timesteps
exec $nexec2

c Plot model
grph
plot aprs
plot ydsp
imag
end

c data
c out yvel
c out ydsp
c out xvel
c out aprs
c end


data
file out 'water_output_data.flxdato'
out modl
out aprs
out apmx
out yvmx
out yvel
out xvel
end
c
c data
c file out 'snapshot.mat'
c form out matlab output_data
c out yvel
c c out ydsp
c out xvel
c c out aprs
c end
c
end$ proc

c Run model then wait
proc plot $nloops

term


c *************************************************************************************************************
c
c Save symbol variables to file for later use
c
c *************************************************************************************************************

symb #get { labl } jobname
symb #save '$labl.symb'
stop /* return to command prompt

2 comments

  • Official comment

    Hi Tiffany!

    The issue is in the site blok command. You are using nodal indices to define the block region but the command takes xyz co-odrinates (see command ref) so if you change $i1 to $x1 and $j3 to $y3 etc you will see the model plot:

     

     

    Best Regards,

    Chloe

    Comment actions Permalink
  • Hello Chloe,

    Thank you for the reply. I updated the site block as you suggested but it still does not run. Should I also be using the same syntax for defining the pressure region for the plod command? I attached my updated code below. 

     

     

    c mem 800 200 /* Allocate 800 megawords of memory - 3 GigaBytes (Not necesarry for Windows Operating Systems)
    c NOTE: MEM Command must be first command in file, if used. (Line 1)
    rest no

    c *************************************************************************************************************
    c
    c Generated Flex Input File
    c
    c *************************************************************************************************************
    c
    c DESIGNER :OnScale - Designer Generated
    c MODEL DESCRIPTION :
    c DATE CREATED :11 Jul 2020
    c VERSION :1.0
    c *************************************************************************************************************

    mp
    omp * * /* Number of CPUs to be used in the execution.
    end

    titl PZTDisc_2

    c *************************************************************************************************************
    c
    c Define User Variables
    c
    c *************************************************************************************************************
    c
    c These variables have been set by the user through the interface.
    c
    c *************************************************************************************************************

    symb coordFactor = 1.0 /* Coordinate conversion factor
    symb timeFactor = 1.0 /* Time conversion factor
    symb dMassFactor = 1.0 /* Mass conversion factor
    c symb freqint = 1e+6 /* Determined Drive Frequency (Hz)
    symb freqint = 500e+3 /* Determined Drive Frequency (Hz)
    c *************************************************************************************************************
    c
    c Define Meshing
    c
    c *************************************************************************************************************
    c
    c Set the variable for the approximate element size for the model. Must be
    c sufficient to represent the wavelengths of interest. Recommended that at least
    c 15 elements per wavelength are used.

    c
    c *************************************************************************************************************

    symb freqdamp = $freqint
    symb wavevel = 1496 /* Longitudinal wave velocity in material (m/s)
    symb wavelgth = $wavevel / $freqint /* Wavelength of sound in material (m)
    symb nmesh = 30 /* Elements per wavelength
    symb box = $wavelgth / $nmesh

    c *************************************************************************************************************
    c
    c Geometry Locations (XYZ)
    c
    c *************************************************************************************************************


    c Scale Parameters
    symb xmin = 0.0 * $coordFactor
    symb x_particle = 0.00052 * $coordFactor
    symb x_pzt = 0.034 * $coordFactor
    symb xmax = 0.034 * $coordFactor

    symb ymin = 0.0 * $coordFactor
    symb y_pzt_b = 0.004 * $coordFactor
    symb y_pzt_t = 0.006 * $coordFactor
    symb y_particle_b = 0.016 * $coordFactor
    symb y_particle_t = 0.0165 * $coordFactor
    symb ymax = 0.046 * $coordFactor


    c Determine lengths of the model
    symb xlen = ( $xmax - $xmin )
    symb ylen = ( $ymax - $ymin )

    c ***************************************************
    c
    c Keypoints in the X-Direction
    c
    c ***************************************************

    symb #keycord x 1 $xmin $x_particle $x_pzt $xlen
    symb #get { idx } rootmax x

    c ***************************************************
    c
    c Keypoints in the Y-Direction
    c
    c ***************************************************

    symb #keycord y 1 $ymin $y_pzt_b $y_pzt_t $y_particle_b $y_particle_t $ylen
    symb #get { jdx } rootmax y

    c *************************************************************************************************************
    c
    c Indices Locations (IJK)
    c
    c *************************************************************************************************************

    c Grid in I direction, using approximately element size of 'box' and at least 1 element
    symb #keyindx i 1 $idx 1 $box 1
    symb indgrd = $i$idx

    c Grid in J direction, using approximately element size of 'box' and at least 1 element
    symb #keyindx j 1 $jdx 1 $box 1
    symb jndgrd = $j$jdx


    c *************************************************************************************************************
    c
    c GCON Grid & Geometry Allocation
    c
    c *************************************************************************************************************

    grid $i$idx $j$jdx axiy
    geom
    keypnt $idx $jdx
    end

    c *************************************************************************************************************
    c
    c Driving Conditions
    c
    c *************************************************************************************************************
    c
    c A number of predefined waveform functions can be accessed in OnScale. The DATA
    c HIST option is used below, other examples include wavelets, gaussians and step
    c functions. The manual details the function entries

    c
    c *************************************************************************************************************

    symb freqtimefunc_1 = $freqint
    symb timeperiod = 1 / $freqint
    symb numbercyc = 3 * ( $xlen / $wavelgth ) /* change the number to multiply the transiant time

    c func
    c name timefunc_1
    c sine $freqtimefunc_1 1.0 0. $numbercyc 0. 0.0 /*frequency amplitude phaseshift nperiod valuadd rampcycle tdelay
    c end
    func sine $freqint 50.0 0. $numbercyc 0. 0.0 /*drfine (freq amp phaseshift #cycles)

    c --------------------------------------------------------------
    c Project Material List
    c --------------------------------------------------------------


    c -------------------------------------------------------------------------
    c Global variables used in all the material definitions
    c -------------------------------------------------------------------------
    c
    symb epvacm = 8.854e-12 /* dielectric constant for vacumn
    symb freqdamp = 1.e6 if noexist /* specified frequency for damping model
    symb rmu0 = 1.2566e-6

    symb #msg 5
    ********************************************************
    Damping matched at $freqdamp Hz
    Redefine variable 'freqdamp' if device centre frequency
    varies significantly from this value
    ********************************************************


    c
    c -------------------------------------------------------------------------
    c Now define the axis transformation - only posx used in this file
    c -------------------------------------------------------------------------

    axis
    form vctr
    defn posx car2 0. 0. 0. 1. 0. 0. 0. 1. 0.
    defn negx car2 0. 0. 0. -1. 0. 0. 0. 1. 0.
    defn posy car2 0. 0. 0. 0. 1. 0. 0. 0. 1.
    defn negy car2 0. 0. 0. 0. -1. 0. 0. 0. 1.
    defn posz car2 0. 0. 0. 0. 0. 1. 1. 0. 0.
    defn negz car2 0. 0. 0. 0. 0. -1. 1. 0. 0.
    end

    c -------------------------------------------------------------------------
    c Input material properties to program
    c -------------------------------------------------------------------------

    matr
    c --------------------------------------------------------------
    c type : BIOLOGICAL :
    c name : watr :
    c desc : Water at 25C :
    c --------------------------------------------------------------


    wvsp on
    type elas
    prop watr 1054.00 1540.00 0.00000 0.010000
    vdmp watr $freqdamp db 0.500000 0.00000 1e+6 1.00000 0.010000 1.00000
    symb eps = 1
    symb aeps = $epvacm * $eps
    elec watr $aeps



    c --------------------------------------------------------------
    c type : GAS :
    c name : air :
    c desc : Air, room temp :
    c --------------------------------------------------------------


    wvsp on
    type elas
    prop air 1.24000 343.000 0.00000 0.
    symb eps = 1
    symb aeps = $epvacm * $eps
    elec air $aeps

    c --------------------------------------------------------------
    c type : PIEZO :
    c name : pmt3 :
    c desc : CTS 3203HD :
    c --------------------------------------------------------------


    symb rho = 7820.00 /* density
    symb qdmp = 90.0000 /* Mechanical Q at 1e6
    symb qsdmp = 90.0000 /* Mechanical Q at 1e6
    symb freqdamp = 1.e6 if noexist
    symb freqloss = 1.00000e+06 if noexist /* Frequency that loss was measured at

    wvsp off
    type lean

    c define baseline stiffness coefficients (Constant electric field)

    symb c11 = 1.3745e+11
    symb c12 = 8.79e+10
    symb c13 = 9.23e+10
    symb c14 = 0
    symb c15 = 0
    symb c16 = 0
    symb c22 = 1.3745e+11
    symb c23 = 9.23e+10
    symb c24 = 0
    symb c25 = 0
    symb c26 = 0
    symb c33 = 1.2574e+11
    symb c34 = 0
    symb c35 = 0
    symb c36 = 0
    symb c44 = 2.2279e+10
    symb c45 = 0
    symb c46 = 0
    symb c55 = 2.2279e+10
    symb c56 = 0
    symb c66 = 2.4779e+10

    prop pmt3 $rho
    $c11 $c12 $c13 $c14 $c15 $c16 $c22
    $c23 $c24 $c25 $c26 $c33 $c34 $c35
    $c36 $c44 $c45 $c46 $c55 $c56 $c66

    c define baseline dielectric coefficients

    symb epxx = 1305.8
    symb epyy = 1305.8
    symb epzz = 1200.2

    c scale material properties as specified above
    symb aepxx = $epvacm * $epxx
    symb aepyy = $epvacm * $epyy
    symb aepzz = $epvacm * $epzz

    elec pmt3 $aepxx $aepyy $aepzz

    c define baseline piezoelectric coupling coefficients

    symb ex1 = 0 /* coupling constant
    symb ex2 = 0 /* coupling constant
    symb ex3 = 0 /* coupling constant
    symb ex4 = 0 /* coupling constant
    symb ex5 = 16.054 /* coupling constant
    symb ex6 = 0 /* coupling constant
    symb ey1 = 0 /* coupling constant
    symb ey2 = 0 /* coupling constant
    symb ey3 = 0 /* coupling constant
    symb ey4 = 16.054 /* coupling constant
    symb ey5 = 0 /* coupling constant
    symb ey6 = 0 /* coupling constant
    symb ez1 = -9.44 /* coupling constant
    symb ez2 = -9.44 /* coupling constant
    symb ez3 = 22.495 /* coupling constant
    symb ez4 = 0 /* coupling constant
    symb ez5 = 0 /* coupling constant
    symb ez6 = 0 /* coupling constant

    piez pmt3 1 1 $ex1 1 2 $ex2 1 3 $ex3 1 4 $ex4 1 5 $ex5 1 6 $ex6 &
    2 1 $ey1 2 2 $ey2 2 3 $ey3 2 4 $ey4 2 5 $ey5 2 6 $ey6 &
    3 1 $ez1 3 2 $ez2 3 3 $ez3 3 4 $ez4 3 5 $ez5 3 6 $ez6

    rdmp pmt3 $freqdamp q $qdmp $qsdmp 1e+6 1.0

    axis pmt3 posy /* relate materials local system to global system


    c --------------------------------------------------------------
    c type : MISC :
    c name : si :
    c desc : Silicon, generic :
    c --------------------------------------------------------------


    wvsp on
    type elas
    prop si 2330 7526 4346 0.01
    vdmp si $freqdamp db 0.1 0.3 1e+6 1 0.01 1
    thrm si 702 124 124 124 1.0 0 0 27
    symb eps = 11.9
    symb aeps = $epvacm * $eps
    elec si $aeps

    elec void $epvacm


    c --------------------------------------------------------------
    c type : EPOXY :
    c name : arald1 :
    c desc : Araldite MY750/HY956EN :
    c --------------------------------------------------------------


    wvsp on
    type elas
    prop arald1 1146 2658 1237 0.01
    vdmp arald1 $freqdamp db 4 12.59 1e+6 1 0.01 1
    symb eps = 3.5
    symb aeps = $epvacm * $eps
    elec arald1 $aeps

    elec void $epvacm

    end

     

     

     

    c *************************************************************************************************************
    c
    c Primitive Definitions
    c
    c *************************************************************************************************************

    site
    c regn void
    blok watr $x1 $x4 $y3 $y6
    c blok si 0.0 0.001 0.026 0.027 0.0 0.0 /* rectangle chip location
    c blok watr 0.0 0.0005 0.026 0.027 0.0 0.0 /* square chip location
    blok arald1 $x1 $x2 $y4 $y5 /* rectangle chip location (X: 0-0.00052, Y: 0.016-0.0165)
    blok air $x1 $x4 $y1 $y2
    blok pmt3 $x1 $x3 $y2 $y3
    end


    c Plot Model
    grph
    nvew 2 1 /* Set up 2 views
    plot matr i $i1 $i4 j $j1 $j6 /* Plot Model
    mirr x on /* Apply visual symmetry
    plot matr /* Replot Model
    end
    term

    c *************************************************************************************************************
    c
    c Boundary Definitions
    c
    c *************************************************************************************************************

    boun
    side xmin symm
    side xmax absr
    side ymin absr
    side ymax absr
    end

    c *************************************************************************************************************
    c
    c Calculated Properties
    c
    c *************************************************************************************************************
    c
    c By default, Flex only calculates the minimum required data set, typically this
    c means only velocities. This is done for memory efficiency. Should other
    c properites be required (e.g. displacements, stresses, strains, pressure), then
    c these must be requested by the CALC command. The manual lists all these options

    c
    c *************************************************************************************************************

    calc
    pres acoustic /* calculate acoustic pressure
    max aprs none apmx /* calculate min/max acoustic pressure
    disp y /* calculate displacements
    end

    c *************************************************************************************************************
    c
    c Piezoelectric Load Definitions
    c
    c *************************************************************************************************************

    c piez
    c wndo auto piez
    c defn load_1 6.28
    c symb bxmin = 0.0 * $coordFactor - $box
    c symb bymin = 0.006 * $coordFactor - $box
    c symb #get { is js * } clsnode $bxmin $bymin *
    c symb bxmax = 0.01 * $coordFactor + $box
    c symb bymax = 0.006 * $coordFactor + $box
    c symb #get { ie je * } clsnode $bxmax $bymax *
    c nod2 pmt3 watr $is $ie $js $je * *
    c bc load_1 volt functimefunc_1 10.0 0.0
    c
    c defn load_2 6.28
    c nod2 pmt3 air
    c bc load_2 grnd
    c slvr drct
    c end

     

    c *************************************************************************************************************
    c
    c Pressure Load Definitions
    c
    c *************************************************************************************************************

    plod
    pdef pld1 func /*define a load
    c matr vctr1 air out
    vctr vct1 0 1 0 /*define the vector
    c sdef load_1 vector_1 $i1 $i2 $j2 $j2 /*apply a load in the vector direction
    sdef pld1 vct1 $i1 $i3 $j3 $j3 /*apply a load in the vector direction

    end


    time * * 0.95

    c *************************************************************************************************************
    c
    c Process Model
    c
    c *************************************************************************************************************
    c
    c Issue process (PRCS) command. Checks model integrity, and calculates stable
    c time step. NOTE: Process command must always be issued

    c
    c *************************************************************************************************************

    c symb #msg c Checking Model Integrity......
    prcs

    grph
    colr user size 5 /* how many materials are defined in this model
    colr user 1 0.0 0.0 1.0
    colr user 2 0.0 1.0 1.0
    colr user 3 0.0 1.0 0.0
    colr user 4 1.0 0.0 0.0 /* Si chip (red)
    colr user 5 1.0 1.0 0.0 /* arald1 chip (yellow)

    colr tabl matr 7
    map watr 1
    map air 2
    map pmt3 3
    map si 4
    map arald1 5

    end

    grph
    line off
    nvew 2 1
    arrow pole
    plot piez
    plot matr piez
    arrow off
    end

    term

    c *************************************************************************************************************
    c
    c Choose Time Histories To Store
    c
    c *************************************************************************************************************
    c
    c Save field (such as displacement or pressure) from a node or element for all
    c time steps with POUT command. Histories are referenced by order of
    c specification. Histories will be saved in the Flex History file (flxhst).

    c
    c *************************************************************************************************************

    pout
    rate 1
    symb xloc = 0.0 * $coordFactor
    symb yloc = 0.015 * $coordFactor
    hist xyz aprs $xloc * * $yloc * *
    hist functimefunc_1
    histname electrode vq all
    end

    c *************************************************************************************************************
    c
    c Run the Model
    c
    c *************************************************************************************************************
    c
    c Specify the number of time steps to be run. Can be set to auto by using
    c 'Ringdown'.

    c
    c *************************************************************************************************************

    c User defined runtime for the model
    symb #get { step } timestep
    symb ttime = 4e-5
    c symb ttime = 8e-5
    c symb ttime = 12e-5
    c symb ttime = 3 * $numbercyc * $timeperiod

    symb nexec = $ttime / $step
    symb nloops = 10
    symb nexec2 = $nexec / $nloops


    c Set up Plotting
    grph
    nvew 1 1
    set imag tiff
    end

    c Set up Snapshot file


    c Create run plot procedure
    proc plot save

    c Run some timesteps
    exec $nexec2

    c Plot model
    grph
    plot aprs
    plot ydsp
    imag
    end

    c data
    c out yvel
    c out ydsp
    c out xvel
    c out aprs
    c end


    data
    file out 'water_output_data.flxdato'
    out modl
    out aprs
    out apmx
    out yvmx
    out yvel
    out xvel
    end
    c
    c data
    c file out 'snapshot.mat'
    c form out matlab output_data
    c out yvel
    c c out ydsp
    c out xvel
    c c out aprs
    c end
    c
    end$ proc

    c Run model then wait
    proc plot $nloops

    term


    c *************************************************************************************************************
    c
    c Save symbol variables to file for later use
    c
    c *************************************************************************************************************

    symb #get { labl } jobname
    symb #save '$labl.symb'
    stop /* return to command prompt

     

    Comment actions Permalink

Please sign in to leave a comment.

Didn't find what you were looking for?

New post