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

Specific Humidity Equation and FvOptions

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Tobi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 21, 2020, 20:40
Default Specific Humidity Equation and FvOptions
  #1
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi all,


I am solving the specific humidity in my humidity thermodynamic library. Since a few weeks, I added the functionality to add source/sinks using the fvOptions capabilities. However, I do have some problem here. Consider the equation:


\frac{\rho \zeta}{\partial t} + \nabla (\rho \textbf{U} \zeta) = \nabla \bullet (\mu_{eff} \nabla \zeta) + S_\zeta


which I implemented as:


Code:
    fvScalarMatrix specHumEqn                                                   
    (                                                                           
        fvm::ddt(rho, specHum)                                                  
      + fvm::div(phi, specHum)                                                  
     ==                                                                         
        fvm::laplacian(muEff, specHum)                                          
      + fvOptions(rho, specHum)                                                 
    );                                                                          
                                                                                
    specHumEqn.relax();                                                         
    fvOptions.constrain(specHumEqn);                                            
    specHumEqn.solve();                                                         
    fvOptions.correct(specHum);
Now, I want to add a humidity source using the fvOption functionality. This is working fine but something is wrong here. Imagine the following snippet
Code:
sourceHumidity                                                                  
{                                                                               
    type            scalarSemiImplicitSource;                                   
                                                                                
    timeStart       0;                                                        
    duration        5.0;                                                        
    selectionMode   all;                                                        
    cellZone        zone;                                                       
                                                                                
                                                                                
    volumeMode      absolute;                                                   
    injectionRateSuSp                                                           
    {                                                                           
        thermo:specificHumidity   (1 0);
    }                                                                           
}
I would expect to increase the quantity inside the volume (1 cubic meter) to a value of 5 after 5 s (for each second increase the value by 1). However, in my case it is 4.21693 and I cannot get the reason why. Any hints?

If I program it like that, it works:
Code:
    fvScalarMatrix specHumEqn                                                   
    (                                                                           
        fvm::ddt(rho, specHum)                                                  
      + fvm::div(phi, specHum)                                                  
     ==                                                                         
        fvm::laplacian(muEff, specHum)                                          
        + rho*dimensionedScalar("non", dimensionSet(0,0,-1,0,0,0,0), 1)                                                 
    );                                                                          
                                                                                
    specHumEqn.relax();                                                         
    fvOptions.constrain(specHumEqn);                                            
    specHumEqn.solve();                                                         
    fvOptions.correct(specHum);
oswald likes this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   February 21, 2020, 21:04
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Ah I found the problem but now I am a bit lost:


The explicit source is added to the equation but without the density information

Code:
    eqn += Su + fvm::SuSp(Sp, psi);
I guess here we do have a bug.
Tobi
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   February 21, 2020, 21:30
Default
  #3
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Yes we do have the bug here and I asked a similar question a few weeks ago while we pointed out that there is a problem. Using density based solvers, we do neglect the density in this function (addSup). I am checking it with the people from the Foundation and will report / provide a patch.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   February 22, 2020, 07:14
Default
  #4
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi all,


I already discussed a few thing here. As some quantities do not need the multiplication by the density it is not a bug per se. However, one should keep this in his mind. Maybe a workaround will be started to explicitly activate the density multiplication. Well, I keep you up to date. Alternatively, one can use the coded... fvOptions functionality and do the multiplication manually.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   March 10, 2021, 09:58
Default
  #5
New Member
 
rocco
Join Date: Nov 2020
Posts: 13
Rep Power: 5
rocco96 is on a distinguished road
Hi,
I am also trying to add the humidity equation to interCondensatingEvaporatingFoam to study an open flat channel formed by water and air. My problem is that I cannot make the specific humidity dependent on the saturation temperature. Do you have any advice?
Best regards,
Rocco
rocco96 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
Can I use fvOptions to couple a solid region and a fluid region? titanchao OpenFOAM Running, Solving & CFD 4 January 14, 2022 07:55
fvMatrix, fvOptions and SuSp: automatic implicit/explicit source-term treatment Zeppo OpenFOAM Programming & Development 7 December 15, 2021 10:20
Porosity and the energy equation shock77 OpenFOAM Running, Solving & CFD 11 May 9, 2020 15:52
reactingFOAM with fvOptions for gravity ERROR in energy equation er99 OpenFOAM Running, Solving & CFD 1 June 3, 2019 11:08
Power dependent heat source using fvOptions Raza Javed OpenFOAM Running, Solving & CFD 0 April 15, 2019 08:45


All times are GMT -4. The time now is 15:13.