|
[Sponsors] |
August 22, 2021, 16:48 |
Update Viscosity in every time step
|
#1 |
New Member
HH
Join Date: Apr 2019
Posts: 17
Rep Power: 7 |
Hi Foamers,
For an incompressible flow case using a solver based on pimpleFoam, i am trying to update kinematic viscosity (nu()) as a function of temperature. (OpenFOAM version v1806) I created a solver called ExpLaw using powerLaw as a reference. # Code: Foam::tmp<Foam::volScalarField> Foam::viscosityModels::ExpLaw::calcNu() const { const volScalarField& T = U_.mesh().lookupObject<volScalarField>("T"); return k_*exp(-n_*(T - Talpha_)); } # The model compiles and works in the first time step, where viscosity is being calculated using this new model. However, the model then doesn't update and shows the same values. Now, when i stop the simulation and restart it from the last recorded time step, the expLaw is accessed and it calculates the new viscosity values at the first time step. After that, in the consecutive time steps, it again does not update the viscosity. I have looked at a lot of different threads on this forum and spent days to solve this problem but cannot find a way to update the viscosity at each time step based on changes in the temperature field. Please help me solve this issue. i will really appreciate the help. Thanks in advance. Best, HH |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
AMI speed performance | danny123 | OpenFOAM | 21 | October 24, 2020 04:13 |
Setting up Lid driven Cavity Benchmark with 1M cells for multiple cores | puneet336 | OpenFOAM Running, Solving & CFD | 11 | April 7, 2019 00:58 |
High Courant Number @ icoFoam | Artex85 | OpenFOAM Running, Solving & CFD | 11 | February 16, 2017 13:40 |
Star cd es-ice solver error | ernarasimman | STAR-CD | 2 | September 12, 2014 00:01 |
Could anybody help me see this error and give help | liugx212 | OpenFOAM Running, Solving & CFD | 3 | January 4, 2006 18:07 |