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

[waves2Foam] Initial water level is not horizontal, but U shaped towards domain inlet and outlet

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 19, 2023, 08:54
Unhappy Initial water level is not horizontal, but U shaped towards domain inlet and outlet
  #1
New Member
 
Nian
Join Date: Jun 2019
Posts: 15
Rep Power: 6
noodleluvmay is on a distinguished road
Hello there,

I am quite new to waves solver, so sorry in advance if the answer to this is obvious.

I have run the 2D waveFlume tutorial okay, now I have adapted the case to be 3D, as well as added a fixed object in the water domain.

However, the results seem to show I have not defined the water field properly, and that water is only present at the beginning and end sections of the domain, which I suspect is the relaxation zone I have added. Please see image1:



I am not completely sure why this is the case, could it maybe have been the boundary conditions I have set?

My blockMesh dict:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  1.5                                   |
|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices        
(
    ( -3 -3 -1 )
    (  7 -3 -1 )
    ( -3  1 -1 )
    (  7  1 -1 )
                 
    ( -3 -3  1 )
    (  7 -3  1 )
    ( -3  1  1 )
    (  7  1  1 )                    
);

blocks          
(
    hex (0 1 3 2 4 5 7 6) ( 100 40 20 ) simpleGrading (1 1 1)
);

edges           
(
);

patches         
(
    patch inlet
    (
        (0 4 6 2)
    )
    wall bottom 
    (
        (0 1 5 4)
    )
    patch outlet
    (
        (1 5 7 3)
    )

    patch atmosphere 
    (
        (2 3 7 6)
    )
    
    patch frontBack
    (
        (0 1 3 2)
        (4 5 7 6)
    )
);

mergePatchPairs
(
);

// ************************************************************************* //
waveProperties.input:

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  1.5                                   |
|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      environmentalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

seaLevel	0.00;

// A list of the relaxation zones in the simulation. The parameters are given
// in <name>Coeffs below.
relaxationNames (inlet outlet);

initializationName outlet;

inletCoeffs
{
    // Wave type to be used at boundary "inlet" and in relaxation zone "inlet"
    waveType    stokesFirst;  
    
    // Ramp time of 2 s
    Tsoft       2;

    // Water depth at the boundary and in the relaxation zone
    depth       1.200000;

    // Wave period
    period      2.0;

    // Phase shift in the wave
    phi         0.000000;

    // Wave number vector, k. 
    direction  (1.0 0.0 0.0);

    // Wave height
    height      0.1;
    
    // Specifications on the relaxation zone shape and relaxation scheme
    relaxationZone
    {
        relaxationScheme Spatial;
        relaxationShape  Rectangular;
        beachType        Empty;
    
        relaxType   INLET;
        startX      (-3 0.0 -1);
        endX        (-1 0.0  1);
        orientation      (1.0 0.0 0.0);
    }
};

outletCoeffs
{
    waveType    potentialCurrent;
    U           (0 0 0);
    Tsoft       2;

    relaxationZone
    {
        relaxationScheme Spatial;
        relaxationShape  Rectangular;
        beachType        Empty;    

        relaxType   OUTLET;
        startX      (5 0.0 -1);
        endX        (7 0.0  1);
        orientation      (1.0 0.0 0.0);
    }
};



// ************************************************************************* //
p_rgh in 0/:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1912                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [1 -1 -2 0 0 0 0];


internalField   uniform 0;

boundaryField
{
    inlet
    {
        type            zeroGradient;
    }
    bottom
    {
        type            zeroGradient;
    }
    outlet
    {
        type            zeroGradient;
    }
    atmosphere
    {
        type            totalPressure;
        rho             rho;
        psi             none;
        gamma           1;
        p0              uniform 0;
        value           uniform 0;
    }
    frontBack
    {
        type            zeroGradient;
    }
}


// ************************************************************************* //
It should be noted that, this file seems to be different from my p_rgh in 0.org/ after the setWaveField command - I have added a boundaryField for the fixed object wall in p_rgh.org, but it disappears (resets) after I run setWaveField.

alpha1.org:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  1.5-dev                               |
|   \\  /    A nd           | Revision: 1740                                  |
|    \\/     M anipulation  | Web:      http://www.OpenFOAM.org               |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      alpha.org;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
	//- Set patchGroups for constraint patches
    #includeEtc "$WM_PROJECT_DIR/etc/caseDicts/setConstraintTypes"
	
    inlet
    {
        type            zeroGradient; //waveAlpha;
        refValue        uniform 0;
        refGrad         uniform 0;
        valueFraction   uniform 1;
        value           uniform 0;
    }
    bottom
    {
        type            zeroGradient;
    }
    outlet
    {
        type            zeroGradient;
    }
    atmosphere
    {
        type            inletOutlet;
        inletValue      uniform 0;
        value           uniform 0;
    }
    frontBack
    {
        type            zeroGradient; //empty;
    }
	WCGroup
	{
		type 			zeroGradient;
	}
}


// ************************************************************************* //
I would appreciate some insights on this, thank you for your time reading this!
Attached Images
File Type: jpg image1.jpg (36.1 KB, 13 views)
noodleluvmay is offline   Reply With Quote

Old   April 21, 2023, 05:35
Default
  #2
New Member
 
Nian
Join Date: Jun 2019
Posts: 15
Rep Power: 6
noodleluvmay is on a distinguished road
To add to this, I am running in parallel - it seems to run fine without the object in the domain, it feels like an issue with either snappyHexMesh or the setting of boundary conditions/initial input conditions for decomposed domains!

My run file procedure is:

runApplication surfaceFeatureExtract
runApplication blockMesh
runApplication waveGaugesNProbes
runApplication setWaveParameters
runApplication decomposePar -copyZero
runParallel snappyHexMesh -overwrite
runApplication reconstructParMesh
runApplication setFields
runApplication decomposePar
mpirun -np 4 waveFoam -parallel > log.waveFoam 2>&1

The reason I reconstructed before setFields is because I have read other posts where it seems to be the best way going about it, as setFields seems to not set the decomposed domains properly, I am not sure if my approach is correct though!

Last edited by noodleluvmay; April 21, 2023 at 05:54. Reason: Adding more information
noodleluvmay is offline   Reply With Quote

Old   April 27, 2023, 12:24
Default
  #3
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Please note that setFields is native to OpenFOAM, while setWaveField is the tool developed for waves2Foam.


Kind regards and good luck



Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Reply

Tags
boundary condition, initial condition


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
Atmospheric BCs for domain with a single boundary serving as both the inlet & outlet Newtonian OpenFOAM Running, Solving & CFD 0 July 21, 2022 14:07
interFoam wave propagation and explosion of Courant number and residuals ChiaraViola OpenFOAM Running, Solving & CFD 1 June 26, 2019 05:36
Flowrate at inlet and outlet not balancing ( centrifugal pump ) -- pimpleDyMFoam coolcrasher OpenFOAM Running, Solving & CFD 20 November 25, 2015 05:33
Keeping inlet mass flux the same as outlet mass flux in an water tank vaibhav402 Main CFD Forum 0 October 13, 2015 03:02
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 09:11


All times are GMT -4. The time now is 11:38.