CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

modify laplacian: div(k*grad(a*u))

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   August 5, 2011, 11:42
Default modify laplacian: div(k*grad(a*u))
  #1
New Member
 
Join Date: Aug 2011
Posts: 6
Rep Power: 5
gunnar2 is on a distinguished road
Hello,
I am trying to solve a type of heat equation:

\partial u/ \partial t + \nabla\cdot\mathbf{v} u - \nabla\cdot k \nabla \alpha u =0

The difference to the standard heat equation is the scalar field alpha.
The problem is that the last term cannot be expressed as fvm::laplacian(k,alpha*u), because apparently alpha*u is not the right class for this argument, and the compiler fails.

How can this PDE be solved?

Thanks
Gunnar

Last edited by gunnar2; August 8, 2011 at 13:26. Reason: correction: replaced [math]\nabla\cdot\phi u[/math] with [math]\nabla\cdot\mathbf{v} u[/math]
gunnar2 is offline   Reply With Quote

Old   August 6, 2011, 05:00
Default
  #2
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 322
Rep Power: 8
ata is on a distinguished road
Hi
I think you can define a new field newfield=alpha*u and use fvc::laplacian(k,new)
good luck
ata is offline   Reply With Quote

Old   August 6, 2011, 06:11
Default
  #3
New Member
 
Join Date: Aug 2011
Posts: 6
Rep Power: 5
gunnar2 is on a distinguished road
But I need the implicit (fvm::laplacian), not the explicit (fvc::laplacian) term.

If there is no such term, it should be possible to use something like fvm::laplacian(k,u)*diag(alpha) for \nabla\cdot k\nabla \alpha u.
diag(alpha) would be a sparse diagonal matrix with the entries of the field alpha on it's diagonal, but I don't think such matrix exists in Openfoam.
What do you think, does it make sense to implement it?

Thanks
Gunnar
gunnar2 is offline   Reply With Quote

Old   August 7, 2011, 05:10
Default
  #4
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 322
Rep Power: 8
ata is on a distinguished road
Hi
I do not know
ata is offline   Reply With Quote

Old   August 7, 2011, 11:42
Default
  #5
Member
 
Michael Roth
Join Date: Mar 2009
Location: Guelph, Ontario, Canada
Posts: 46
Rep Power: 8
roth is on a distinguished road
How about a little chain rule? i.e. split into:
Code:
\nabla \cdot ( k \alpha \nabla u ) + \nabla \cdot ( k u \nabla \alpha )
Then treat the first term implicit (by defining a new diffusivity of k\alpha) and second term explicit.
roth is offline   Reply With Quote

Old   August 7, 2011, 12:29
Default
  #6
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 322
Rep Power: 8
ata is on a distinguished road
Hi
But you loose conservative form.
ata is offline   Reply With Quote

Old   August 8, 2011, 08:43
Default
  #7
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 418
Rep Power: 14
santiagomarquezd will become famous soon enough
First of all the equation appears to be not consistent, the first and last terms are vectorial, meanwhile the second one is scalar.

Regards.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Post-doctoral Fellow
Research Center for Computational Mechanics (CIMEC) - CONICET/FICH-UNL
T.E.: 54-342-4511594 Ext. 1005
Güemes 3450 - (3000) Santa Fe
Santa Fe - Argentina
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   August 21, 2011, 14:53
Default
  #8
Senior Member
 
Mieszko Młody
Join Date: Mar 2009
Location: POLAND, USA
Posts: 129
Rep Power: 8
ziemowitzima is on a distinguished road
Hi Gunnar,
If the only think you need is modification of the discretization matrix (by multiplying diag(alpha)), then you can change the matrix itself.
See the PISO algorithm from icoFoam:
http://openfoamwiki.net/index.php/IcoFoam
You can do similar and:
1. discretize alpha
2. UEqn.A() = UEqn.A()*alpha_discretized

maybe will work...
ZMM
ziemowitzima is offline   Reply With Quote

Old   August 21, 2011, 16:44
Default
  #9
Member
 
Kai
Join Date: May 2010
Location: Stockholm
Posts: 40
Rep Power: 7
kaifu is on a distinguished road
\nabla\cdot (k \nabla \alpha \mathbf{u}) =\nabla \cdot (k\alpha\nabla \mathbf{u})+\nabla\cdot (k \mathbf{u} \nabla \alpha)=\nabla \cdot (k\alpha\nabla \mathbf{u})+(\nabla \cdot k \mathbf{u})\nabla \alpha
__________________
Kai
kaifu is offline   Reply With Quote

Old   August 21, 2011, 17:36
Default
  #10
Senior Member
 
Mieszko Młody
Join Date: Mar 2009
Location: POLAND, USA
Posts: 129
Rep Power: 8
ziemowitzima is on a distinguished road
Hi Kai,
Of course,
I would proceed using this transformation.
Currently I have some issues with laplacian operator in OFoam as well.
Could you see my post:
laplacian problem

Maybe you will have some suggestions...
Thanks
ZMM
ziemowitzima is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Modifying the laplacian operator mlawson OpenFOAM Running, Solving & CFD 11 September 7, 2011 12:30
Modify mesh runtime Daniele111 OpenFOAM Meshing & Mesh Conversion 8 December 19, 2010 16:43
"=" or "==" when I modify BC (fixedGradient) during run ? Cyp OpenFOAM Programming & Development 0 December 14, 2010 09:12
Crank Nicholson scheme for Laplacian failed Cyp OpenFOAM 3 July 19, 2010 07:58
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55


All times are GMT -4. The time now is 09:02.