derivative wrt normal vector

Numerical methods and mathematical models of Elmer
Post Reply
suren
Posts: 18
Joined: 17 Nov 2009, 18:38

derivative wrt normal vector

Post by suren »

hi all,

I have a couple of questions regarding Stokes coding (.f90 for ElmerSolver:

(i) dV/dn (differentiation of velocity component with respect to unit normal vector "n")
(ii) P. lx (pressure projection in direction x)... here lx = dx/dn is cosine of unit normal 'n' at the boundary line...

Hope to hearing... very soon,
suren
raback
Site Admin
Posts: 3889
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: derivative wrt normal vector

Post by raback »

suren wrote: (i) dV/dn (differentiation of velocity component with respect to unit normal vector "n")
You could perhaps use the SaveLine solver componentwise. Or you could take a gradient of a velocity componentt with FluxSolver (see ModelsManual Ch. 30) and take a dot product with the normal vector (computed with NormalSolver as in $ELMER_HOME/tests/normals) in your postprocessor. Unfortunately I can't come up with a simple way of doing it to the velocity vector.
(ii) P. lx (pressure projection in direction x)... here lx = dx/dn is cosine of unit normal 'n' at the boundary line...
This is not that well sopported either. You could also here compute the normal vector field and take a product with the pressure in your postprocessor.

It might be a good idea to implement both as operators in the SaveLine solver.

-Peter
suren
Posts: 18
Joined: 17 Nov 2009, 18:38

Re: derivative wrt normal vector

Post by suren »

Hi Peter,

many thanks for your prompt reply... I think now its working well... have a couple more (general) questions re: Stokes problems...

(i) In the NS-source code I can see an internal subroutine LCondensate (for nb > 0) ... what does that do actually? I have coded without this... but got a good result in case of Newtonian fluid (flow law exponent n =1)... including this subroutine doesn't affect/improve the outcomes...

(ii) I am actually working with glaciological problems... have to use power law for viscosity (n = 3), which (as a function of strain-rate, and hence velocity) is to be solved iteratively... I realize I have done the correct coding, but couldn't achieve the results I want... dont know where I got lost... is there anyway I can send my code where you can have a quick look at? Just wondering... any sort of tips would be highly appreciated...

One more thing- I tried to use Function MaterialModels... but the velocity arguments are given as three scalars i.e. U, V, and W... rather than a single vector i.e. Velocity... I am working with the later one... so simply not compatible (array mismatch!)... tried to go with U, V, W system rather than 'Velocity', couldnt get the right one... FYI: I am very new for Elmer...

many thanks, Peter.
~suren.
tzwinger
Site Admin
Posts: 94
Joined: 24 Aug 2009, 12:20
Contact:

Re: derivative wrt normal vector

Post by tzwinger »

Hi Suren,
(i) In the NS-source code I can see an internal subroutine LCondensate (for nb > 0) ... what does that do actually? I have coded without this... but got a good result in case of Newtonian fluid (flow law exponent n =1)... including this subroutine doesn't affect/improve the outcomes...
This is only needed if you use the Residual Free Bubbles as the stabilization method. I presume you are not using them, but rather the more common Stabilized Elements.
(ii) I am actually working with glaciological problems... have to use power law for viscosity (n = 3), which (as a function of strain-rate, and hence velocity) is to be solved iteratively... I realize I have done the correct coding, but couldn't achieve the results I want... dont know where I got lost... is there anyway I can send my code where you can have a quick look at? Just wondering... any sort of tips would be highly appreciated...
There is a nice description on Glen's flow law being implemented as a MATC function under http://www.elmerfem.org/wiki/index.php/Glen's_flow_law. Admittedly, there where a few things missing there, which I updated a minute ago.
One more thing- I tried to use Function MaterialModels... but the velocity arguments are given as three scalars i.e. U, V, and W... rather than a single vector i.e. Velocity... I am working with the later one... so simply not compatible (array mismatch!)... tried to go with U, V, W system rather than 'Velocity', couldnt get the right one... FYI: I am very new for Elmer...
I do not get that one, sorry. MaterialModels is a module you can use. What function within MaterialModels are you referring to?

Best wishes,

Thomas
suren
Posts: 18
Joined: 17 Nov 2009, 18:38

Re: Glaciological problems

Post by suren »

Thanks a lot, Thomas.

My coding for Newtonian fluid (n =1) yields the same velocity field (for ISMIP-HOM B005 domain: max horizontal velocity ~175 m a-1) as of standard NS solver (with convection term muted)... but, for the same input, my subroutine gives different value of norm (~ 3450 or so) than that from standard NS solver (~ 150 or so) ... I employed norm = DefaultSolve()...

is that usual thing? I think something is going wrong within my subroutine.... perhaps, that's why the material nonlinearity (n=3) function is showing some fully results (no matter when I use my own coding, or standard "power law" function from "ModelMaterials" module... I have standard NS solver ISMIP-HOM benchmark results to compare my results with...

hope to hearing a few words of advice
~suren.
raback
Site Admin
Posts: 3889
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Norm computation in Navier-Stokes solver

Post by raback »

The norm of the default Navier-Stokes is taken from velocity components only. The reason for this is that summing up velocity and pressure does not really make sense. Depending on the scaling the pressure might dominate (as in your case). The remedy is to give the number of velocity components (2 or 3) with the following keyword in Solver section. Then the pressure is not accounted for in the norm computation.

Code: Select all

  Nonlinear System Norm Dofs = vdofs
-Peter

PS. When the topic changes you could rather start a new one than continue under the original topic
Post Reply