CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How can I update the boundary condition for a field using another field value? (https://www.cfd-online.com/Forums/openfoam-solving/162034-how-can-i-update-boundary-condition-field-using-another-field-value.html)

h_fathi November 2, 2015 03:39

How can I update the boundary condition for a field using another field value?
 
Hi dear Foamers I need to set a boundary condition in my case for H2O. The gradient of concentration of H2O changes by time with the changes of concentration of O2. So the Gradient should be updated each time step according to X_O2. I used groovyBC for this type of BC. But nothing happened and the gradient for X_H2O is uniform zero. The BC is following:
------------------------
dimensions [0 0 0 0 0 0 0];
internalField uniform 0.0;
boundaryField
{
Agglomerates
{
type groovyBC;
gradientExpression "dX_H2O/dx";
variable "dX_H2O/dx{Agglomerates}=0.5*X_O2";
value uniform 0;
fractionExpression "0";
}
}
-------------------

After solution:

-------------------
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
Agglomerates
{
type groovyBC;
refValue uniform 0;
refGradient uniform 0;
valueFraction uniform 1;
value uniform 0;
valueExpression "0";
gradientExpression "dX_H2O/dx";
fractionExpression "0";
evaluateDuringConstruction 0;
variables "";
timelines ( );
lookuptables ( );
}
}

---------------------------

And the X_H2O on agglomerates boundary and its gradient is zero while the X_O2 is not zero on this boundary. :eek:

Please help me to find an appropriate B.C. for X_H2O to update its gradient on special boundary (agglomerates) for each time step related to X_O2 (which is another field object). :confused:

Thank you soooo much


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