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

Question about new viscosity Model

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 21, 2013, 08:21
Question Question about new viscosity Model
  #1
New Member
 
Deutschland
Join Date: Feb 2013
Posts: 6
Rep Power: 13
Niels W. is on a distinguished road
Hi everyone,
I am quite new to openfoam and trying to build a new viscosity Model.

At the moment it is doing the same as the CrossPowerLaw.
I just added the output of the expression "CalcNu".

Foam::tmp<Foam::volScalarField>
Foam::viscosityModels::CrossWLF::calcNu() const
{
Info<< "CalcNU\n" << endl;
return (nu0_ - nuInf_)/(scalar(1) + pow(B_*strainRate(), n_)) + nuInf_;
}

I am little bit confused about the output, when i run the interFoam sovler.

"
....

Selecting incompressible transport model CrossTest
CalcNU

Selecting incompressible transport model Newtonian
CalcNU

...

Starting time loop

Courant Number mean: 0 max: 0
Interface Courant Number mean: 0 max: 0
deltaT = 0.00119048
Time = 0.00119048

CalcNU

MULES: Solving for alpha1
Phase-1 volume fraction = 0.130194 Min(alpha1) = 0 Max(alpha1) = 1
MULES: Solving for alpha1
Phase-1 volume fraction = 0.130194 Min(alpha1) = 0 Max(alpha1) = 1
DICPCG: Solving for p_rgh, Initial residual = 1, Final residual = 0.00538103, No Iterations 1
time step continuity errors : sum local = 0.000862137, global = -1.4572e-12, cumulative = -1.4572e-12
DICPCG: Solving for p_rgh, Initial residual = 0.00241685, Final residual = 0.000103152, No Iterations 13
time step continuity errors : sum local = 3.6859e-05, global = -8.85469e-06, cumulative = -8.85469e-06
DICPCG: Solving for p_rgh, Initial residual = 0.000133469, Final residual = 8.00755e-08, No Iterations 50
time step continuity errors : sum local = 3.8946e-08, global = 4.00945e-09, cumulative = -8.85068e-06
CalcNU

ExecutionTime = 0.04 s ClockTime = 0 s

...."

First, why is in the Newtonian Model also the output? It should not access the new code?
Second, maybe i am blind, but why is there the output twice? I thought nu is only calculated once (in twoPhaseProperties.correct(); ).

Thanks a lot!
Best regards,
Niels
Niels W. is offline   Reply With Quote

Old   May 22, 2013, 05:36
Default
  #2
Senior Member
 
T. Chourushi
Join Date: Jul 2009
Posts: 321
Blog Entries: 1
Rep Power: 17
Tushar@cfd is on a distinguished road
Quote:
Originally Posted by Niels W. View Post
Hi everyone,
I am quite new to openfoam and trying to build a new viscosity Model.

At the moment it is doing the same as the CrossPowerLaw.
I just added the output of the expression "CalcNu".

Foam::tmp<Foam::volScalarField>
Foam::viscosityModels::CrossWLF::calcNu() const
{
Info<< "CalcNU\n" << endl;
return (nu0_ - nuInf_)/(scalar(1) + pow(B_*strainRate(), n_)) + nuInf_;
}

I am little bit confused about the output, when i run the interFoam sovler.

"
....

Selecting incompressible transport model CrossTest
CalcNU

Selecting incompressible transport model Newtonian
CalcNU

...

Starting time loop

Courant Number mean: 0 max: 0
Interface Courant Number mean: 0 max: 0
deltaT = 0.00119048
Time = 0.00119048

CalcNU

MULES: Solving for alpha1
Phase-1 volume fraction = 0.130194 Min(alpha1) = 0 Max(alpha1) = 1
MULES: Solving for alpha1
Phase-1 volume fraction = 0.130194 Min(alpha1) = 0 Max(alpha1) = 1
DICPCG: Solving for p_rgh, Initial residual = 1, Final residual = 0.00538103, No Iterations 1
time step continuity errors : sum local = 0.000862137, global = -1.4572e-12, cumulative = -1.4572e-12
DICPCG: Solving for p_rgh, Initial residual = 0.00241685, Final residual = 0.000103152, No Iterations 13
time step continuity errors : sum local = 3.6859e-05, global = -8.85469e-06, cumulative = -8.85469e-06
DICPCG: Solving for p_rgh, Initial residual = 0.000133469, Final residual = 8.00755e-08, No Iterations 50
time step continuity errors : sum local = 3.8946e-08, global = 4.00945e-09, cumulative = -8.85068e-06
CalcNU

ExecutionTime = 0.04 s ClockTime = 0 s

...."

First, why is in the Newtonian Model also the output? It should not access the new code?
Second, maybe i am blind, but why is there the output twice? I thought nu is only calculated once (in twoPhaseProperties.correct(); ).

Thanks a lot!
Best regards,
Niels
Can you please, elaborate your problem? Are you using already available tutorial? Or, you are trying to modify, as per your need..

It appears to me, that you are trying to add a new model to the existing libraries.

The other thing, Have you checked the "/constant" folder of your case? May be somewhere in transportProperties you might have missed something.

Tushar@cfd is offline   Reply With Quote

Old   May 22, 2013, 07:09
Default
  #3
New Member
 
Deutschland
Join Date: Feb 2013
Posts: 6
Rep Power: 13
Niels W. is on a distinguished road
Hi Tushar@cfd,

atm i build a new viscosity model and adding it to the libraries. In this testversion, i only added the output "Info<< "CalcNU\n" << endl;".
so what i dont understand

First:
Why does the Newtonian model of the libraries generates the output:
CalcNu

It should not access the new model and therefore should not produce the output line, am i right?

Second:
In the calculation loop, there are 2 outputs and i dont know when and where the second calculation of nu comes from.

My code works. No problems with the transport properties or something like this. I just dont understand where the output in the Newtonian model comes from and why there are two outputs in one timestep.

br,
Niels
Niels W. is offline   Reply With Quote

Old   May 22, 2013, 07:40
Default
  #4
Senior Member
 
T. Chourushi
Join Date: Jul 2009
Posts: 321
Blog Entries: 1
Rep Power: 17
Tushar@cfd is on a distinguished road
Quote:
Originally Posted by Niels W. View Post
Hi Tushar@cfd,

atm i build a new viscosity model and adding it to the libraries. In this testversion, i only added the output "Info<< "CalcNU\n" << endl;".
so what i dont understand

First:
Why does the Newtonian model of the libraries generates the output:
CalcNu

It should not access the new model and therefore should not produce the output line, am i right?

Second:
In the calculation loop, there are 2 outputs and i dont know when and where the second calculation of nu comes from.

My code works. No problems with the transport properties or something like this. I just dont understand where the output in the Newtonian model comes from and why there are two outputs in one timestep.

br,
Niels
Even, I don't know much about multiphase flows.
But, If you look at the interFoam(multiphase) you will find 2 phases(newtonian, non-newtonian)...

I think you want to run a complete non-newtonian fluid phase. Am I right? If yes, then try editing the transport file like this..

FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
phase1
{
transportModel CrossWLF;

....

CrossWLF
{
....
.....
.....
}

}

....

Tushar@cfd is offline   Reply With Quote

Old   May 22, 2013, 07:51
Default
  #5
New Member
 
Deutschland
Join Date: Feb 2013
Posts: 6
Rep Power: 13
Niels W. is on a distinguished road
Hi Tushar@cfd,

it has nothing to do with the transport file. The code workes.

I just dont understand why the Newtonian model produces the "CalcNu" output.
The Newtonian model is of the existing libraries.

This is the output after using the interFoam solver:
"
....

Selecting incompressible transport model CrossTest
CalcNU

Selecting incompressible transport model Newtonian
CalcNU <<<<< This output, should not be there.

....
"
In my understanding it should look like this:
"
....

Selecting incompressible transport model CrossTest
CalcNU

Selecting incompressible transport model Newtonian

....
"

br,
Niels
Niels W. is offline   Reply With Quote

Old   May 22, 2013, 08:29
Default
  #6
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi Niels,

well at the Moment I have no OpenFOAM on my Computer but as you said the Output should be on the Screen only once.

But, it could be possible that the thermodynamics of the second Phase is calling the calculation of nu from the first Phase again.

Have a look into the thermodynamics!
In the constructor you should see where the function is called the second time!


Tobi
Tobi 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
Problem with divergence TDK FLUENT 13 December 14, 2018 06:00
Herschel-Bulkley non-Newtonian viscosity model has term with sign error pbryant OpenFOAM Bugs 5 June 18, 2013 23:53
Water subcooled boiling Attesz CFX 7 January 5, 2013 03:32
Help with choosing a viscosity model xTamx420 FLUENT 5 July 4, 2011 17:09
Species Transfport Model - Question Lior FLUENT 3 September 2, 2004 15:57


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