CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [waves2Foam] working on adding waves2Foam toolbox to compressibleInterFoam instead of interFoam (https://www.cfd-online.com/Forums/openfoam-community-contributions/208051-working-adding-waves2foam-toolbox-compressibleinterfoam-instead-interfoam.html)

betsybrite July 17, 2014 01:22

working on adding waves2Foam toolbox to compressibleInterFoam instead of interFoam
 
Hi Niels,
First of all, I want to echo many others in this post by saying that I am so grateful for your waves2Foam toolbox and your attention to this thread! I am working on adding the waves2Foam toolbox for use with compressibleInterFoam instead of interFoam. I have been able to generate waves with the same amplitude as in interFoam. The problem I am running into is that in order to use the compressibility factor psi in compressibleInterFoam I need to be solving for absolute pressure instead of gauge pressure. It appears in the compressible tutorials, this is accomplished by setting:

defaultFieldValues
(
volScalarFieldValue alpha1 1
volScalarFieldValue p_rgh 1e5
);

in setFieldsDict. Is there a different way to do this through waves2Foam since we don't use setFieldsDict?

Thank you so much!
Betsy

ngj July 19, 2014 05:01

Good morning

@Betsy: I am not quite sure, what you are asking, since you talk about total pressure, but the example you gave sets the gauge pressure (p_rgh). Nonetheless, the free surface and velocities are independent on whether you specify total or gauge pressure as primitive variable. Therefore, it is merely a matter of making a pre-processing tool, which sets the total pressure as well. Try to look in the existing setWaveFields, because it does set the pressure (for a limited number of cases), but it is only the gauge pressure. It should be straight forward for you to add the hydrostatic component in setWaveFields directly. Something like the following:

Code:

Switch addHydrostatic = someDictName.lookupOrDefault<Switch>("addHydrostatic", "false");

if (addHydrostatic)
{
    // Perform the pressure correction
}

I have suggested it like that, since it retains the gauge pressure definition in waveTheories and it is backward compatible for all, who uses the incompressible interFoam.

Furthermore, I have seen your recent articles in Coastal Engineering. Do you think that there would be an opportunity for you to share the solitary wave description, which you used?

Kind regards,

Niels

betsybrite July 21, 2014 18:20

Hi Niels,
Thank you for your reply, I will look into this. As far as the description of the solitary wave used in the coastal engineering paper, I would like to refer you to my co-author Masoud Hayatdavoodi (masoud@hawaii.edu). If I can get waves2Foam working with compressible air, I will be happy to share this with you as well.
Thanks again!
Betsy

betsybrite October 22, 2014 21:05

Hi Niels & followers of this thread -
I wanted to share that I have been able to successfully implement the waves2Foam package with the compressible solver, compressibleInterFoam. I modified the source code in the same manner as instructed for the incompressible solver, interFoam. As I mentioned above, interFoam solves for gauge pressure while compressibleInterFoam solves for absolute pressure. Therefore in order to run waves2Foam using the compressible solver, the pressure must be initially set to atmospheric pressure. I just do this manually in the p_rgh file (re-saving after performing setWaveField as this will re-set it to 0) but someone else may find a more elegant way to do this. Results from this will be in my PhD dissertation, which should finalized by December.

Regards,
Betsy

ngj October 23, 2014 01:13

Hi Betsy,

Thank you for the update and congratulations. Could you please inform us, when there is a thesis available for download?

Kind regards,

Niels


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