simtime in analyst mode Answered

Hi I have questions about simtime in analyst mode

c Runtime calculations
symb #get { step } timestep        /* Extract calculated timestep from PRCS command
symb simtime = 20 / $freqint    /* Simulation time - 40 Cycles @ 1 MHz
symb nexec = $simtime / $step    /* Determine how many timesteps to run full model
symb nloops = 20                /* Plotting snapshots during model execution
symb nexec2 = $nexec / $nloops    /* Partition full simulation into smaller segments for Plotting

I change the number 20 in "simtime" to 80, to increase the simulation time for estimating longer time.

But if i change the number 20 to 80 simulation increases, but piezo top voltage changes. When I put 80 there aren't any output signal at 5e-05 time but 20 have.Below graphs are when constant is 20, 80, 20&80 in order. what i don't understand more is that displacement and charges are all the same on the overlapping time.

Can you tell me what's my problem is? I only change the constant in "simtime"

Always thank you for helping me.

 

 

3 comments

  • The results should be the same for the time that the two simulations overlap. Increasing the number from 20 to 80 should not change anything for the first 59us. 80 -> 20 + 60. The same operations occur between 20 and the first 20 of 80.

    If there is a difference it is likely that something else has changed in your model.There currently is not enough information to determine what this could be. Do you mind sharing the entirity of your script?

     

    Comment actions Permalink
  • sorry for my late reply
    Here is my entire script. I only change my simulation time constant but get the difference result.
    Thanks for your help :)


    c Set model title
    titl Training PZT 2D Disc Example 
     
    c Use all cores
    mp omp 2 *
     
    c Do not save restart file
    rest no 
     
    c ************************************************************************************************************
    c MODEL INPUTS
    c ************************************************************************************************************
     
    /* Geometry
    symbx air_size1 = 4e-3 /* Dimension of Water around Transducer
    symbx air_size2 = 4e-3 /* Dimension of Water around Transducer
    symbx air_size3 = 20e-3
    symbx pzt_rad = 10e-3 /* PZT Radius
    symbx pzt_thk = 2e-3 /* PZT Thickness
     
    /* Frequency and mesh
    symb freqint = 1e6 /* Frequency of Interest
    symb freqdamp = $freqint /* Set damping frequency to frequency of operation
    symb vel = 1500 /* Minimum material velocity in model
    symb wavelength = $vel / $freqint /* Calculate Smallest Wavelength to discretised
    symb nepw = 15 /* Number of elements per wavelength
    symb box = $wavelength / $nepw /* Calculate Element size for Meshing
     
    c ***********************************************************************************************************
    c MESHING
    c ***********************************************************************************************************
     
    c Create X-Y-Z Keypoints to accurately model dimensions
    symb #keycord x 1 0.0 $pzt_rad $air_size1
    symb #get { idx } rootmax x /* Store last keypoint indice in variable 'idx'
     
    symb #keycord y 1 0.0 $air_size2 $pzt_thk $air_size3
    symb #get { jdx } rootmax y /* Store last keypoint indice in variable 'jdx'
     
    c Create I-J-K Keypoints  
    symb #keyindx i 1 $idx 1 $box 1 /* Calculate number of nodes required in the I direction
    symb #keyindx j 1 $jdx 1 $box 1 /* Calculate number of nodes required in the J direction
     
    symb indgrd = $i$idx /* Last node number in I direction
    symb jndgrd = $j$jdx /* Last node number in J direction
     
    c Create Grid
    grid $indgrd $jndgrd axiy /* Generate Grid of Nodes and apply Axisymmetric condition to model grid
     
    c Map Physical Geometry to Grid of Nodes
    geom keypnt $idx $jdx /* Tie in all XY Keypoints (Physical Dimensions) to IJ Keypoints(Nodes)
     
    c **********************************************************************************************************
    c MATERIAL PROPERTIES
    c **********************************************************************************************************
     
    c Material definitions
    symb #read Training.prjmat /* Materials stored in .PRJMAT file and read into Flex model
     
    c Allocate materials to grid
    site
    /* This is a comment
    regn watr/* Assign WATR to full grid
    regn pmt3 $i1 $i2 $j2 $j3/* Assign Material 'pmt3' to grid defined by nodal range
    end
    grph 
    mirr x on
    plot matr
    end
    term
    c **********************************************************************************************************
    c BOUNDARY CONDITIONS & LOADING
    c **********************************************************************************************************
     
    c External boundary conditions
    boun
    side xmin symm/* Assign Symmetry condition XMIN side of model  
    side xmax absr/* Assign Absorbing boundary condition (Infinite Medium)
    side ymin absr/* to XMAX YMIN and YMAX side
    side ymax free 
    end
     
    /* Define time varying function
    func wvlt $freqint 10 
    c func sine $freqint 1 0 0
     
    circ
    defn rx_circ
    elem rest sers 50
    end
     
    c Piezoelectric loads
    piez
    wndo $i1 $i2 $j2 $j3/* Define electric window to PZT material - minimise for faster model run time
     
    defn top /* Define electrode - name 'top'
    node $i1 $i2 $j3 $j3/* Assign nodes for top electrode
     
    defn bot/* Define electrode - name 'bot'
    node $i1 $i2 $j2 $j2/* Assign nodes for bottom electrode
     
    /* Electrical Boundary Condition
    bc top volt func/* Apply voltage condition to 'top' electrode and assign driving signal 'func'
    bc bot grnd/* Apply ground condition to 'bot' electrode
     
    slvr pard /* Use PARDISO solver - our new faster electrostatic solver for PIEZO simulations
    end
     
    c ********************************************************************************************************
    c OUTPUTS
    c ********************************************************************************************************
     
    c Request calculation of additional arrays
    calc
    pres aprs/* Calculate acoustic pressure
    disp   /* Calculate X and Y displacements
    max aprs none pmax  /* Calculate maximum pressure field
    max ydsp none ydmax  /* Calculate maximum pressure field
    end
     
    c Request time domain outputs - Graphs of Data vs Time
    pout
    hist func/* Driving Function stored in Time History 1
    histname electrode vq top/* Driving Function stored in Time History 2 (V Top) 3 (Q Top) 4 (V Bot) 5 (Q Bot)
    hist ydsp $i1 $i1 1 $j3 $j3 1     /* y-displacement at node on the top electrode - array '6'
    /* hist aprs $i1 $i1 1 $j4 $j4 1 
    end
     
     
    shap /* Calculate Harmonic Behaviour at Particular Frequencies
      data xdsp /* Request data to be calculated for harmonic analysis
     data ydsp
     data aprs
    freq $freqint/* Request frequency for harmonic analysis
    end
     
     
    c *******************************************************************************************************
    c PROCESS MODEL
    c *******************************************************************************************************
     
    c Process model
    prcs      /* Check models, sets up required data arrays, calculates stable timestep for Solver to Run model
     
     
    c *******************************************************************************************************
    c MODEL EXECUTION
    c *******************************************************************************************************
     
    c Runtime calculations
    symb #get { step } timestep /* Extract calculated timestep from PRCS command
    symb simtime = 20 / $freqint /* Simulation time - 40 Cycles @ 1 MHz
    symb nexec = $simtime / $step /* Determine how many timesteps to run full model
    symb nloops = 20 /* Plotting snapshots during model execution
    symb nexec2 = $nexec / $nloops /* Partition full simulation into smaller segments for Plotting
     
    c Set up plotting
    grph
    arrow off/* Turn off arrows
    line off/* Turn off mesh lines
    c set imag mpeg /* Set image capture for movie file generation
    nvew 3 3/* Set up 3 plotting windows in layout number 3
    mirr x
    end
     
     
     
    c Set up Snapshot file
    data
    file out 'snapshot.flxdato' 
    end
     
    c Create run plot procedure
    proc plot save 
     
    c Run some timesteps
    exec $nexec2 
     
    c Plot model
    grph
    plot 3 
    imag
    end
     
    data
    out aprs 
    end
     
     
    end$ proc
     
    c Run model then wait
    proc plot $nloops 
     
    term
     
    data
    file out 'TxRx_model_example.flxdato' 
    out modl 
    end
     
     
     
     
     
     
    c Create Procedure - Code that can be executed 'x' number of times
    proc plot save /* Name procedure 'plot' and save the code
     
    exec $nexec2 /* Run model partially
     
    grph 
    plot aprs rang -1e5 1e5 /* Plot calculated data array
    plot 2/* Plot Time History 1 - Drive Function
    plot 3 /* Plot Time History 3 - Charge on Top electrode
    end
     
     
    end$ proc /* End of Procedure Code
     
    c Run model by calling 'plot' procedure 'nloops' times
    proc plot $nloops
     
    piez conn top rx_circ grnd
     
    proc plot $nloops
     
     
    term /* Pause model - Allow user to call procedure 'plot' from console window to run model for longer
     
     
     
     
     
    c *******************************************************************************************************
    c ADDITIONAL OUTPUTS
    c *******************************************************************************************************
     
     
    c Data outputs
    data
    out modl/* Output Model Geometry
    out pres/* Out all SHAP data - Harmonic Analysis
      out xdsp /* Out all SHAP data - Harmonic Analysis
      out ydsp /* Out all SHAP data - Harmonic Analysis
    end
     
    data
    file out SHAPE.flxdato
    out shap/all
    end
     
     
    c Save symbols to file for later use
    symb #get { labl } jobname /* find name of run
    symb #save '$labl.symb' /* save in symb file
     
    c End of input file
    stop

     

    Comment actions Permalink
  • You have configured your setup to change with time. When you change simTime from 20 to 80 you also change the time at which your model configuration changes. If you want them to be the same, keep the configuration fixed with time.

    Comment actions Permalink

Please sign in to leave a comment.

Didn't find what you were looking for?

New post