CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Changing Viscosity in solver

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 3, 2021, 01:36
Default Changing Viscosity in solver
  #1
Senior Member
 
mohammad
Join Date: Sep 2015
Posts: 281
Rep Power: 12
mostanad is on a distinguished road
Hi all,
I am working on the viscosity value in a multiphase solver. Due to some modifications, I need to change the viscosity value in the solver using a function in my defined class. So I used the following line to access the viscosity and change it.


Code:
volScalarField k_viscosity = turbulence->nu();
particleCloud.setParticleViscosity(k_viscosity);

However, by these lines, only the k_viscosity value is changed using call by reference in setParticleViscosity function. So how can give the modified k_viscosity to nu? I think that's a big question I couldn't find its answer.
Cheers,

Mohammad
mostanad is offline   Reply With Quote

Old   March 3, 2021, 18:55
Default
  #2
Senior Member
 
mohammad
Join Date: Sep 2015
Posts: 281
Rep Power: 12
mostanad is on a distinguished road
So interesting nobody knows the answer!
mostanad is offline   Reply With Quote

Old   March 3, 2021, 21:28
Default
  #3
Senior Member
 
mohammad
Join Date: Sep 2015
Posts: 281
Rep Power: 12
mostanad is on a distinguished road
Finally solved the problem by myself using a function, correctnu, like correct(), to update the viscosity in each time step.
mostanad is offline   Reply With Quote

Reply

Tags
class, coding, development, viscosity, volscalarfield


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
loading issue libraries:libsimpleFunctionObjects.so libsimpleSwakFunctionObjects.so immortality OpenFOAM Pre-Processing 15 April 7, 2024 13:35
PEMFC model with FLUENT brahimchoice FLUENT 22 April 19, 2020 16:44
Working directory via command line Luiz CFX 4 March 6, 2011 21:02
UDF for changing viscosity Rafael FLUENT 2 October 28, 2009 16:59
why the solver reject it? Anyone with experience? bearcat CFX 6 April 28, 2008 15:08


All times are GMT -4. The time now is 06:16.