Author Topic: Parametrize variable according to height  (Read 14107 times)

R2197

  • Jr. Member
  • **
  • Posts: 25
Parametrize variable according to height
« on: February 03, 2024, 03:22:28 AM »
Hi, I am trying to input a variable which is parametrized according to the height of the domain. How can I achieve this through the input file. It seems quite possible but I am not sure which variable to use. My geometry description is this.
parameter
 nx = 5      
 ny = 5        
 nz = 5
 lx = 0.5
 ly = 0.5
 lz = 0.5

block 1
 cartean nx ny nz 0 0 1 0 10
 1 0.0 0.0 0.0
 2 lx  0.0 0.0
 3 lx  ly  0.0
 4 0.0 ly  0.0
 5 0.0 0.0 lz
 6 lx  0.0 lz
 7 lx  ly  lz
 8 0.0 ly  lz

parameter
 P = Contant* height     

how can I achieve this?

Thanks
« Last Edit: February 06, 2024, 12:08:10 AM by R2197 »

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2647
Re: Parametrze variable according to height
« Reply #1 on: February 03, 2024, 09:53:41 AM »
I assume you want to vary 'lz' as the height of the problem.  You can run several different values for this using two input files: (1) the file for analysis (which I name Iprob below - replace by the name you have).  In this file set the parameter as "lz = 0.5*p" (but do not define "p").

In the second file (I name Irun) you set "p" and run the problem using

param
  p = 1

  include Iprob

If "p" can be a multiple this file can use a loop form after

loop
  param
    p = p*2

    include Iprob
next

If you want to  increment p then in the Iprob file you could set lz = 0.5 + p and then increment in the second file.

To execute you use

feap -iIrun

or give the file "Irun" the way you currently execute feap.

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1160
Re: Parametrze variable according to height
« Reply #2 on: February 03, 2024, 10:08:43 AM »
If on the other had you want P to be equal to a multiple of lz, then you can simple write something like
Code: [Select]
PARAmeter
  P = 5*lz

R2197

  • Jr. Member
  • **
  • Posts: 25
Re: Parametrze variable according to height
« Reply #3 on: February 05, 2024, 02:08:12 AM »
Hello Profs.
Thanks for the replies.

I think I didnt explain what I want exactly. I want a parameter that changes with the vertical position and not the overall height. An example would be.

Lz=0.5

P=0 at z=0
P=0.1 at z=0.1
P=0.2 at z=0.2
P=0.3 at z=0.3
P=0.4 at z=0.4
P=0.5 at z=0.5

and so on. But as I understand the suggestions that were given were based on the overall height Lz. I apologise for the miscommunication.

Thanks

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2647
Re: Parametrze variable according to height
« Reply #4 on: February 05, 2024, 03:27:54 PM »
param
  p  = 0
  dz = 0.1

loop,,6

  include Isolve  -- problem to solve or solution you want to do
  param
    p = p + dz

next

Otherwise explain what you want to do with the parameter "p"

R2197

  • Jr. Member
  • **
  • Posts: 25
Re: Parametrize variable according to height
« Reply #5 on: February 06, 2024, 12:07:59 AM »
Hello Prof. Taylor

I am trying to simulate algal photosynthesis on the ocean surface. The phenomena is dependent on light, which in turn looses its intensity as we go below the surface. Now to create such a simulation, I need a domain with height Lz, in which the parameter for light intensity, P is a function of vertical position. So, at the top surface P is highest and at the bottom, it is lowest.

I want to achieve something like this.

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1160
Re: Parametrize variable according to height
« Reply #6 on: February 06, 2024, 12:55:26 AM »
How do you wish to use the parameter p in your simulation?
Without that information is it hard to make a good suggestion.

R2197

  • Jr. Member
  • **
  • Posts: 25
Re: Parametrize variable according to height
« Reply #7 on: February 08, 2024, 04:50:15 AM »
Hello Prof.

I am attaching a picture of the equation that I want to solve. The function E_Par(Z) is dependent on the vertical position in the domain. The differential equation for S_c is solved in my simulation.

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2647
Re: Parametrize variable according to height
« Reply #8 on: February 08, 2024, 08:01:48 AM »
Does this appear in the constitutive equation or element loading?  If so you can compute the location from element nodal values and shape functions.  Or tell us where you need to compute it.           

R2197

  • Jr. Member
  • **
  • Posts: 25
Re: Parametrize variable according to height
« Reply #9 on: February 14, 2024, 07:57:27 AM »
The S_c has its own degree of freedom. It is not a constitutive equation and I am not entirely sure what you mean by element loading.

Yes, element nodal values would be reasonable and that's also what I thought but I am not sure how to access that. And if I can, would it be in the input file, the material or the element file.

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2647
Re: Parametrize variable according to height
« Reply #10 on: February 14, 2024, 10:32:13 AM »
If. you want to know the value of a parameter in your routine you can use

call getparam( par, p_value, error, prt

par = name of parameter, eg, 'p' (in quotes)

p_value = real*8 value returned (always real, can cast as integer)

error = logical -- true if error in getting, otherwise false

par  = logical, print value found if .true.