CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Implementation on Laplace-Beltrami operator

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By kuria

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 19, 2019, 04:16
Default Implementation on Laplace-Beltrami operator
  #1
Member
 
K
Join Date: Mar 2018
Posts: 34
Rep Power: 8
kuria is on a distinguished road
Hey everyone


I was trying to implement Laplace-Beltrami operator of velocity
\nabla_s u_i = \nabla u_i - (\Vec{m}\cdot\nabla u_i)\Vec{m}
\nabla^2_s u_i = \nabla\cdot\nabla_s u_i - (\Vec{m}\cdot\nabla)( \nabla_s u_i)\Vec{m}


So this is what I tried
volVectorField GradUi= fvc::grad(phi) - (m & fvc::grad(phi))*m;
volScalarField LBUi= fvc::div(GradUi) - (m & fvc::grad( GradUi & m );


But the problem with is implementation is that
GradUi (a tensor)
fvc::div(GradUi) is a vector because divergence of tensor
(m & fvc::grad( GradUi & m ) is a scalar


Can some one help with implementing these equation?


Thanks in advance
kuria is offline   Reply With Quote

Old   February 19, 2019, 07:55
Default
  #2
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Quote:
Originally Posted by kuria View Post
Hey everyone


I was trying to implement Laplace-Beltrami operator of velocity
\nabla_s u_i = \nabla u_i - (\Vec{m}\cdot\nabla u_i)\Vec{m}
\nabla^2_s u_i = \nabla\cdot\nabla_s u_i - (\Vec{m}\cdot\nabla)( \nabla_s u_i)\Vec{m}


So this is what I tried
volVectorField GradUi= fvc::grad(phi) - (m & fvc::grad(phi))*m;
volScalarField LBUi= fvc::div(GradUi) - (m & fvc::grad( GradUi & m );


But the problem with is implementation is that
GradUi (a tensor)
fvc::div(GradUi) is a vector because divergence of tensor
(m & fvc::grad( GradUi & m ) is a scalar


Can some one help with implementing these equation?


Thanks in advance
Which do you think is wrong , the openfoam implementation or the math behind the equations being solved? To me the openfoam part looks fine and the formula being solved is incorrect. The only operation between a scalar and a vector (that I'm familiar with) is multiplication so I don't see how the formula makes sense.

Last edited by massive_turbulence; February 21, 2019 at 05:45.
massive_turbulence is offline   Reply With Quote

Old   February 21, 2019, 05:46
Default
  #3
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Quote:
Originally Posted by kuria View Post
Hey everyone


I was trying to implement Laplace-Beltrami operator of velocity
\nabla_s u_i = \nabla u_i - (\Vec{m}\cdot\nabla u_i)\Vec{m}
\nabla^2_s u_i = \nabla\cdot\nabla_s u_i - (\Vec{m}\cdot\nabla)( \nabla_s u_i)\Vec{m}


So this is what I tried
volVectorField GradUi= fvc::grad(phi) - (m & fvc::grad(phi))*m;
volScalarField LBUi= fvc::div(GradUi) - (m & fvc::grad( GradUi & m );


But the problem with is implementation is that
GradUi (a tensor)
fvc::div(GradUi) is a vector because divergence of tensor
(m & fvc::grad( GradUi & m ) is a scalar


Can some one help with implementing these equation?


Thanks in advance

There maybe a way to represent the solution of a scalar and vector commutative operation as a parametric scalar equation but as far as I can see openfoam doesn't have such a representation. You would have to overload the minus operator for your equation to take the scalar and vector types and then create a new type that takes the components of each scalar and vector as a parametric equation.
massive_turbulence is offline   Reply With Quote

Old   February 21, 2019, 06:57
Default
  #4
Member
 
K
Join Date: Mar 2018
Posts: 34
Rep Power: 8
kuria is on a distinguished road
I looked around a little bit and as far I can see the equation what I have wrote before is what people have used.


I found this implementation to atleast compile:
surfaceVectorField GradUi= fvc::interpolate(fvc::grad(phi)) - (m & fvc::interpolate(fvc::grad(phi)) )*m;

surfaceScalarField LBUi1= fvc::interpolate(fvc::div(GradUi)) & mesh.Sf();
surfaceScalarField LBUi2= (m & ( fvc::interpolate(fvc::grad(GradUi)) ) ) & m;
LBUi = (LBUi1+LBUi2)/mesh.magSf();


I used the normal surface vector to the cell (mesh.Sf()) to ensure that the terms are compatible. I found a similar approach while calculating the curvature of interface where curvature which is defined as
k = - \nabla \cdot \nabla \frac{\nabla\alpha}{|\nabla\alpha|}
and implemented as
surfaceVectorField nHatfv(gradAlphaf/(mag(gradAlphaf) + deltaN));

surfaceScalarField nHatf = nHatfv & Sf;
volScalarField K = -fvc::div(nHatf);


What do you think of the the way I implemented it?
massive_turbulence likes this.
kuria is offline   Reply With Quote

Old   February 25, 2019, 11:00
Default
  #5
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Quote:
Originally Posted by kuria View Post
I looked around a little bit and as far I can see the equation what I have wrote before is what people have used.


I found this implementation to atleast compile:
surfaceVectorField GradUi= fvc::interpolate(fvc::grad(phi)) - (m & fvc::interpolate(fvc::grad(phi)) )*m;

surfaceScalarField LBUi1= fvc::interpolate(fvc::div(GradUi)) & mesh.Sf();
surfaceScalarField LBUi2= (m & ( fvc::interpolate(fvc::grad(GradUi)) ) ) & m;
LBUi = (LBUi1+LBUi2)/mesh.magSf();


I used the normal surface vector to the cell (mesh.Sf()) to ensure that the terms are compatible. I found a similar approach while calculating the curvature of interface where curvature which is defined as
k = - \nabla \cdot \nabla \frac{\nabla\alpha}{|\nabla\alpha|}
and implemented as
surfaceVectorField nHatfv(gradAlphaf/(mag(gradAlphaf) + deltaN));

surfaceScalarField nHatf = nHatfv & Sf;
volScalarField K = -fvc::div(nHatf);


What do you think of the the way I implemented it?

It's nice!
massive_turbulence is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ANSYS Workbench on "Uncertified" Linux Distros hsr CFX 289 April 20, 2023 10:23
FLUENT installation on UBUNTU 12.04 (LTS) teymourj FLUENT 2 March 1, 2017 23:24
Cahn Hilliard implementation (Biharmonic operator) jdpeterson3 OpenFOAM Running, Solving & CFD 0 February 15, 2016 03:36
Implementation issues of fvSchemes / laplacianScheme, in particular gaussLaplacianSch thomek OpenFOAM Programming & Development 0 October 18, 2010 06:10
Laplace operator in finite element formulation Rafael Main CFD Forum 2 October 19, 2004 22:09


All times are GMT -4. The time now is 22:38.