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

updating boundary condition after one iteration and permanently

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 22, 2017, 22:19
Default updating boundary condition after one iteration and permanently
  #1
Senior Member
 
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 16
babakflame is on a distinguished road
Dear Fellows

I want to implement a boundary condition in a somehow unique way.

I want to start a simulation with a high value called \varphi_1.
Immediately, after 1 iteration, I want to put this relation as the boundary condition:
\varphi = \varphi_1 + a \frac{d \varphi}{d n}.

Actually, that 1 iteraion is needed to calculate \frac{d \varphi}{d n} in the high value \varphi_1 and then modifying boundary condition to a much smaller value. Here, the point is that \frac{d \varphi}{d n} comes from that first iteration.

Basically, what I want to do is start a simulation with a high Dirichlet boundary condition and after first iteration, calculate surface normal gradient and find the new \varphi based on modification formula and continue simulation with new Dirichlet boundary condition. The new Dirichlet boundary condition remains intact throughout the simulation.

So, in first iteration my boundary condition is \varphi_1 and for the rest of simulation is \varphi.

Any clue how to implement it?
babakflame is offline   Reply With Quote

Old   June 22, 2017, 22:58
Default
  #2
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,285
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
I am trying to code it and most of it is done for now.

Here is my take, during the initialization of model, you first solve the poisson equation for this variable (Ue as you called it in other thread). After it is solved the field comes to be smooth. dUedn is no longer as sharp as it is in the start for cplus and cminus.

So basically in my model

init cplus, cminus from user.

using cplus and cminus, solve poisson equation for Ue to initialize it.


Iterations

1. Solve Ue poisson equation
2. Solve Cplus and Cminus transport.

This is my rough outline.
arjun is offline   Reply With Quote

Old   June 22, 2017, 23:15
Default
  #3
Senior Member
 
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 16
babakflame is on a distinguished road
Dear Arjun,

Many thanks for your reply. However, this is a new case and thats the reason I started a new thread for it.

Here, I want to do the case with high a \varphi called \varphi_1 just for 1 iteration and then modify the boundary with a new Dirichlet which comes from a modification formula.

Regards
babakflame 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



All times are GMT -4. The time now is 07:32.