CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[waves2Foam] BC changes from relaxationAlpha to waveAlpha after using setWaveField in OFv2306

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

Like Tree1Likes
  • 1 Post By Jesper_Roland

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 17, 2023, 06:52
Post BC changes from relaxationAlpha to waveAlpha after using setWaveField in OFv2306
  #1
New Member
 
Jesper R. K. Qwist
Join Date: Dec 2017
Posts: 22
Rep Power: 8
Jesper_Roland is on a distinguished road
Hi,

I have compiled the newest version of waves2Foam with OpenFoam-v2306.

My problem

I specify boundary condition type to be relaxationAlpha in 0/alpha.water as follows:

Code:
boundaryField
{
    inlet
    {
        type            relaxationAlpha;
        refValue        uniform 0;
        refGrad         uniform 0;
        valueFraction   uniform 1;
        value           uniform 0;
    }
    bottom
    {
        type            zeroGradient;
    }
    outlet
    {
        type            relaxationAlpha;
        refValue        uniform 0;
        refGrad         uniform 0;
        valueFraction   uniform 1;
        value           uniform 0;
    }
    atmosphere
    {
        type            zeroGradient;
    }
    frontBack
    {
        type            empty;
    }
}
When I call setWaveField 0/alpha.water is modified. The internal field is perfectly fine but something odd happens in the boundary field.
The boundary type changes from relaxationAlpha to waveAlpha.
The following piece of code, is the boundary field section from the alpha.water field that was written during a call to the setWaveField application.
Code:
boundaryField
{
    inlet
    {
        type            waveAlpha;
        waveDictName    waveProperties;
        value           uniform 0;
    }
    bottom
    {
        type            zeroGradient;
    }
    outlet
    {
        type            waveAlpha;
        waveDictName    waveProperties;
        value           uniform 0;
    }
    atmosphere
    {
        type            zeroGradient;
    }
    frontBack
    {
        type            empty;
    }
}
This results in an error when I try to execute that case as the code does not know about any boundary condition called waveAlpha since the new name is relaxationAlpha.

My temporary solution:
If I manually change waveAlpha to relaxationAlpha then my case executes perfectly fine.

Notes:

I have observed the same change in 0/U where the boundary type is changed from relaxationVelocity to waveVelocity.

I have been looking at the source files related to the setWaveField application and class as well as the waveAlphaFvPatchScalarField and waveVelocityFvPatchScalarField classes. But I have not been able to identify exactly where the code writes waveAlpha or waveVelocity to the dictionary files.

Are there anyone who have experienced the same problem?
And how to solve this / suggestions to where to look for the problem?

Best Regards,

Jesper Qwist
gcampana likes this.
Jesper_Roland is offline   Reply With Quote

Old   December 13, 2023, 10:05
Default
  #2
New Member
 
Guillén Campaña Alonso
Join Date: Jun 2021
Posts: 6
Rep Power: 5
gcampana is on a distinguished road
Hi! I have also experienced this issue, moreover I cannot fix it like you do. An error arises saying:

Code:
Dictionary entry for patch inlet not found

file: constant/waveProperties at line 17 to 75.

    From static Foam::autoPtr<Foam::waveModel> Foam::waveModel::New(const Foam::word&, const Foam::fvMesh&, const Foam::polyPatch&)
    in file waveModel/waveModelNew.C at line 61.
These are the boundary conditions after setWaveFields

alpha.water (I omit the internalField list)

Code:
boundaryField
{
    inlet
    {
        type            relaxationAlpha;
        waveDictName    waveProperties;
        value           uniform 0;
    }
    outlet
    {
        type            zeroGradient;
    }
    ground
    {
        type            zeroGradient;
    }
    top
    {
        type            inletOutlet;
        inletValue      uniform 0;
        value           uniform 0;
    }
    side1
    {
        type            empty;
    }
    side2
    {
        type            empty;
    }
}
U

Code:
internalField   uniform (0 0 -0);

boundaryField
{
    inlet
    {
        type            relaxationVelocity;
        waveDictName    waveProperties;
        value           uniform (0 0 0);
    }
    outlet
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    ground
    {
        type            slip;
    }
    top
    {
        type            pressureInletOutletVelocity;
        value           uniform (0 0 0);
    }
    side1
    {
        type            empty;
    }
    side2
    {
        type            empty;
    }
}

And finally, this is my waveProperties.input file
Code:
seaLevel        0;

relaxationNames
(
    inlet
    outlet
);

initializationName inlet;

inletCoeffs
{
    waveType        stokesSecond;
    depth           103.68;
    period          11.3;
    direction       ( 1 0 0 );
    phi             0;
    height          5.49;
    Tsoft           11.3;
    debug           false;

    relaxationZone
    {
        relaxationScheme    Spatial;
        relaxationWeight    Exponential;
        exponent            3.5;
        courantCorrection   false;
        beachType           Empty;
        relaxationShape     Rectangular;
        relaxType           INLET;
        startX              ( -400 -204 0 );
        endX                ( -200  204 0 );
        orientation         ( 1 0 0 );
    }
}

outletCoeffs
{
    waveType        potentialCurrent;
    depth           103.68;
    U               ( 0 0 0 );
    Tsoft           11.3;

    relaxationZone
    {
        relaxationScheme    Spatial;
        relaxationWeight    Exponential;
        exponent            3.5;
        courantCorrection   false;
        relaxationShape     Rectangular;
        relaxType           OUTLET;
        startX              ( 200 -203.4 0 );
        endX                ( 700  203.4 0 );
        orientation         ( 1 0 0 );
    }
}

initCoeffs
{
    waveType        potentialCurrent;
    U               ( 0 0 0 );
    Tsoft           11.3;
}

I can use the zeroGradient BC and it works. Do you know where my error is?

Best regards
gcampana is offline   Reply With Quote

Reply

Tags
boundary, relaxationalpha, setwavefield, wavealpha, waves2foam

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
[waves2Foam] setWaveField and/or waveFoam not working in parallel saeed.barzegar.v OpenFOAM Community Contributions 2 January 25, 2023 15:57
setWaveField never finish Rasmusiwersen OpenFOAM Pre-Processing 3 June 30, 2022 12:51


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