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

tensorial viscosity

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 24, 2011, 07:56
Default tensorial viscosity
  #1
New Member
 
Mateus Palharini Schwalbert
Join Date: May 2011
Posts: 13
Rep Power: 6
mateusps is on a distinguished road
Hi, FOAMers.

I'm new in OpenFOAM, and I'm trying to implement a tensorial viscosity, but haven't got success.

I've already used tensorial diffusivities for the energy equation and other scalar equations, with no problems, but for the motion equation (or for a laplacian of a vector, or div(tensorD & grad(U))) it doesn't work. It compiles well, with no errors, but when I run the solver, it breaks.

Any suggest of how to implement a fvm::laplacian(tensorD, U) ???

Mateus
mateusps is offline   Reply With Quote

Old   September 26, 2011, 06:48
Default
  #2
New Member
 
Mateus Palharini Schwalbert
Join Date: May 2011
Posts: 13
Rep Power: 6
mateusps is on a distinguished road
Doesn't anyone have a clue on how to implement a fvm::laplacian(<tensor>,<vector>)?

I've been trying, but with no success.

It compiles with no errors, which means fvm::laplacian may receive a tensorial "diffusivity" for a vector, but it doesn't work when I execute the solver.

Any ideas?
mateusps is offline   Reply With Quote

Old   September 26, 2011, 08:00
Default
  #3
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
Bernhard is on a distinguished road
You're right that fvm::laplacian accepts tensorial diffusivities (see also the Programmer Guide).

You say "it doesn't work", but nobody knows what you mean with that. What is the errormessage? What is the case you're trying to solve? Are you sure it is this tensorial viscosity that is causing the problems? Or can it be anything else? Please be more specific.
Bernhard is offline   Reply With Quote

Old   September 26, 2011, 08:21
Default
  #4
New Member
 
Mateus Palharini Schwalbert
Join Date: May 2011
Posts: 13
Rep Power: 6
mateusps is on a distinguished road
The error message is (just after the Courant Number of the first time step):
%%%%%%%%%%%%%%%%

Courant Number mean: 0.000538274 max: 0.124495

#0 Foam::error:rintStack(Foam::Ostream&) in "/opt/openfoam171/lib/linuxGccDPOpt/libOpenFOAM.so"

#1 Foam::sigSegv::sigSegvHandler(int) in "/opt/openfoam171/lib/linuxGccDPOpt/libOpenFOAM.so"

#2 Uninterpreted:

#3

in "/home/mateus/OpenFOAM/mateus-1.7.1/applications/bin/linuxGccDPOpt/envido"

#4

in "/home/mateus/OpenFOAM/mateus-1.7.1/applications/bin/linuxGccDPOpt/envido"

#5

in "/home/mateus/OpenFOAM/mateus-1.7.1/applications/bin/linuxGccDPOpt/envido"

#6 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"

#7

in "/home/mateus/OpenFOAM/mateus-1.7.1/applications/bin/linuxGccDPOpt/envido"

Falha de segmentação




%%%%%%%%%%%%%%%%%%%%




The case is just for testing. It's the flow of a HershellBulkley fluid in an annulus. It runs OK with nonNewtonianIcoFoam solver, which is the one I'm trying to modify, including an anisotropic viscosity. The error messages above are for a identity tensor multiplying the viscosity, just for test, so I think it should work and return the same results obtained with the nonNewtonianIcoFoam. I tryed to do a similar modification in another solver I made, which is the nonNewtonianIcoFoam in which I included the energy equation, and I used a tensorial thermal diffusivity, and it works fine. But when I try to do this in the momentum equation, I get those errors (not in compiling, but when I run the case).


And I'm pretty sure it is the tensorial viscosity that's causing the trouble, because when I comment that line, I get no problems. And note that I'm testing with the identity tensor, so that it's not a problem of numeric values or something alike.


I'm thinking that the function laplacian(<tensor>,<vector>) is defined and overcharged, since it passes the compilation, but might not be implemented, since I get those error messages when I try to run.


Some idea? Am I saying something too stupid?


Thanks for the reply,

Mateus
mateusps is offline   Reply With Quote

Old   September 26, 2011, 08:29
Default
  #5
New Member
 
Mateus Palharini Schwalbert
Join Date: May 2011
Posts: 13
Rep Power: 6
mateusps is on a distinguished road
Sorry for the

It should be
... Foam::error:: printStack(Foam::Ostream&) in "/opt/openfoam171/lib/linuxGccDPOpt/libOpenFOAM.so".... (without the space)
mateusps is offline   Reply With Quote

Old   September 26, 2011, 10:56
Default
  #6
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 418
Rep Power: 15
santiagomarquezd will become famous soon enough
What tensorial diffusivity did you put in the constant/transportProperties dictionary?

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   September 27, 2011, 07:37
Default
  #7
New Member
 
Mateus Palharini Schwalbert
Join Date: May 2011
Posts: 13
Rep Power: 6
mateusps is on a distinguished road
If someone is interested, I think I solved the problem. Apparently the fvm::laplacian(<tensor>,<vector>) wasn't really implemented (at least at versions 1.7.1 and 2.0.0, in which I tryed testing).

I just modified the file laplacianScheme.H in the directory /opt/openfoam171/src/finiteVolume/finiteVolume/laplacianSchemes/LaplacianScheme/, adding the line:

makeFvLaplacianTypeScheme(SS, vector, symmTensor) \



and recompiled the finiteVolume libso, and apparently it worked properly.

I didn't do enough tests yet, and my solver is resulting some wrong results, but I believe those are my mistakes, and I'm reviewing some parts of the solver.

thanks for the help,
Mateus
mateusps is offline   Reply With Quote

Old   September 27, 2011, 08:07
Default
  #8
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
Bernhard is on a distinguished road
That is odd, maybe you want to file a bugreport here: http://www.openfoam.com/bugs/
Than it will be probably be fixed in the next release.
Bernhard is offline   Reply With Quote

Old   December 19, 2011, 19:32
Default
  #9
Senior Member
 
chegdan's Avatar
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 546
Rep Power: 18
chegdan will become famous soon enough
just in case anyone is looking for this (like I was), this was filed as a bug in issue 0000305 and has been fixed on http://www.openfoam.com/bugs/ in 2.0.x

But....


I am getting some segmentation fault with something like

Code:
    volSymmTensorField Dt = (k/epsilon)*R;

...


            solve
            (
                fvm::ddt(C)
              + fvm::div(phi, C)
	      - fvm::laplacian(D, C)
              - fvm::laplacian(Dt, C)
            );
the solver runs for a bit and then seg faults. I looked in laplacianSchemes.H and the line

Code:
makeFvLaplacianTypeScheme(SS, scalar, symmTensor)
is already there. Any thoughts?

Edit: It segfaults due to crazy behavior due to negative Dt values from negative R values. Nothing to see here.
__________________
Dan

Find me on twitter @dancombest and LinkedIn

Last edited by chegdan; December 19, 2011 at 20:30. Reason: human error
chegdan 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
Power - Law Viscosity Model for Polymers NickolasPl OpenFOAM 2 August 12, 2011 08:26
Eulerian Modeling: Frictional Viscosity Help meangreen FLUENT 0 July 8, 2009 14:46
kinematic viscosity at diff temperatures,pressures Mecobio Main CFD Forum 0 November 7, 2005 13:55
Turbulent viscosity in a riser ap FLUENT 8 April 19, 2003 08:00
Problem of Turbulent Viscosity Ratio Limited David Yang FLUENT 3 June 3, 2002 06:13


All times are GMT -4. The time now is 16:30.