CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   updating boundary condition after one iteration and permanently (https://www.cfd-online.com/Forums/openfoam-programming-development/189576-updating-boundary-condition-after-one-iteration-permanently.html)

babakflame June 22, 2017 22:19

updating boundary condition after one iteration and permanently
 
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?

arjun June 22, 2017 22:58

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.

babakflame June 22, 2017 23:15

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


All times are GMT -4. The time now is 16:37.