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

Modifying volumetric flux to mass flux

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 21, 2020, 02:57
Default Modifying volumetric flux to mass flux
  #1
Member
 
Join Date: Dec 2018
Posts: 75
Rep Power: 7
hbulus is on a distinguished road
Hello everyone,

I want to initialize my solution with potentialFoam for the sonicFoam. However, since potentialFoam solves for incompressible flow, there will be dimension incompability in fluxes. Therefore, i need to convert volumetric flux (phi from potentialFoam) to mass flux(phi for compressible flow). I found a 'convertPhi.C' code(which is attached) which basically modify Phi by multipliying rho, also for other variables you can modify it later. However, when i try to run it , it asks for rhoRef value. I tried everything but it still asks. I tried to add rhoRef in constant/thermophysicalProperties, system/fvOptions, even in the code by basically adding 'scalar rhoRef(1.0)'. Is there anyone who sees what the problem is in here?

Thanks for any suggestions!
Attached Files
File Type: c convertPhi.C (4.2 KB, 8 views)
hbulus is offline   Reply With Quote

Old   January 21, 2020, 03:33
Default
  #2
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
Hi!


Just remove it. Then the solver will create the flux field for you from the velocity field.
simrego is offline   Reply With Quote

Old   January 21, 2020, 03:43
Default
  #3
Member
 
Join Date: Dec 2018
Posts: 75
Rep Power: 7
hbulus is on a distinguished road
Quote:
Originally Posted by simrego View Post
Hi!


Just remove it. Then the solver will create the flux field for you from the velocity field.
Thanks for reply simrego,

What do you mean by removing ? Could you explain more ?
hbulus is offline   Reply With Quote

Old   January 21, 2020, 04:11
Default
  #4
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
Sorry. Remove the phi file from the 0 folder. (if you have a parallel case, from every processor*/0 folder.) At least I think you have it in your 0 folder. Of course if for some reason your start time is not zero, then delete it from the proper time folder.


The solver will reconstruct your flux field from the velocity field (which is written by potentialFoam) correctly and you don't have to do any black magic trick.
simrego is offline   Reply With Quote

Old   January 21, 2020, 05:28
Default
  #5
Member
 
Join Date: Dec 2018
Posts: 75
Rep Power: 7
hbulus is on a distinguished road
Quote:
Originally Posted by simrego View Post
Sorry. Remove the phi file from the 0 folder. (if you have a parallel case, from every processor*/0 folder.) At least I think you have it in your 0 folder. Of course if for some reason your start time is not zero, then delete it from the proper time folder.


The solver will reconstruct your flux field from the velocity field (which is written by potentialFoam) correctly and you don't have to do any black magic trick.
Thanks for your quick replies,

I tried as you said but the main solver didn't reconstruct phi, again. In this way, there is no meaning of initialization.I think, i have to find a way to convert volumetric flow to mass flow ..
hbulus is offline   Reply With Quote

Old   January 21, 2020, 05:31
Default
  #6
Member
 
Join Date: Dec 2018
Posts: 75
Rep Power: 7
hbulus is on a distinguished road
How do you make initialization for compressible flows, mr simfego?
hbulus is offline   Reply With Quote

Old   January 21, 2020, 05:56
Default
  #7
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
There is a meaning since potentialFoam write the velocty field, and an approximated pressure field if needed near the flux field.
The velocity field is always written, which is reconstructed from the flux field.
In the sonicFoam solver you include the compressibleCreatePhi.H file which will read the flux field if present, or create it if not (from the velocity field, as: "linearInterpolate(rho*U) & mesh.Sf()".
Thus you have your flux field from the velocity field which is initialized by the potentialFoam solver mr hbulus!
simrego is offline   Reply With Quote

Old   January 21, 2020, 06:01
Default
  #8
Member
 
Join Date: Dec 2018
Posts: 75
Rep Power: 7
hbulus is on a distinguished road
Oh, finally it makes sense to use in that way, thanks a lot. I dont solve my problem about convertPhi yet, but i am working on it. If i would solve, i am gonna share with you. Thanks for the all information you gave me.

Have a good day
hbulus is offline   Reply With Quote

Reply


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
My radial inflow turbine Abo Anas CFX 27 May 11, 2018 01:44
Radiation interface hinca CFX 15 January 26, 2014 17:11
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 04:05
mass flux correction at outflow boundaries Subhra Datta Main CFD Forum 2 November 24, 2003 13:11
total mass flux correction for compressible fluid? Francesco Di Maio Main CFD Forum 0 August 21, 2000 04:23


All times are GMT -4. The time now is 14:39.