velocity of nodes in the linear elasticity

Numerical methods and mathematical models of Elmer
studdrud
Posts: 13
Joined: 24 Sep 2009, 10:47

velocity of nodes in the linear elasticity

Post by studdrud »

Hello elmer-team,

i'am using the strucure-tool of elmer: the linear easticity. I'am computing some examples in transient simulation. My question now is: how can i get the current velocity of nodes at a time step?
I've tried this one:
Solver 1
Equation = Linear elasticity
Procedure = "StressSolve" "StressSolver"
Variable = -dofs 3 Displacement
Exported Variable 1 = -dofs 3 Velocity
...
but it didn't work. In the result file, the velocity is zero:
velocity 1
Perm: use previous
0.0000000000000000
0.0000000000000000
0.0000000000000000
0.0000000000000000
0.0000000000000000
0.0000000000000000
0.0000000000000000
...

regards rn
raback
Site Admin
Posts: 4866
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: velocity of nodes in the linear elasticity

Post by raback »

Unfortunately velocity (and acceleration) are (to my knowledge) only internal fields. You might do it quite easily with a few lines of Fortran somewhere in StressSolve:

Code: Select all

  CALL VariableAdd( Solver % Mesh % Variables, Solver % Mesh, Solver, &
           'Displacement Velo', DIM, StressSol % PrevValues(:,1), StressSol % Perm)
This associates the existing vector i.e. the 1st PrevValues vector to a mesh and name, and makes it thereby ready for saving. For 2nd order PDEs the 2nd component is accelaration.

This functionality might be built in an a generic level. I hope it works, didn't test it...

-Peter
studdrud
Posts: 13
Joined: 24 Sep 2009, 10:47

Re: velocity of nodes in the linear elasticity

Post by studdrud »

Thanks for the reply,
i've tried the solution you proposed and i get this, when i typed make in the terminal in /elmerfem/trunk/fem/src:
...
make[2]: Leaving directory `/home/rudolf/elmerfem/trunk/fem/src/binio'
make[1]: Leaving directory `/home/rudolf/elmerfem/trunk/fem/src/binio'
make[1]: Entering directory `/home/rudolf/elmerfem/trunk/fem/src'
gfortran -O -m64 -fPIC -fPIC -I. -Ibinio -c StressSolve.f90
StressSolve.f90:518.36:

'Displacement Velo', DIM, StressSol % PrevValues(:,1), StressSol % P
1
Fehler: Effektives Argument für »values« muss ein Zeiger bei (1) sein
make[1]: *** [StressSolve.o] Fehler 1
make[1]: Leaving directory `/home/rudolf/elmerfem/trunk/fem/src'
make: *** [all-recursive] Fehler 1

It means that it has to be a pointer at (1) for the argument "values"

regards rn
raback
Site Admin
Posts: 4866
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: velocity of nodes in the linear elasticity

Post by raback »

Ok, sorry for the bug. Maybe you can delcleare some pointers as in

Code: Select all

REAL(KIND=dp),  POINTER :: VeloValues(:)
VeloValues => StressSol % PrevValues(:,1)
studdrud
Posts: 13
Joined: 24 Sep 2009, 10:47

Re: velocity of nodes in the linear elasticity

Post by studdrud »

Ok, i putted the terms in StressSolve.f90 it looks no wlike this:
...
REAL(KIND=dp), POINTER :: DispValues(:)
REAL(KIND=dp), POINTER :: VeloValues(:)
REAL(KIND=dp), ALLOCATABLE :: UpdateRef(:), Ref_rhs(:), NodalRefD(:)
...
Var => VariableGet( Solver % Mesh % Variables, 'VonMises' )
IF ( .NOT. ASSOCIATED( Var ) ) THEN
ALLOCATE( VonMises( n ) )
CALL VariableAdd(Solver % Mesh % Variables, Solver % Mesh, Solver, &
'VonMises', 1, VonMises, DisplPerm )
END IF
!-----------------------------------------------------------------------------------
! added 20.10
!-----------------------------------------------------------------------------------
VeloValues => StressSol % PrevValues(:,1)
CALL VariableAdd( Solver % Mesh % Variables, Solver % Mesh, Solver, &
'Displacement Velo', DIM, VeloValues, StressSol % Perm)
!-----------------------------------------------------------------------------------

IF(CalcPrincipalAll) THEN
Var => VariableGet( Solver % Mesh % Variables, 'Principal Stress' )
IF ( .NOT. ASSOCIATED( Var ) ) THEN
ALLOCATE( PrincipalStress( 3*n ) )
...
The compilation was successfull. But how can i write out the velocity? i tried this with:
Exported Variable 1 = -dofs 3 Displacement Velo
but it doesn't work. Then i tried it with:
Equation 1
Name = "Equation 1"
Calculate Stresses = True
Active Solvers(2) = 2 1
End
but it wrote only the stresses.
regards rn
raback
Site Admin
Posts: 4866
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: velocity of nodes in the linear elasticity

Post by raback »

It should write the values by default. Adding the 'Exported Variable' just allocates the same name the second time. Are you sure you run the modified version? Adding some print command may often be a good idea. Note that you need do the modifications to the .src file, and to say 'make install' in order to copy the modified solver in the correct destination. The .f90 is obtained from .src after the preprocessing.

-Peter
studdrud
Posts: 13
Joined: 24 Sep 2009, 10:47

Re: velocity of nodes in the linear elasticity

Post by studdrud »

ok sorry, i've done make but i've forgotten to make install. i am new in linux and not so familar with this stuff.
the solver writes the new variable "displacement velo" out in the result-file automatically, if i turn the calculation of stress on.
it looks like this:
Degrees of freedom:
displacement 3 :fs
stress 6 :fs
displacement velo 3 :fs
displacement 1 1 :fs
displacement 2 1 :fs
displacement 3 1 :fs
stress 1 1 :fs
stress 2 1 :fs
stress 3 1 :fs
stress 4 1 :fs
stress 5 1 :fs
stress 6 1 :fs
vonmises 1 :fs
Total DOFs: 10
Number Of Nodes: 179
Time: 1 1 0.100300000000E+001
displacement 1
Perm: 179 179
...
the variable is listed but there are nowhere the results for this variable in the result-file. I've postprocessed this case and paraview showed the displacemnt and the stresses but didn't show the new variable
displacment velo.

regards rn
raback
Site Admin
Posts: 4866
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: velocity of nodes in the linear elasticity

Post by raback »

Ok, I forgot that the vector fields are available as themselves and their components. The latter ones are used in saving. Try the following:

Code: Select all

VeloValues => StressSol % PrevValues(:,1)
CALL VariableAdd( Solver % Mesh % Variables, Solver % Mesh, Solver, &
'Displacement Velo', DIM, VeloValues, StressSol % Perm)
DO i=1,DIM
  VeloValues => StressSol % PrevValues(i::DIM,1)
  CALL VariableAdd( Solver % Mesh % Variables, Solver % Mesh, Solver, &
  'Displacement Velo '//CHAR(i+ICHAR('0')), 1, VeloValues, StressSol % Perm)
END DO
-Peter
studdrud
Posts: 13
Joined: 24 Sep 2009, 10:47

Re: velocity of nodes in the linear elasticity

Post by studdrud »

Thank you very much for the great help.
It works and the result looks good!

regards rn
beautylife
Posts: 5
Joined: 21 Dec 2009, 19:28

Re: velocity of nodes in the linear elasticity

Post by beautylife »

I'm using windows xp. How one may do this upgrading in windows environment?
Post Reply