CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 29, 2019, 07:24
Default Boundary gradient of alpha in interFoam
  #1
New Member
 
Join Date: Feb 2019
Posts: 15
Rep Power: 2
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

Code:
acap.gradient()=(nf&nHatp)*mag(gradlAlphaf[patchi])
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

Code:
Foam::alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
(
    const fvPatch& p,
    const DimensionedField<scalar, volMesh>& iF,
    const dictionary& dict
)
:
    fixedGradientFvPatchScalarField(p, iF),
    limit_(limitControlNames_.read(dict.lookup("limit")))
{
    if (dict.found("gradient"))
    {
        gradient() = scalarField("gradient", dict, p.size());
        fixedGradientFvPatchScalarField::updateCoeffs();
        fixedGradientFvPatchScalarField::evaluate();
    }
    else
    {
        fvPatchField<scalar>::operator=(patchInternalField());
        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.


Regards.

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

Reply

Tags
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 06:35
Out File does not show Imbalance in % Mmaragann CFX 5 January 20, 2017 11:20
Boundary conditions for Boundary layer + pressure gradient Obad Main CFD Forum 0 May 2, 2015 04:20
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 18:44
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 05:15


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