
[Sponsors] 
Viscoelastic Fluid Flows using OpenFOAM The solver viscoelasticFluidFoam 

LinkBack  Thread Tools  Display Modes 
October 16, 2010, 09:03 
Hi ata

#121 
Senior Member
Join Date: Sep 2010
Location: France
Posts: 199
Rep Power: 7 
Hi my friend,
yes indeed i did a Model and compiled it in the folder viscosityModels but my problem is that i need to use another model for the viscosity in the same solver, in another words, i need to use two different viscosity models in the same solver, where these two viscosityModels i shall define. I hope you understood me better now note: I know that there exists the twophaseModel, but there i can't because it combines the two viscosities in one and always return it back to one "nu" or "nuEff" with certain factor something like nu=epsilon*nu1+(1epsilon)*nu2 you see. but me, i need to use two different seperated models for nu1 and nu2. so always when i build one from the existing Models like i did, i am obliged to get back the viscosity under the name "nu" you see, i can't make another model and call it "nu1" or "nu2" since it was prevoiusly built in all classes as "nu" or "nuEff". help please and always thanks a lot yours, T.D. 

October 16, 2010, 09:15 

#122 
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 322
Rep Power: 9 
Hi T.D.
I didn't understand you completely. But can you define a new viscosity model in createFields file? Best regards Ata 

October 16, 2010, 09:32 
help please

#123 
Senior Member
Join Date: Sep 2010
Location: France
Posts: 199
Rep Power: 7 
HI,
really, can i define it in createFields file? How? even if my "nu1" is function of another used field like temperature "T" ? can you just give me a simple example pleaaaaaaase: lets say i need each time i use nu1 in the solver, i need it to be called as nu1 = 2*T +5; how to construct and implement nu1 in the create Fields file help please thanks a lot for your patience 

October 16, 2010, 09:45 

#124 
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 322
Rep Power: 9 
Hi T.D.
If you want two nonNewtonian viscosity model use: singlePhaseTransportModel fluid1(U, phi); But you must do some things in the source code (As I told you) If you want a Newtonian model with two different viscosity use: Info<< "Reading transportProperties\n" << endl; IOdictionary transportProperties ( IOobject ( "transportProperties", runTime.constant(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ) ); dimensionedScalar nu1 ( transportProperties.lookup("nu1") ); and then calculate it in your code. Best regards Ata 

October 16, 2010, 09:55 
i need two nonNewtonian..

#125  
Senior Member
Join Date: Sep 2010
Location: France
Posts: 199
Rep Power: 7 
Hi
yes indeed i need two nonNewtonian viscosity Models, so for the two viscosities how should i define them, i must put in the singlePhaseTransportModel fluid1 and fluid2 ?, and how to link back to read the two different laws, like crosspower and power (as example)? i must use like transportModel1 "crosspower", and transportModel2 "power" in the transport properties file? if so, where to define the transportModel1 and transportModel2, is it also inside the singlephaseTransportModel file? thanks a lot my brother Quote:


October 16, 2010, 22:12 

#126 
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 322
Rep Power: 9 
Hi T.D.
I think you must define two different dictionary in your code and using constructor of your models define two different viscosity model. The constructors for CrossPowerLaw is: CrossPowerLaw ( const word& name1, const dictionary& viscosityProperties1, const volVectorField& U, const surfaceScalarField& phi ); and for powerlaw is: powerLaw ( const word& name2, const dictionary& viscosityProperties2, const volVectorField& U, const surfaceScalarField& phi ); Be careful you must define two different dictionary viscosityProperties1 nad viscosityProperties2 i.e. Good luck Best regards Ata 

October 17, 2010, 04:24 
Hi

#127 
Member
mohsen kh
Join Date: Nov 2009
Posts: 41
Rep Power: 7 
Hello
I want to employ a solver for composite materials into the viscoelasticfluidFoam but while compiling there are errors which I cannot understand completely. the set of equations and the code I have developed are attached. the other parameters are constants. the Best 

October 17, 2010, 11:07 

#128  
Member

Quote:
Your problem is with the term [(omega . a)  (a . omega)] in equation for "a". The return of this operation is a tensorField and not a symmTensorField. Then two options to overcome this problem: 1  Find a manner to [(omega . a)  (a . omega)] give a symmTensor. I think this is not possible, but ... 2  Work with tensorField type. Then, "a" need to be declared as tensor field, the fvMatriz for "a" equation and all the operations that use "a" also need be of tensorField type. See also that omega=skew(L) in OF. Best regards, Jovani 

October 18, 2010, 04:36 
Hi

#129 
Senior Member
Join Date: Sep 2010
Location: France
Posts: 199
Rep Power: 7 
Hi ata, and all foamers, please help i am so confused
My problem is i only need to use two different viscosityModels in the same solver.so to use two different transportModels i'll define in the dictionary. (trasportModel1 powerlaw, and transportModel2 crosspowerLaw) i need a clear solution pleaaaaaaaaaaase with steps if possible. thanks ata but your answer confused me, beacause i mixed all of them the trasportModel, singlephasetrosportModel and viscosityModel directories. Anyone has a clear solution please with some steps to follow, and where to change in which files exactly, and how to call the two different viscosities inside the solver? Help pleaaaaaaaaase thanks a lot 

October 18, 2010, 04:58 
Hi

#130 
Member
mohsen kh
Join Date: Nov 2009
Posts: 41
Rep Power: 7 
hello Jovani,
Thank you very much for your response. I changed every symmTensor to tensor but there are some problem now. Could you possibly take a look at this file and help me. Best Regards. Mohsen 

October 18, 2010, 12:01 

#131  
Member

Quote:
Good, now you need make it recursive back to the tree > multiMode > viscoelasticLaw ..... This make the other models bad to be used. You need compile only your new model, with all library tree using tensor field. A question: How important is the assymetry introduced by the antisymetric part of deformation tensor in your model?? Is that an important term for your purposes? Best, Jovani 

October 18, 2010, 12:37 
Hi

#132 
Member
mohsen kh
Join Date: Nov 2009
Posts: 41
Rep Power: 7 
Hello Jovani again,
Thank you again for your reply. yes I have done this and the model is compiled now. the other viscoelastic models are not included now. I tried to run a case with this model but there is a problem which I cannot understand. I run the "viscoelasticFluidFoam" solver in the terminal and the following massage appears: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Create time Create mesh for time = 0 Reading field p Reading field U Reading/calculating face flux field phi Selecting viscoelastic model multiMode Selecting viscoelastic model ali > FOAM Warning : From function GeometricField<Type, PatchField, GeoMesh>::readIfPresent() in file /home/dm2/henry/OpenFOAM/OpenFOAM1.6/src/OpenFOAM/lnInclude/GeometricField.C at line 107 read option IOobject::MUST_READ suggests that a read constructor for field taucnffirst would be more appropriate. > FOAM Warning : From function GeometricField<Type, PatchField, GeoMesh>::readIfPresent() in file /home/dm2/henry/OpenFOAM/OpenFOAM1.6/src/OpenFOAM/lnInclude/GeometricField.C at line 107 read option IOobject::MUST_READ suggests that a read constructor for field taucfirst would be more appropriate. > FOAM Warning : From function GeometricField<Type, PatchField, GeoMesh>::readIfPresent() in file /home/dm2/henry/OpenFOAM/OpenFOAM1.6/src/OpenFOAM/lnInclude/GeometricField.C at line 107 read option IOobject::MUST_READ suggests that a read constructor for field afirst would be more appropriate. Starting time loop Courant Number mean: 0 max: 0.00016 deltaT = 1.1999e05 Time = 1.1999e05 DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 6.11821e12, No Iterations 2 DILUPBiCG: Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0 DICPCG: Solving for p, Initial residual = 1, Final residual = 7.87121e08, No Iterations 391 DICPCG: Solving for p, Initial residual = 3.07354e10, Final residual = 3.07354e10, No Iterations 0 time step continuity errors : sum local = 2.23709e14, global = 1.82535e17, cumulative = 1.82535e17 Model mode 1 valueInternalCoeffs cannot be called for a calculatedFvPatchField on patch inlet of field taufirst in file "/home/mohsen/OpenFOAM/mohsen1.6/run/tutorials/viscoelasticFluidFoam/mohsen/0/taufirst" You are probably trying to solve for a field with a default boundary condition. From function calculatedFvPatchField<Type>::valueInternalCoeffs( const tmp<scalarField>&) const in file fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C at line 145. FOAM exiting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% And about your question, yes I should consider this term because this expression is in the model used for fiber orientation tensor. Best wishes, Mohsen 

October 19, 2010, 06:54 

#133  
Member

Quote:
This seems your internal field for taufirst is wrong, you consider a nine components for internal field, now you are working with the complete stress tensor?? If it is not this the problem no idea by looking this return messaging. Best regards, Jovani 

October 19, 2010, 12:10 

#134  
Member
mohsen kh
Join Date: Nov 2009
Posts: 41
Rep Power: 7 
Quote:
Hello jovani, I appreciate your help again. no I have considered nine element for the stress tensor but there is this problem yet. The taufirst in the "0" folder is as follows: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% /** C++ **\  =========    \\ / F ield  OpenFOAM: The Open Source CFD Toolbox   \\ / O peration  Version: 1.4.1dev   \\ / A nd  Web: http://www.openfoam.org   \\/ M anipulation   \**/ FoamFile { version 2.0; format ascii; root "/home/jovani/jovaniFoam/foamNewSolver/cases/recentCases/upwind"; case "Giesekus"; instance "0"; local ""; class volTensorField; object taufirst; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 1 2 0 0 0 0]; internalField uniform (0 0 0 0 0 0 0 0 0); boundaryField { inlet { type fixedValue; value uniform (0 0 0 0 0 0 0 0 0); } fixedWalls { type zeroGradient; } outlet { type zeroGradient; } simetry { type symmetryPlane; } frontAndBack { type empty; } } // ************************************************** *********************** // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%% The Best, Mohsen 

October 24, 2010, 08:31 

#135  
Member

Quote:
I am not sure about the problem, but i can contribute with a tip: try to use fully 3D geometry for your simulation, i.e, do not use the empty BC: frontAndBack { type empty; } Best, Jovani 

October 27, 2010, 09:14 
Hi

#136  
Member
mohsen kh
Join Date: Nov 2009
Posts: 41
Rep Power: 7 
Quote:
Thank you very much for your reply again. I have got that there is problem in my code and I fix it. now it works. the Best, Mohsen 

November 12, 2010, 09:42 
Hi

#137 
Member
mohsen kh
Join Date: Nov 2009
Posts: 41
Rep Power: 7 
Hello,
when I run my case an error message appear that I cannot understand. could anybody help me pls? the error is as follows: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Create time Create mesh for time = 0 Reading field p Reading field U Reading/calculating face flux field phi Selecting composite model multiMode Selecting composite model composite8 Starting time loop Courant Number mean: 0 max: 2e05 deltaT = 1.1999e05 Time = 1.1999e05 DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 1.38625e10, No Iterations 2 DILUPBiCG: Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0 DICPCG: Solving for p, Initial residual = 1, Final residual = 3.94021e08, No Iterations 76 DICPCG: Solving for p, Initial residual = 1.91826e10, Final residual = 1.91826e10, No Iterations 0 time step continuity errors : sum local = 4.72796e15, global = 2.31815e17, cumulative = 2.31815e17 Model mode 1 lowerPtr_ or upperPtr_ unallocated#0 Foam::error:rintStack(Foam::Ostream&) in "/home/mohsen/OpenFOAM/OpenFOAM1.6/lib/linuxGccDPOpt/libOpenFOAM.so" #1 Foam::error::abort() in "/home/mohsen/OpenFOAM/OpenFOAM1.6/lib/linuxGccDPOpt/libOpenFOAM.so" #2 Foam::Ostream& Foam:perator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) in "/home/mohsen/OpenFOAM/OpenFOAM1.6/applications/bin/linuxGccDPOpt/compositeFoam" #3 Foam::lduMatrix::lower() const in "/home/mohsen/OpenFOAM/OpenFOAM1.6/lib/linuxGccDPOpt/libOpenFOAM.so" #4 Foam::lduMatrix::sumMagOffDiag(Foam::Field<double> &) const in "/home/mohsen/OpenFOAM/OpenFOAM1.6/lib/linuxGccDPOpt/libOpenFOAM.so" #5 Foam::fvMatrix<Foam::Tensor<double> >::relax(double) in "/home/mohsen/OpenFOAM/OpenFOAM1.6/lib/linuxGccDPOpt/libviscoTransportModels.so" #6 Foam::composite8::correct() in "/home/mohsen/OpenFOAM/OpenFOAM1.6/lib/linuxGccDPOpt/libviscoTransportModels.so" #7 Foam::multiMode::correct() in "/home/mohsen/OpenFOAM/OpenFOAM1.6/lib/linuxGccDPOpt/libviscoTransportModels.so" #8 Foam::compositeModel::correct() in "/home/mohsen/OpenFOAM/OpenFOAM1.6/lib/linuxGccDPOpt/libviscoTransportModels.so" #9 main in "/home/mohsen/OpenFOAM/OpenFOAM1.6/applications/bin/linuxGccDPOpt/compositeFoam" #10 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6" #11 _start at /build/buildd/eglibc2.10.1/csu/../sysdeps/i386/elf/start.S:122 From function lduMatrix::lower() const in file matrices/lduMatrix/lduMatrix/lduMatrix.C at line 206. FOAM aborting Aborted %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Best, Mohsen 

April 29, 2011, 03:00 

#138 
Member
Maryam Mousazadeh
Join Date: Oct 2010
Posts: 47
Rep Power: 7 
hello M.r kamyabi;
excuse me I forced a problem with openFoam. I want to modify simpleFoam to be used for nanofluid which is mixture of base fluid and nano particle and is single phase in lower volume fraction. so I should combine this two material properties as some obtained nanofluid formulas which I'll attach here: formulas.zip I add some lines in creatField ana .C files of my solver which is here: nanoalaki.zip but there is some errors which is in the error file of last zipped file; I don't underastand what's the problem; would you tell the mistakes? my another quastion is that should I alter the momentom equation on base of effective properties of nanofluid?if I put for example nu instead of nuEff,Is it need to ghange? I thank you previously; best regards 

April 29, 2011, 05:47 
Viscoelastic Fluid Flows using OpenFOAM The solver viscoelasticFluidFoam

#139 
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 322
Rep Power: 9 
I think you have fundamental problems. Are you at Sharif university?
(for oral explanations) Good luck 

April 29, 2011, 13:29 

#140 
Member
Maryam Mousazadeh
Join Date: Oct 2010
Posts: 47
Rep Power: 7 
hello;
thanks for your reply; I do some correction on the createFields file but there is an error yet and it seems to be a fundamental error as you said; I'll attach it; nano2.zip I'm not in Tehran but if it's difficult for you to explain the problem in writing don't trouble yourself any more ; thanks a lot; Last edited by anijdon; April 29, 2011 at 15:01. 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
VOF simulation of a viscoelastic fluid  sinah  OpenFOAM Running, Solving & CFD  10  November 25, 2010 12:02 
FREE SURFACE VISCOELASTIC FLOWS  Valdemir G. Ferreira  Main CFD Forum  6  December 18, 2009 07:14 
Viscoelastic flow modeling in OpenFOAM  vulda  OpenFOAM Running, Solving & CFD  1  March 17, 2008 08:32 
Polyflow & OpenFoam on Viscoelastic flow modeling  Sumeshen  Main CFD Forum  0  March 14, 2008 09:29 
Viscoelastic fluid codes  joel davison  Main CFD Forum  0  November 6, 2001 06:09 