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

How can i ramp function for inlet

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

Like Tree1Likes
  • 1 Post By Tobermory

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 24, 2024, 18:57
Default How can i ramp function for inlet
  #1
New Member
 
Join Date: Dec 2024
Posts: 11
Rep Power: 3
kendinemühendis is on a distinguished road
How can i make ramp function for inlet? File etc.
kendinemühendis is offline   Reply With Quote

Old   December 26, 2024, 13:50
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 869
Rep Power: 19
Tobermory will become famous soon enough
Try something like uniformFixedValue, which allows a tabular input. If that's not what you are after, then you'll need to give us some more details on what you are trying to achieve ...
kendinemühendis likes this.
Tobermory is offline   Reply With Quote

Old   December 27, 2024, 12:38
Default
  #3
New Member
 
Join Date: Dec 2024
Posts: 11
Rep Power: 3
kendinemühendis is on a distinguished road
I want to create a speed value that varies with time.

For example;


time = 0 sec -> U (10 0 10)
time = 1 sec -> U ( 200 0 200 )

U speed will increase as a ramp function within 1 second. I'm drawing a graph as an example.

[IMG] https://resimlink.com/XmHvws13D [/IMG]

Last edited by kendinemühendis; December 27, 2024 at 17:01. Reason: images
kendinemühendis is offline   Reply With Quote

Old   December 28, 2024, 08:24
Default
  #4
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 869
Rep Power: 19
Tobermory will become famous soon enough
Try:

Code:
inlet {
    type                 uniformFixedValue;
    uniformValue    table
                           (
                              (0   (10 0 10))
                              (1   (200 0 200))
                           );
}
where "inlet" is the boundary patch name.
Tobermory is offline   Reply With Quote

Old   December 28, 2024, 09:06
Default
  #5
New Member
 
Ata
Join Date: Jun 2020
Posts: 3
Rep Power: 7
foldandfly is on a distinguished road
Alternatively, you can use a coded function within the U file:

Code:
inlet
{
        type            codedFixedValue;
        value           uniform (10 0 10);
        redirectType myFunction; // This specifies a name for the coded boundary condition
        code
        #{
            const scalar t = this->db().time().value();    // Current time
            const scalar rampDuration = 1.0;   // Duration for ramping (seconds)
            const scalar amplitude = 190;      // Amplitude of ramp function
            const scalar uInitial = 10;      // Velocity at t=0
        
            scalar ramp = min(t / rampDuration, 1.0); // Gradual ramp
            vector U_inlet = (uInitial + (ramp* amplitude)) * vector(1, 0, 1);
        
            operator==(U_inlet); // Apply velocity
        #};
}
foldandfly is offline   Reply With Quote

Old   December 28, 2024, 11:54
Default
  #6
New Member
 
Join Date: Dec 2024
Posts: 11
Rep Power: 3
kendinemühendis is on a distinguished road
Thank you! This worked but in the U file "internalField uniform (485.79 0 176.81); " I am having problems with this part. When I write "internalField uniform (450 0 150);" the analysis is solved, but when I write (485.79 0 176.81) it is not solved. What do you think could be the reason? Thank you very much.

Quote:
Originally Posted by Tobermory View Post
Try:

Code:
inlet {
    type                 uniformFixedValue;
    uniformValue    table
                           (
                              (0   (10 0 10))
                              (1   (200 0 200))
                           );
}
where "inlet" is the boundary patch name.
kendinemühendis is offline   Reply With Quote

Old   December 28, 2024, 11:56
Default
  #7
New Member
 
Join Date: Dec 2024
Posts: 11
Rep Power: 3
kendinemühendis is on a distinguished road
Thank you! I will try

Quote:
Originally Posted by foldandfly View Post
Alternatively, you can use a coded function within the U file:

Code:
inlet
{
        type            codedFixedValue;
        value           uniform (10 0 10);
        redirectType myFunction; // This specifies a name for the coded boundary condition
        code
        #{
            const scalar t = this->db().time().value();    // Current time
            const scalar rampDuration = 1.0;   // Duration for ramping (seconds)
            const scalar amplitude = 190;      // Amplitude of ramp function
            const scalar uInitial = 10;      // Velocity at t=0
        
            scalar ramp = min(t / rampDuration, 1.0); // Gradual ramp
            vector U_inlet = (uInitial + (ramp* amplitude)) * vector(1, 0, 1);
        
            operator==(U_inlet); // Apply velocity
        #};
}
kendinemühendis is offline   Reply With Quote

Reply

Tags
function, openfoam, ramp

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
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 12:04
compressible flow in turbocharger riesotto OpenFOAM 50 May 26, 2014 02:47
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 10:56
Compilation errors in ThirdPartymallochoard feng_w OpenFOAM Installation 1 January 25, 2009 07:59
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 21:50


All times are GMT -4. The time now is 05:18.