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

Problem with velocity profile varying in time

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 9, 2022, 01:33
Default Problem with velocity profile varying in time
  #1
New Member
 
Mexico CIty
Join Date: Jul 2022
Posts: 1
Rep Power: 0
André Silva is on a distinguished road
Hi everybody, im a postgraduate student currently working with openfoam. I have a problem and i can't figure how to solve it, i have this velocity profile,


Code:
    inlet_profile
    {
        type            codedFixedValue;
        value           uniform (0 0 0);
        name   parabolicProfile;
        
            code
            #{                
                const fvPatch& boundaryPatch = patch(); 
                const vectorField& Cf = boundaryPatch.Cf(); 
                vectorField& field = *this; 

	        scalar t = this->db().time().value();
	        forAll(Cf, faceI)
	        {
	           field[faceI] = vector (sin(t*3.141592/0.2)*0.8*(0.5-0.5*tanh(10.*((200.0*(sqrt(pow(Cf[faceI].y(),2)+pow(Cf[faceI].z(),2))))-1.0))) ,0,0);
	        }
            #};
        
    }
as you can see, my profile varies in time (sine function) but I don't know how to "change" this dependence after I arrive certain value, what I want to do is when I arrive to time=0.2[sec] change the profile to another one ( for example for t>0.2[sec] change to U=(0,0,0) and continue the simulation), I think I need to use an IF statement, but I don't know how to do it.

Thank you
André Silva 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
Time Varying Velocity Input MFWilliams OpenFOAM Running, Solving & CFD 0 January 12, 2022 14:15
Convergence problem of OF WUYing OpenFOAM Running, Solving & CFD 2 September 20, 2021 10:09
Velocity profile inlet varying with z axis and time HalcyonToast FLUENT 1 October 27, 2020 19:29
plot over time fferroni OpenFOAM Post-Processing 7 June 8, 2012 07:56
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 18:07


All times are GMT -4. The time now is 20:03.