
[Sponsors] 
May 21, 2013, 08:21 
Question about new viscosity Model

#1 
New Member
Deutschland
Join Date: Feb 2013
Posts: 6
Rep Power: 6 
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 Phase1 volume fraction = 0.130194 Min(alpha1) = 0 Max(alpha1) = 1 MULES: Solving for alpha1 Phase1 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.4572e12, cumulative = 1.4572e12 DICPCG: Solving for p_rgh, Initial residual = 0.00241685, Final residual = 0.000103152, No Iterations 13 time step continuity errors : sum local = 3.6859e05, global = 8.85469e06, cumulative = 8.85469e06 DICPCG: Solving for p_rgh, Initial residual = 0.000133469, Final residual = 8.00755e08, No Iterations 50 time step continuity errors : sum local = 3.8946e08, global = 4.00945e09, cumulative = 8.85068e06 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 

May 22, 2013, 05:36 

#2  
Senior Member

Quote:
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. 

May 22, 2013, 07:09 

#3 
New Member
Deutschland
Join Date: Feb 2013
Posts: 6
Rep Power: 6 
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 

May 22, 2013, 07:40 

#4  
Senior Member

Quote:
But, If you look at the interFoam(multiphase) you will find 2 phases(newtonian, nonnewtonian)... I think you want to run a complete nonnewtonian 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 { .... ..... ..... } } .... 

May 22, 2013, 07:51 

#5 
New Member
Deutschland
Join Date: Feb 2013
Posts: 6
Rep Power: 6 
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 

May 22, 2013, 08:29 

#6 
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,853
Blog Entries: 6
Rep Power: 32 
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 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Problem with divergence  TDK  FLUENT  11  July 31, 2016 06:03 
HerschelBulkley nonNewtonian 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 04: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 