CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Boundary gradient of alpha in interFoam

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Search this Thread Display Modes
Old   November 29, 2019, 06:24
Default Boundary gradient of alpha in interFoam
New Member
Join Date: Feb 2019
Posts: 23
Rep Power: 4
dolfus is on a distinguished road
Hello all,

I'm trying to develop my own solver based in interFoam but I'm stucked at the interfaceProperties.C file. I think that I understand almost the whole file but after the calculation of the normal interface vector nHatp, the alpha gradient is corrected as

i.e. the magnitud of the gradient multiplied by the cosine of the angle of the interface at the wall.

First af all I set the limit entry in the alpha.water dictionary to none and If I modify this last gradient correction expression, for example setting it up to 0, it is interpreted by the code as if the dot product (nf&nHatp) were equal to 0, i.e. the angle is 90, wich is consistent. But if I simply remove this line from the code, the effect in the calculations is the same as in the last case: the gradient of alpha is equal to 0. So I haven't been able to override this correction step to get just the gradient of alpha calculated (notice that if you just let acap.gradient()=mag(gradlAlphaf[patchi]) it would mean that (nf&nHatp)=1 and therofore the angle would be 0).

With the aim to avoid this, I tried to modify the following constructor in the alphaContactAnglePatchScalarField.C file

    const fvPatch& p,
    const DimensionedField<scalar, volMesh>& iF,
    const dictionary& dict
    fixedGradientFvPatchScalarField(p, iF),
    if (dict.found("gradient"))
        gradient() = scalarField("gradient", dict, p.size());
        gradient() = 0.0;
but when removing the else entry the alpha gradient equals to 0 again (if you modify this entry setting it up to 10 por example, it works).
So I haven't been able to understand how this implementation of the alpha gradient works. I hope you can shed light on this matter.


Last edited by dolfus; November 29, 2019 at 06:24. Reason: Gramatic error
dolfus is offline   Reply With Quote

Old   July 14, 2020, 14:10
New Member
Join Date: Sep 2019
Posts: 12
Rep Power: 3
zhaohb11_cfd is on a distinguished road
Hi dolfus,

Do you have any ideas on what is the alpha gradient for ? I am also puzzled by this code.
zhaohb11_cfd is offline   Reply With Quote


boundary, gradient calculation, interfoam

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Periodic flow using Cyclic - comparison with Fluent nusivares OpenFOAM Running, Solving & CFD 30 December 12, 2017 05:35
Out File does not show Imbalance in % Mmaragann CFX 5 January 20, 2017 10:20
Boundary conditions for Boundary layer + pressure gradient Obad Main CFD Forum 0 May 2, 2015 03:20
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 17:44
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 04:15

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