CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Trying to apply linearRamp for flow velocity in DTCHull

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 16, 2023, 08:57
Default Trying to apply linearRamp for flow velocity in DTCHull
  #1
mm7
New Member
 
Mark
Join Date: Sep 2020
Posts: 6
Rep Power: 5
mm7 is on a distinguished road
Hi,
I have little experience with OpenFOAM.
My goal is to analyse a hull resistance at speed growing from 0 to Umax, i.e 3 m/s.



I've got openfoam-2212 and started with DTCHull project, I've put my custom hull STL there, decreased volume of "tank" and refinement level to 5.


It worked well, but that was for constant flow velocity.


I've decided to apply linearRamp there.



Currently I am having issues when running runParallel $(getApplication)

error

Code:
Creating finite volume options from "constant/fvOptions"

Selecting finite volume options type accelerationSource
[6] [3] [0] 
[6] 
[6] --> FOAM FATAL IO ERROR: (openfoam-2212 patch=230110)
[6] 
[3] 
[3] --> FOAM FATAL IO ERROR: (openfoam-2212 patch=230110)
[3] Unknown fvOption type accelerationSource

Valid fvOption types :

50
(
acousticDampingSource
actuationDiskSource
buoyancyEnergy
buoyancyForce
buoyancyTurbSource
constantHeatTransfer
directionalPressureGradientExplicitSource
explicitPorositySource
fixedTemperatureConstraint
heatExchangerSource
interRegionExplicitPorositySource
jouleHeatingSource
limitTemperature
limitVelocity
meanVelocityForce
multiphaseMangrovesSource
multiphaseMangrovesTurbulenceModel
multiphaseStabilizedTurbulence
patchCellsSource
patchMeanVelocityForce
radialActuationDiskSource
radiation
rotorDisk
scalarCodedSource
scalarFixedValueConstraint
scalarPhaseLimitStabilization
scalarSemiImplicitSource
solidificationMeltingSource
sphericalTensorCodedSource
sphericalTensorFixedValueConstraint
sphericalTensorPhaseLimitStabilization
sphericalTensorSemiImplicitSource
symmTensorCodedSource
symmTensorFixedValueConstraint
symmTensorPhaseLimitStabilization
symmTensorSemiImplicitSource
tabulatedAccelerationSource
tabulatedHeatTransfer
tabulatedNTUHeatTransfer
tensorCodedSource
tensorFixedValueConstraint
tensorPhaseLimitStabilization
tensorSemiImplicitSource
variableHeatTransfer
vectorCodedSource
vectorFixedValueConstraint
vectorPhaseLimitStabilization
vectorSemiImplicitSource
velocityDampingConstraint
viscousDissipation
)

[0] file: constant/fvOptions.velocityRamping at line 21 to 34.

Here is my file constant/fvOptions
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  dev
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "constant";
    object      fvOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include    "refValues";

velocityRamping
{
    type        accelerationSource;
    active      on;
    selectionMode all;
    U           U;
    velocity
    {
        type    scale;
        scale
        {
          type        linearRamp;
          start       0;
          duration    $duration;
        }
        value    ($negUmax 0 0);
    }
}

Please advise



The whole project is attached.
Attached Files
File Type: zip Prone_6ft.0.zip (73.1 KB, 3 views)
mm7 is offline   Reply With Quote

Old   June 16, 2023, 10:35
Default
  #2
Senior Member
 
Join Date: Dec 2021
Posts: 209
Rep Power: 5
Alczem is on a distinguished road
Hey!


Rather than using a fvOptions function, you could try uniformFixedValue as a boundary condition for U. It allows you to specify time-varying boundary conditions, so you can create your ramp
Alczem is offline   Reply With Quote

Old   June 16, 2023, 11:47
Default
  #3
mm7
New Member
 
Mark
Join Date: Sep 2020
Posts: 6
Rep Power: 5
mm7 is on a distinguished road
Yes, I've done that as well.
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2212                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#include "../constant/refValues";

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

// min flow velocity
internalField   uniform (0 0 0);

boundaryField
{
    #includeEtc "caseDicts/setConstraintTypes"

    inlet
    {
        type uniformFixedValue;
        value $internalField;
        uniformValue {
            value ($negUmax 0 0);
            type scale;
            scale {
              type linearRamp;
              start 0;
              duration $duration;
            }
        }
    }

    outlet
    {
        type            outletPhaseMeanVelocity;
        alpha           alpha.water;
        value           $internalField;
        Umean $Umax;
        UnMean {
            value $Umax;
            type  scale;
            scale {
              type linearRamp;
              start 0;
              duration $duration;
            }
        }
    }

    atmosphere
    {
        type            pressureInletOutletVelocity;
        value           uniform (0 0 0);
    }

    hull
    {
        type            movingWallVelocity;
        value           uniform (0 0 0);
    }
}


// ************************************************************************* //



There was one advise from a developer
"You need to define ramping function for the velocity at three points: inlet (BC type waveVelocity), outlet (BC type outletPhaseMeanVelocity) and you need the velocityRamping fvOption (which was recently renamed to accelerationSource). You need to ensure, that you have same parameters (ramp type, start and duration) for inlet, outlet and fvOption."
I've fount it here Multiphase ramping functionality


I've just changed quarterSineRamp to linearRamp.
But solver shows the error above.
mm7 is offline   Reply With Quote

Old   June 16, 2023, 14:08
Default
  #4
Senior Member
 
Join Date: Dec 2021
Posts: 209
Rep Power: 5
Alczem is on a distinguished road
Oh okay, I thought that using uniformFixedValue in a very basic way at the inlet would be enough, like that:


Code:
<patchName> {     type            uniformFixedValue;     uniformValue    table     (         (0   (0 0 0))         (5   (10 0 0))     ); }

The ramp is properly defined if I am not mistaken, and you can leave the outlet with a zeroGradient condition? You are using interFoam correct?
Alczem is offline   Reply With Quote

Old   June 17, 2023, 11:39
Default
  #5
mm7
New Member
 
Mark
Join Date: Sep 2020
Posts: 6
Rep Power: 5
mm7 is on a distinguished road
Ok. I removed constant/fvOptions

And made 0/U this way
Code:
#include "../constant/refValues";

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

// min flow velocity
internalField   uniform (0 0 0);

boundaryField
{
    #includeEtc "caseDicts/setConstraintTypes"

    inlet
    {
        type uniformFixedValue;
        uniformValue table
        ( (0         ( 0 0 0))
          ($duration (10 0 0))
        );
    }

    outlet
    {
        type            zeroGradient;
    }

    atmosphere
    {
        type            pressureInletOutletVelocity;
        value           uniform (0 0 0);
    }

    hull
    {
        type            movingWallVelocity;
        value           uniform (0 0 0);
    }
}
zeroGradient has made outlet like an open side of a fishtank, like a glass has broken there. All water started flow out and level decreased there.


I need a whole body of water (and air) steadily increase velocity from 0 to Umax. In other words - like the boat (with the boundaries) start moving with growing speed in an infinite pond.


Yes, I am using interFoam
Attached Images
File Type: png at_5sec.png (98.4 KB, 16 views)
mm7 is offline   Reply With Quote

Old   June 18, 2023, 12:59
Default
  #6
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,086
Rep Power: 26
Yann will become famous soon enough
Hello Mark,

Just a side note: the link your provided about "accelerationSource" is from the OpenFOAM foundation branch (openfoam.org). You are using the ESI-OpenCFD branch (openfoam.com).

"accelerationSource" does not exist in the OpenCFD branch, and this is why you get the error in your first post.

Regards,
Yann
Yann is offline   Reply With Quote

Old   June 18, 2023, 13:47
Default
  #7
mm7
New Member
 
Mark
Join Date: Sep 2020
Posts: 6
Rep Power: 5
mm7 is on a distinguished road
Quote:
Originally Posted by Yann View Post
Hello Mark,

Just a side note: the link your provided about "accelerationSource" is from the OpenFOAM foundation branch (openfoam.org). You are using the ESI-OpenCFD branch (openfoam.com).

"accelerationSource" does not exist in the OpenCFD branch, and this is why you get the error in your first post.

Regards,
Yann

Hi Yann,
thank you, I'll try to get the OpenFOAM foundation branch.




thank you Yann,
the OpenFOAM foundation branch works!

Last edited by mm7; June 20, 2023 at 08:51.
mm7 is offline   Reply With Quote

Old   June 23, 2023, 09:59
Default
  #8
mm7
New Member
 
Mark
Join Date: Sep 2020
Posts: 6
Rep Power: 5
mm7 is on a distinguished road
Though "accelerationSource" works ok, it is not exactly what I need.
The water coming from the inlet disturbs water in the tank.
I want to model a boat runs with acceleration on undisturbed water.
Like on a pond. So only the boat disturbs it.


One way it would be to create a long block mesh with 0 velocity inlet/outlet, and move the hull along of it. I am afraid it will increase processing time.


Another way is to keep the hull on same position relative to boundary and somehow move whole system - boat and boundary through the calm water.
I hope I explained it well.
Is it possible to define?
mm7 is offline   Reply With Quote

Old   September 20, 2023, 08:51
Default oam::error::printStack(Foam::Ostream&) at ??:? with icoFoam
  #9
New Member
 
Sara
Join Date: Sep 2023
Posts: 1
Rep Power: 0
Saralorenzo is on a distinguished road
Hello everyone,


I have an error during the runing of my programe that looks like this:


/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 10
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
Build : 10-e450dce21ea5
Exec : icoFoam
Date : Sep 20 2023
Time : 13:41:42
Host : "adminval-HP-EliteBook-8540w"
PID : 9953
I/O : uncollated
Case : /home/admin-val/Desktop/SARA_CURSO_OPENFOAM/PRUEBA_1/tubo
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0.3

Reading physicalProperties

Reading field p

Reading field U

Reading/calculating face flux field phi


Starting time loop

Time = 0.35s

Courant Number mean: 17.0316 max: 253.714
#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3 Foam::symGaussSeidelSmoother::smooth(Foam::word const&, Foam::Field<double>&, Foam::lduMatrix const&, Foam::Field<double> const&, Foam::FieldField<Foam::Field, double> const&, Foam::UPtrList<Foam::lduInterfaceField const> const&, unsigned char, int) at ??:?
#4 Foam::symGaussSeidelSmoother::smooth(Foam::Field<d ouble>&, Foam::Field<double> const&, unsigned char, int) const at ??:?
#5 Foam::smoothSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:?
#6 ? in "/opt/openfoam10/platforms/linux64GccDPInt32Opt/bin/icoFoam"
#7 ? in "/opt/openfoam10/platforms/linux64GccDPInt32Opt/bin/icoFoam"
#8 ? in "/opt/openfoam10/platforms/linux64GccDPInt32Opt/bin/icoFoam"
#9 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#10 ? in "/opt/openfoam10/platforms/linux64GccDPInt32Opt/bin/icoFoam"
Floating point exception (core dumped)







And I do not have any idea about where can be the error.


The mesh is ok and I have checked it.


Its about a curved tube where water flows


Could you help me about finding the error?


Thank you in advance, I am learning and I really consider your help
Saralorenzo is offline   Reply With Quote

Reply


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
VELOCITY vs VELOCITY IN STN FRAME vs RELATIVE VELOCITY everest20 FLUENT 1 July 13, 2015 08:35
How to apply velocity profile at inlet Sam CFX 12 April 1, 2012 06:52
Fluent UDF load and apply inlet velocity b.c. Knut Lehmann Main CFD Forum 2 June 29, 2007 04:53
Velocity Under-relaxation in SIMPLE type methods Matt U. Main CFD Forum 6 July 4, 2005 05:29
what the result is negatif pressure at inlet chong chee nan FLUENT 0 December 29, 2001 05:13


All times are GMT -4. The time now is 08:39.