CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Unsteady function for UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 12, 2008, 13:02
Default Unsteady function for UDF
  #1
Sandilya Garimella
Guest
 
Posts: n/a
Hello All I am trying to solve for time varying electric potential for the potential equation ?(i.e) poisson's equation the unsteady from is helmholtz equation

[d^2 /(dt)^2] (phi) + grad^2 (phi) = source

I discretized the unsteady term (which is double derivative in time) using backward differencing and separated the terms into two terms as given in manual

Following this I wrote a simple UDF as given below

DEFINE_UDS_UNSTEADY(unsteady_function,c,t,i,apu,su )

{

real vol;

real delt;

real time;

real phi1;

real phi2;

vol = C_VOLUME(c,t);

delt = CURRENT_TIMESTEP;

time = CURRENT_TIME;

if(i==0)

{

phi1 = C_STORAGE_R(c,t,SV_UDSI_M1(i)); /* value of phi at (n-1) time step */

if(time<5.0e-6)

{

phi2 = 0;

}

else

{

phi2 = C_STORAGE_R(c,t,SV_UDSI_M2(i)); /* value of phi at (n-2) time step */

}

/* C_UDSI_M2(c,t,i);*/

*apu = (mu * epsilon * vol) / (delt * delt);

*su = (-2 * phi1 + phi2 )*mu * epsilon * vol / (delt * delt);

}

}

But when I run after hooking the UDF, till 5.0e-6 seconds the transient solutions converges.

But when it has to access the (n-2) time step term then the there is an error "ACCESS VIOLATION"

Can anyone help me to figure out if there is an error

Error:

FLUENT received fatal signal (ACCESS_VIOLATION)

1. Note exact events leading to error.

2. Save case/data under new name.

3. Exit program and restart to continue.

4. Report error to your distributor.

Error Object: ()

Can anyone help me to figure out if there is an error
  Reply With Quote

Old   August 1, 2015, 09:58
Default resolved
  #2
New Member
 
Gylles
Join Date: Aug 2015
Posts: 1
Rep Power: 0
gylles is on a distinguished road
You should go: Solve --> Solution Methods --> Transient Formulation -->Second Order Implicit (on).

Good luck!!






Quote:
Originally Posted by Sandilya Garimella
;149133
Hello All I am trying to solve for time varying electric potential for the potential equation ?(i.e) poisson's equation the unsteady from is helmholtz equation

[d^2 /(dt)^2] (phi) + grad^2 (phi) = source

I discretized the unsteady term (which is double derivative in time) using backward differencing and separated the terms into two terms as given in manual

Following this I wrote a simple UDF as given below

DEFINE_UDS_UNSTEADY(unsteady_function,c,t,i,apu,su )

{

real vol;

real delt;

real time;

real phi1;

real phi2;

vol = C_VOLUME(c,t);

delt = CURRENT_TIMESTEP;

time = CURRENT_TIME;

if(i==0)

{

phi1 = C_STORAGE_R(c,t,SV_UDSI_M1(i)); /* value of phi at (n-1) time step */

if(time<5.0e-6)

{

phi2 = 0;

}

else

{

phi2 = C_STORAGE_R(c,t,SV_UDSI_M2(i)); /* value of phi at (n-2) time step */

}

/* C_UDSI_M2(c,t,i);*/

*apu = (mu * epsilon * vol) / (delt * delt);

*su = (-2 * phi1 + phi2 )*mu * epsilon * vol / (delt * delt);

}

}

But when I run after hooking the UDF, till 5.0e-6 seconds the transient solutions converges.

But when it has to access the (n-2) time step term then the there is an error "ACCESS VIOLATION"

Can anyone help me to figure out if there is an error

Error:

FLUENT received fatal signal (ACCESS_VIOLATION)

1. Note exact events leading to error.

2. Save case/data under new name.

3. Exit program and restart to continue.

4. Report error to your distributor.

Error Object: ()

Can anyone help me to figure out if there is an error
gylles 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
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field lakeat OpenFOAM Community Contributions 58 December 23, 2021 02:36
-Xlinker --add-needed -Xlinker --no-as-needed NH1994 OpenFOAM Programming & Development 7 December 31, 2014 10:24
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 12:21
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 10:23
unsteady Bernoulli equation and wagner function. Afungchui Main CFD Forum 0 March 14, 2005 11:50


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