|
[Sponsors] |
If else condition in PowerLaw viscosity model |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 25, 2019, 05:18 |
If else condition in PowerLaw viscosity model
|
#1 |
New Member
Join Date: Jun 2019
Posts: 17
Rep Power: 6 |
Hello everyone I am new to OpenFoam and I would like to know if it's possible to implement an if else condition in Power Law viscosity model?
if (a<0.8) { nuMin nuMax loop of PowerLaw; } else { nu = 10*a; } Thanks a lot. |
|
February 27, 2020, 13:13 |
|
#2 |
New Member
tooran
Join Date: Nov 2016
Posts: 23
Rep Power: 9 |
Hi,
I want to change the HerschelBulkley viscosity model . I want to add a if-condition as follows: if strain rate is greater than gama (gama is a variable which read from the input) then calculate viscosity according to .... so I write the following code : //************************************* if (sr() < List<dimensionedScalar>(sr().size(), gama_)) { return... When I write "wmake libso" it shows me the following error : error: no match for ‘operator<’ (operand types are ‘const Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>’ and ‘Foam::List<Foam::dimensioned<double> >’) if (sr() < List<dimensionedScalar>(sr().size(), gama_)) Could you please help me? |
|
February 28, 2020, 03:37 |
|
#3 |
Senior Member
Yogesh Bapat
Join Date: Oct 2010
Posts: 102
Rep Power: 15 |
Operator < needs to be overloaded for classes of objects you are using on both side of the operator.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Viscosity model - error: object is not allocated - C++ beginner | avila.vc | OpenFOAM Programming & Development | 5 | February 14, 2022 02:00 |
New Viscosity model in DriftFluxFoam | yang.l | OpenFOAM | 2 | December 2, 2017 06:56 |
Question about adaptive timestepping | Guille1811 | CFX | 25 | November 12, 2017 17:38 |
Adding a new viscosity model | ICL | OpenFOAM Running, Solving & CFD | 20 | April 10, 2017 22:44 |
Questions about Cross-Arrhenius and Cross-WLF viscosity model | awacs | OpenFOAM Running, Solving & CFD | 4 | August 13, 2009 06:56 |