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

flowRateOutletVelocity BC for compressible application

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 26, 2019, 13:00
Default flowRateOutletVelocity BC for compressible application
  #1
Member
 
Mat
Join Date: Jan 2012
Posts: 60
Rep Power: 14
Mat_fr is on a distinguished road
Hi Foamers,


I would like to use the flowRateOutletVelocity boundary condition with a compressible fluid (I am using compressibleInterFoam).


I want to impose a mass flow rate, so I am using the following specifications:


Code:
        

        type                flowRateOutletVelocity;
        massFlowRate        0.03;
        rho                 rho;
With this settings, I am getting the following error


--> FOAM FATAL ERROR:
Did not find registered density field rho and no constant density 'rhoOutlet' specified


which is strange as the volScalarField rho is speficied in my time folder.


I don't want to use a constant density to estimate the mass flow rate (as with rhoOutlet option), but I want to use the density field rho computed by the solver.
Is it even possible ?


Thanks for your help,
Mat
Mat_fr is offline   Reply With Quote

Old   June 27, 2019, 05:18
Default
  #2
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
jherb is on a distinguished road
It might be thermo:rho or something like rho.air or even thermo:rho.air
jherb is offline   Reply With Quote

Old   June 27, 2019, 06:24
Default
  #3
Member
 
Mat
Join Date: Jan 2012
Posts: 60
Rep Power: 14
Mat_fr is on a distinguished road
Good call, but unfortunately it's not working either. I have tried the different combinations.
Mat_fr is offline   Reply With Quote

Old   June 27, 2019, 06:33
Default
  #4
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
jherb is on a distinguished road
Ok, then perhaps this helps:


First try a different boundary condition to get it to run at all. Then also add a writeObject funtion object to the controlDict with object "banana". This should show all available object in the internal database.


https://github.com/OpenFOAM/OpenFOAM...s/writeObjects
jherb is offline   Reply With Quote

Old   June 27, 2019, 07:55
Default
  #5
Member
 
Mat
Join Date: Jan 2012
Posts: 60
Rep Power: 14
Mat_fr is on a distinguished road
Thanks for your help Joachim,


None of the fields in the list given by the writeObject funtion solves this error. Which is strange.



I have tried also with the flowRateInletVelocity boundary condition, but it's the same problem.


When I look to a tutorial example (for instance in tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/0/U), we can see the following BC:


inlet
{
type flowRateInletVelocity;
massFlowRate constant 5;
rhoInlet 1000; // Guess for rho
}


Perhaps the comment means that rhoInlet is only used as a guess for the first time step, and then the inlet velocity is adapted in function of the given flow rate and the calculated rho ?
Should be the same with the outlet BC then.



Regards,
Mat
Mat_fr is offline   Reply With Quote

Old   June 27, 2019, 08:24
Default
  #6
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
jherb is on a distinguished road
This is the source code of the boundary condition:
https://github.com/OpenFOAM/OpenFOAM...orField.C#L185


So if it does not find a field with the name for rho, you have specified, it tries to use rhoOutlet (see also the description in the header file: https://github.com/OpenFOAM/OpenFOAM...hVectorField.H)


It is not an initial guess but used as constant during the whole run.


But I still do not understand, why it does not find rho: The field is defined in the solver: https://github.com/OpenFOAM/OpenFOAM...teFields.H#L44


But is this field (the weighted average density) what you want for your boundary? Otherwise, two density fields are references here: https://github.com/OpenFOAM/OpenFOAM...teFields.H#L41


If you modify this file, you might get the names by adding something like (not tested):
Code:
Info<<"rho1: "<< rho1.name() << endl;
Info<<"rho2: "<< rho2.name() << endl;



Which version of OpenFOAM do you use?
jherb is offline   Reply With Quote

Old   June 27, 2019, 08:47
Default
  #7
Member
 
Mat
Join Date: Jan 2012
Posts: 60
Rep Power: 14
Mat_fr is on a distinguished road
I am using openfoam-6.


I got the names with your piece of code:


-->

rho1: thermo:rho.h2
rho2: thermo:rho.water



Already tried them, and still the same error.
Mat_fr is offline   Reply With Quote

Old   July 2, 2019, 03:42
Default
  #8
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
jherb is on a distinguished road
One last idea: What is in the "object" name in the header of the files with the density stored in the time directory?



Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  5.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "200";
    object      XXXXXX;
}
jherb is offline   Reply With Quote

Old   July 2, 2019, 14:01
Default
  #9
Member
 
Mat
Join Date: Jan 2012
Posts: 60
Rep Power: 14
Mat_fr is on a distinguished road
Hi



Thanks a lot for your time.


The header specifies "rho", but it's still not working.


I have made the test with the compressible/rhoPimpleFoam/RAS/squareBendLiq tutorial.


By default for this tutorial, the inlet BC for U is using a constant density and reads:


Code:
    inlet
    {
        type            flowRateInletVelocity;
        massFlowRate    5.0;
        rhoInlet        1000;    // Guess for rho
    }

And if I change it for a variable density with the lines below, it is working in this case!
Code:
    inlet
    {
        type            flowRateInletVelocity;
        massFlowRate    5.0;
        rho             rho;
    }

So I think it is a problem of compatibility between the solver and the BC.


Regards,
Mat
Mat_fr is offline   Reply With Quote

Old   July 4, 2019, 05:22
Default
  #10
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
jherb is on a distinguished road
I guess your are right. You might try to get an answer from the OpenFOAM foundation by posting this problem on their bug tracker: https://bugs.openfoam.org/


You most probably get a request for funding to implement it, but perhaps also an explanation, why it does not work.


You could try to call db().foundObject<volScalarField>(rhoName_) (or mesh.foundObject<volScalarField>(rhoName_) ) in the solver itself with different names and output, if something was found.



Perhaps, the boundary conditions are evaluated the first time before the rho field exists. But this is just a guess. Another one is, that the name is not correct (some permutation of thermo/rho/rho1/rho.water/...


You could try to add
jherb 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
SimpleFoam cannot open include file Marija OpenFOAM Running, Solving & CFD 1 October 28, 2020 10:35
Error in compute process - No Active Application yetlyg FLUENT 8 October 27, 2018 22:30
Ansys Licence Serve on Ubuntu 16.04 LTS david.pasquale ANSYS 2 January 20, 2017 11:52
Is Playstation 3 cluster suitable for CFD work hsieh OpenFOAM 9 August 16, 2015 14:53
what should we do for the application of CUDA in CFD? aerosjc Main CFD Forum 6 February 25, 2013 11:01


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