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

Modified VOF solver (Help needed with changes)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 20, 2021, 17:33
Default Modified VOF solver (Help needed with changes)
  #1
Member
 
Venkat Ganesh
Join Date: May 2020
Location: Cincinnati, Ohio
Posts: 49
Rep Power: 5
Venky_94 is on a distinguished road
Hey,
I'm new to programming in OpenFOAM and I need to compile a variation of the interFoam solver, with modifications to the property determination method and the interface curvature calculation part of the CSF model to smoothen it.

I've attached an image with the changes I wish to make highlighted. I'm just not clear of where I'll have to go about making the changes. So any help in that regard will be extremely helpful.
  1. So far what I've understood is that I can make the changes involving the property determination part in the incompressibleTwoPhaseMixture.C file, although there are multiple functions within that code where similar expressions are used, calcNu, mu, muf and nuf, and I'm not sure to which ones the changes are to be made.
  2. Also I'm not sure where the changes for the curvature part is to be made.
Attached Images
File Type: jpg Modified VOF.JPG (90.3 KB, 63 views)
Venky_94 is offline   Reply With Quote

Old   October 1, 2021, 12:12
Default
  #2
Member
 
Venkat Ganesh
Join Date: May 2020
Location: Cincinnati, Ohio
Posts: 49
Rep Power: 5
Venky_94 is on a distinguished road
I went through the solver source code, and this is my understanding about the changes, and further questions on which files need to be modified.
  1. The property determination for viscosity should be changed for nu,mu,muf, and nuf in incompressibleTwoPhaseMixture.C file
  2. Property determination for density should be changed in createFields.H and alphaEqnSubCycle.H?
  3. The curvature part should be changed within Foam::interfaceProperties::calculateK() in interfaceProperties.C?
  4. Also, how can I access the alpha values and area of the corresponding faces to implement the curvature correction?
Venky_94 is offline   Reply With Quote

Old   October 11, 2021, 03:25
Default
  #3
Member
 
Venkat Ganesh
Join Date: May 2020
Location: Cincinnati, Ohio
Posts: 49
Rep Power: 5
Venky_94 is on a distinguished road
Quote:
Originally Posted by Venky_94 View Post
I went through the solver source code, and this is my understanding about the changes, and further questions on which files need to be modified.
  1. The property determination for viscosity should be changed for nu,mu,muf, and nuf in incompressibleTwoPhaseMixture.C file
  2. Property determination for density should be changed in createFields.H and alphaEqnSubCycle.H?
  3. The curvature part should be changed within Foam::interfaceProperties::calculateK() in interfaceProperties.C?
  4. Also, how can I access the alpha values and area of the corresponding faces to implement the curvature correction?
I was able to modify the property determination part for viscosity using the incompressibleTwoPhaseMixture.C file. But I went through the complete source code and I couldn't figure out where similar property determination for density is done before being used in the UEqn.H file. Can someone clarify at which point the "alpha1*rho1 + alpha2*rho2" sort of code is implemented in interFoam for density and from where the rho used in UEqn.H and PEqn.H is being sourced from?
Venky_94 is offline   Reply With Quote

Old   October 12, 2021, 13:19
Default
  #4
Member
 
Venkat Ganesh
Join Date: May 2020
Location: Cincinnati, Ohio
Posts: 49
Rep Power: 5
Venky_94 is on a distinguished road
Quote:
Originally Posted by Venky_94 View Post
I was able to modify the property determination part for viscosity using the incompressibleTwoPhaseMixture.C file. But I went through the complete source code and I couldn't figure out where similar property determination for density is done before being used in the UEqn.H file. Can someone clarify at which point the "alpha1*rho1 + alpha2*rho2" sort of code is implemented in interFoam for density and from where the rho used in UEqn.H and PEqn.H is being sourced from?
Update:
I was able to update the expression for rho as well. rho is getting updated from alphaEqnSubCycle.H file. I missed it earlier as the expression had '==' operator which I got confused with the equality operator in C++, but openFOAM uses it as an assignment operator in this case. (Reference: == operator)

Code:
rho == alpha1*rho1 + alpha2*rho2;
I still need to figure out how to write a code to obtain the area-averaged volume fraction. Any suggestions in this regard would be extremely helpful.
Attached Images
File Type: jpg Area-averaging alpha.JPG (30.2 KB, 15 views)
Venky_94 is offline   Reply With Quote

Reply

Tags
alpha, curvature, surface tension, vof


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
Solver that combines VOF with DFM and manual JonW OpenFOAM Announcements from Other Sources 0 August 2, 2021 14:18
viscosity udf don't use correct temperature and strain rate rezvani Fluent UDF and Scheme Programming 8 May 27, 2021 05:40
error encountered when compiling modified solver jawfi OpenFOAM Programming & Development 0 September 16, 2017 03:22
Star cd es-ice solver error ernarasimman STAR-CD 2 September 12, 2014 00:01
Working directory via command line Luiz CFX 4 March 6, 2011 20:02


All times are GMT -4. The time now is 09:58.