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

u.del v notation in openfoam

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By pedromiglopes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 27, 2010, 05:53
Default u.del v notation in openfoam
  #1
New Member
 
sunil
Join Date: Jan 2010
Posts: 8
Rep Power: 16
suniljain is on a distinguished road
hi,
how to write u . del v
or u dot del v in openfoam language for solver modification . here u and v are both vector.
please help me.
suniljain is offline   Reply With Quote

Old   November 6, 2014, 09:54
Default
  #2
New Member
 
Pedro Lopes
Join Date: Jun 2012
Location: Coimbra, Portugal
Posts: 4
Rep Power: 14
pedromiglopes is on a distinguished road
Hi Sunil,

Have you found the answer for your question?

Best regards,
Pedro
pedromiglopes is offline   Reply With Quote

Old   November 9, 2014, 07:05
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

I'm not familiar with the operator "del". What exactly is it?

Can you provide the expression in LaTeX form (explained here: http://www.cfd-online.com/Forums/sit...ne-forums.html ) or an image of the equation?

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   November 10, 2014, 06:54
Default
  #4
New Member
 
Pedro Lopes
Join Date: Jun 2012
Location: Coimbra, Portugal
Posts: 4
Rep Power: 14
pedromiglopes is on a distinguished road
Hi Bruno,

I supose that the word "del" means the "nabla" \nabla.
At least this is what makes more sense i.e. (\vec u \cdot \nabla) \vec u.

Do you know how to solve this term in OpenFOAM?

Kind regards,
Obrigado,

Pedro

Last edited by pedromiglopes; November 10, 2014 at 19:19.
pedromiglopes is offline   Reply With Quote

Old   November 10, 2014, 17:25
Default
  #5
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Pedro,

So it is! I found this today by chance on Wikipedia and everything: http://en.wikipedia.org/wiki/Del - weird name they gave it... the first thing that comes to mind is always that it would be a deletion operator, which doesn't make much sense

I don't have enough time right now (this week for that matter ), so the best I can do is suggest that you study the OpenFOAM Programmer's Guide, which is mentioned here: http://openfoamwiki.net/index.php/Ma...rGuideAddendum
It has a lot of information on this topic and that wiki page has already a few fixes for said document.

In addition, this comes to mind: http://openfoamwiki.net/index.php/ScalarTransportFoam

Good luck! Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   November 10, 2014, 19:08
Default
  #6
New Member
 
Pedro Lopes
Join Date: Jun 2012
Location: Coimbra, Portugal
Posts: 4
Rep Power: 14
pedromiglopes is on a distinguished road
Hi Bruno, thank you for the tips provided!

After some investigation I think I found the answer. Please correct me if I'm wrong.

(\vec u \cdot \nabla) \vec u = \nabla (\vec u \cdot \vec u)/2 - \vec u \times ( \nabla \times \vec u)
Font: http://pt.wikipedia.org/wiki/Nabla#Identidades (Just the Portuguese version of Wikipedia has this explanation)

which in OpenFOAM can be solved as:

(\vec u \cdot \nabla) \vec u = fvc::grad(U&U)/2 - (U^(fvc::curl(U)))

The compilation works at least. Let's wait for the results.

Regards,
Pedro
wyldckat likes this.
pedromiglopes is offline   Reply With Quote

Old   November 16, 2014, 18:45
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Pedro,

Looks good to me! Although the "2" should probably be "2.0", to avoid any accidental intermediate conversions of the calculations in between to integer values. In other words:
Code:
fvc::grad(U&U)/2.0 - (U^(fvc::curl(U)))
In Wikipedia in English, it's provided here: http://en.wikipedia.org/wiki/Vector_...or_dot_product - but it's in another format:
Quote:
As a special case, when A = B,
\frac{1}{2} \nabla \left( \mathbf{A}\cdot\mathbf{A} \right)
= \mathbf{J}^\mathrm{T}_\mathbf{A} \mathbf A
= (\mathbf{A} \cdot \nabla) \mathbf{A} + \mathbf{A} \times (\nabla \times \mathbf{A})
Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   July 6, 2015, 06:58
Default
  #8
Senior Member
 
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 15
danny123 is on a distinguished road
Hello,

Is there any answer to the original question? I think it is related to the convective term in UEqn.

In interFoam, we have the annotation:

Code:
fvm::div(rhoPhi, U)
which is (I guess):

\triangledown \cdot \left ( \rho \varphi U \right ) = \triangledown \cdot\left ( \rho \varphi \right ) U + \rho \varphi \cdot \triangledown U

The 1st product RHS term can be further split off:

\triangledown \cdot\left ( \rho \varphi \right ) = \rho \triangledown \cdot\left (  \varphi \right ) + \varphi \cdot \triangledown\rho

So, we get 2 so called directional derivatives. (Note:

\triangledown \cdot\left (  \varphi \right ) = 0

, so one term can be removed)

How can we implement this into OpenFoam? I see a potential advantage that U is present both as linear value and derivation, which potentially is faster in integration than just as a gradient.

Regards,

Daniel
danny123 is offline   Reply With Quote

Old   July 6, 2015, 07:36
Default
  #9
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 13
ssss is on a distinguished road
Quote:
Originally Posted by danny123
Hello,

Is there any answer to the original question? I think it is related to the convective term in UEqn.

In interFoam, we have the annotation:

Code:
fvm::div(rhoPhi, U)
which is (I guess):

\triangledown \cdot \left ( \rho \varphi U \right ) = \triangledown \cdot\left ( \rho \varphi \right ) U + \rho \varphi \cdot \triangledown U

The 1st product RHS term can be further split off:

\triangledown \cdot\left ( \rho \varphi \right ) = \rho \triangledown \cdot\left ( \varphi \right ) + \varphi \cdot \triangledown\rho

So, we get 2 so called directional derivatives. (Note:

\triangledown \cdot\left ( \varphi \right ) = 0

, so one term can be removed)

How can we implement this into OpenFoam? I see a potential advantage that U is present both as linear value and derivation, which potentially is faster in integration than just as a gradient.

Regards,

Daniel
In finite volume methods it is not necessary to apply the chain rule as you are trying to do. FVM works with the integral form of the transport equation an thus the term you are trying to discretise is the following:

\int_V \nabla \cdot (\rho \phi \vec{u} ) dV = \int_S (\rho \phi)_f \vec{u}_f  \cdot dS \simeq \sum_f (\rho \phi)_f \vec{u}_f \cdot \vec{S}_f

As you can see there is no need to split the divergence term with the chain rule. Although your approximation might be true in the differential form of the momentum equation, one must bare in mind that we are working with the weak form of the equation. Your approximation might also work, but numerically it might introduce instabilities because of the large gradients of the density in the interphase.
ssss is offline   Reply With Quote

Old   July 6, 2015, 08:59
Default
  #10
Senior Member
 
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 15
danny123 is on a distinguished road
Well,

I know how it is implemented right now. Nevertheless, there may be some benefit in describing the term differently. The original question was how to describe directional derivatives as I understand. If you apply this on the momentum equation, as an example, this may be useful or not. I want to try it out. The reason is that the U field is calculated as if it is a linear function in the momentum equation. The rho phi field contains the quadatic term and must be iterated separatly. This works only if both pEqn and the phi interpolation converge. So, I see the advantage of a potentially faster and more stable iteration.

The other point is that the above decribed formulation means that the momnetum equation is split of into a term due to the concentration gradient, the divergence of the flux and the gradient in U. If you remove the divergence of the flux term, you might get a more independent momentum equation (less influenced by the volumetric balance).

So, is there a way to describe directional derivatives in OpenFoam or not? I did not find anything of that kind in the user guide.

Regards,

Daniel
danny123 is offline   Reply With Quote

Old   July 7, 2015, 04:03
Default
  #11
Senior Member
 
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 15
danny123 is on a distinguished road
It seems that there is no such thing in OpenFoam as
Code:
fvm::grad
, at least nothing within the official version. There is one in the extend version, I understand. I did not find if there is something like
Code:
&fvm::grad
or
Code:
&fvc::grad
which would be a possible way to formulate a directional derivative.

There is another area where this could be useful that is viscosity as function of shear rate.

Regards,

Daniel
danny123 is offline   Reply With Quote

Old   July 19, 2015, 15:35
Default
  #12
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

@Daniel: I've taken a somewhat quick look at your questions and I'm having trouble understanding what is the exact problem!?
I ask this because I'm not seeing what is the exact problem of writing the chain expression as explicit equation terms in OpenFOAM's C++ terminology?

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   July 20, 2015, 05:54
Default
  #13
Senior Member
 
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 15
danny123 is on a distinguished road
Hello Bruno,

The explicit expressions are largely covered by OpenFOAM, even though I do not think that directional derivatives are. Or do you know that they are?

The implicit schemes are largely limited to fvm::div what I have seen so far. This is a pity since I could imagine that convergence is better if some other fvm schemes would be available.

The original question starts ( I have to guess) with the dyad product. My understanding is that the the momentum eq. contains such a dyad product U U. If you apply the divergence of a dyad product, and apply the product rule you get a directional derivative.

Maybe look at this: http://planetmath.org/nablaactingonproducts

So, I think this is not available within OpenFoam. But you may confirm. Or you think it is anyway a bad idea.

Regards,

Daniel
danny123 is offline   Reply With Quote

Old   July 25, 2015, 17:42
Default
  #14
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Daniel,

Well, for better or for worse, this is getting way over my head... possibly because it's the weekend and my brain isn't at full throttle

From what I know, "dyad" operators are not available in OpenFOAM. Beyond that, my guess is that this approach you're referring to will increase the complexity of the equation to be solved, with little benefit in the results.

Unfortunately I don't have time to test any of this .
You can try contacting the OpenFOAM Foundation directly, or proposing this idea at the bug tracker as a possible feature, since they are the experts on this.
Beyond this, I vaguely remember seeing that other approaches into multiphase solvers have been talked about in OpenFOAM workshops... you can also check how the multiphase Euler approaches are implemented in OpenFOAM, since those usually require a lot more complex equations... at least from what I briefly remember...

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   July 31, 2015, 07:14
Default
  #15
Senior Member
 
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 15
danny123 is on a distinguished road
Thanks Bruno,

You are right that there is likely little benefit in this. My original intent was to correct my equations since div(phi) seems never to go down below a certain barrier, around 10^-8. So, I though substracting a div(phi) term or more implicit formulation may help to get the error down.

Now, I have found there is another issue. This is really a tricky one, but I think this is the fundamental problem. I would appreciate your help. See

http://www.cfd-online.com/Forums/ope...auf-p_rgh.html

Have a nice weekend.

Regards,

Daniel
danny123 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
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36
Modified OpenFOAM Forum Structure and New Mailing-List pete Site News & Announcements 0 June 29, 2009 06:56
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 19:07
Adventure of fisrst openfoam installation on Ubuntu 710 jussi OpenFOAM Installation 0 April 24, 2008 15:25
OpenFOAM Debian packaging current status problems and TODOs oseen OpenFOAM Installation 9 August 26, 2007 14:50


All times are GMT -4. The time now is 04:39.