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

coded fixed value with time dependent if-statement

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 12, 2022, 07:45
Default coded fixed value with time dependent if-statement
  #1
Senior Member
 
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 306
Rep Power: 6
geth03 is on a distinguished road
hi all,

i am trying to code a boundary condition for velocity with an if-statement, that should be evaluated at every iteration step:

Code:
outlet_np
    {
        type            codedFixedValue;
        value           uniform (0 0 0);
        name            ControlledFixedValue;
		
		code            
		#{
			//
                        scalar value = ..read from object registry, calculated in every time step..

			scalar actualVelocity;
			if(value <= 0.05)
			{
				actualVelocity=highVelocity;
			}else
			{
				actualVelocity=normalVelocity;
			};
			
			const vector x0(0, -1, 0);
			operator==( x0 * actualVelocity ); 
		#};
    }
unfortunately the if-statement is read at the beginning of the simulation and not updated constantly with every iteration step as i intended.

is there a way that the if-statement is evaluated at every iteration step?

cheers
geth03 is offline   Reply With Quote

Old   September 12, 2022, 10:39
Default
  #2
Senior Member
 
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 306
Rep Power: 6
geth03 is on a distinguished road
i fixed it with
operator==(a<=b? c:d)
geth03 is offline   Reply With Quote

Reply

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
AMI speed performance danny123 OpenFOAM 21 October 24, 2020 05:13
Setting up Lid driven Cavity Benchmark with 1M cells for multiple cores puneet336 OpenFOAM Running, Solving & CFD 11 April 7, 2019 01:58
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 12:08
Stuck in a Rut- interDyMFoam! xoitx OpenFOAM Running, Solving & CFD 14 March 25, 2016 08:09
plot over time fferroni OpenFOAM Post-Processing 7 June 8, 2012 08:56


All times are GMT -4. The time now is 09:28.