|
[Sponsors] |
Temperature dependent viscosity (Carreau-Yasuda) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 6, 2016, 09:48 |
Temperature dependent viscosity (Carreau-Yasuda)
|
#1 | |
New Member
Join Date: Apr 2016
Posts: 13
Rep Power: 10 |
New OpenFoam (2.4) user!
As per the title... I wish to use a temperature dependent viscosity model. I've seen various posts and papers on this so I've followed the example modifying the power law - that compiles ok. My next step was to take the BirdCarreau and modify to suit Carreau-Yasuda: Quote:
Code:
Foam::tmp<Foam::volScalarField> Foam::viscosityModels::TempCarreauYasuda::calcNu() const { const volScalarField& T= U_.mesh().lookupObject<volScalarField>("T"); return max ( nuInf_, nu0_ * Foam::exp(beta_ * (1.0/T - 1.0/Tref_) ) *pow(lambda_ * Foam::exp(beta_ * (1.0/T - 1.0/Tref_) ) * strainRate() + scalar(1), (n_ - 1.0)/a_) ); } Code:
TempCarreauYasudaCoeffs { nu0 nu0 [ 0 2 -1 0 0 0 0 ] 7.191; // 5645/rho nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1.2739e-03; // 1/rho lambda lambda [ 0 0 -1 0 0 0 0 ] 0.28; n n [ 0 0 0 0 0 0 0 ] 0.61; beta beta [ 0 0 0 1 0 0 0 ] 6330.0; Tref Tref [ 0 0 0 1 0 0 0 ] 473.15; a a [ 0 0 0 0 0 0 0 ] 2.0; // can omit as will default to 2 } Code:
Foam::exp(beta_ * (1.0/T - 1.0/Tref_) ) Question 2: The code compiles without error. Why is the following error occurring: Code:
Selecting incompressible transport model TempCarreauYasuda --> FOAM FATAL ERROR: LHS and RHS of + have different dimensions dimensions : [0 0 -2 0 0 0 0] + [0 0 0 0 0 0 0] From function operator+(const dimensionSet&, const dimensionSet&) in file dimensionSet/dimensionSet.C at line 478. FOAM aborting #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::error::abort() at ??:? #2 Foam::operator+(Foam::dimensionSet const&, Foam::dimensionSet const&) at ??:? #3 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator+<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&, Foam::dimensioned<double> const&) at ??:? #4 Foam::viscosityModels::TempCarreauYasuda::calcNu() const at ??:? #5 Foam::viscosityModels::TempCarreauYasuda::TempCarreauYasuda(Foam::word const&, Foam::dictionary const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) at ??:? #6 Foam::viscosityModel::adddictionaryConstructorToTable<Foam::viscosityModels::TempCarreauYasuda>::New(Foam::word const&, Foam::dictionary const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) at ??:? #7 Foam::viscosityModel::New(Foam::word const&, Foam::dictionary const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) at ??:? #8 Foam::singlePhaseTransportModel::singlePhaseTransportModel(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) at ??:? #9 ? at ??:? #10 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #11 ? at ??:? |
||
May 6, 2016, 10:01 |
|
#2 |
New Member
Join Date: Apr 2016
Posts: 13
Rep Power: 10 |
Question 2 is resolved... I notice that I specified incorrect units in the transportProperties.
The full source code is attached (no guarantees) to help other beginners. Still looking for guidance with the first question. |
|
May 9, 2016, 03:51 |
|
#3 |
Member
Join Date: Sep 2014
Location: Germany
Posts: 88
Rep Power: 12 |
Do you mean something like that?
Code:
Foam::tmp<Foam::volScalarField> Foam::viscosityModels::TempCarreauYasuda::calcNu() const { const volScalarField& T= U_.mesh().lookupObject<volScalarField>("T"); volScalarField test = Foam::exp(beta_ * (1.0/T - 1.0/Tref_) ); return max ( nuInf_, nu0_ * Foam::exp(beta_ * (1.0/T - 1.0/Tref_) ) * pow(lambda_ * test * strainRate() + scalar(1), (n_ - 1.0)/a_) ); } |
|
June 21, 2016, 09:35 |
|
#4 |
New Member
Join Date: Apr 2016
Posts: 13
Rep Power: 10 |
||
Tags |
openfoam, temperature, viscosity |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Temperature dependent SURFACE TENSION TEMPERATURE COEFFICIENT | kcgmech | Fluent UDF and Scheme Programming | 1 | November 22, 2016 18:01 |
Adding new temperature dependent viscosity model | vabishek | OpenFOAM Programming & Development | 3 | May 15, 2016 22:05 |
Temperature dependent density in transportProperties when using polynomials | GregorAlan | OpenFOAM Running, Solving & CFD | 0 | February 11, 2016 06:29 |
Temperature dependent Non-Newtonian viscosity UDF | cric92 | Fluent UDF and Scheme Programming | 0 | April 14, 2013 07:31 |
Pressure & Temperature dependent EOS | hennas | FLUENT | 1 | October 31, 2011 18:55 |