how to use the 'calculated' boundary condition
hello everyone
I want to solve a pressure Poisson equation with boundary conditions of value calculated on the last step. the P input file I set is as follow: dimensions [0 2 2 0 0 0 0]; internalField uniform 0; boundaryField { IN { type zeroGradient; } OUT { type zeroGradient; } SIDE { type calculated; } } But I get the following error: FOAM FATAL ERROR: gradientInternalCoeffs cannot be called for a calculatedFvPatchField on patch outflow of field p in file "/home/lg88/mfmFoam/0/p" You are probably trying to solve for a field with a default boundary condition. From function calculatedFvPatchField<Type>::gradientInternalCoef fs() const in file /opt/openfoam210/src/finiteVolume/lnInclude/calculatedFvPatchField.C at line 187. Does anybody know how to use this boundary condition? where can i find similar tutorials? Thank you very much! lg88 
Quote:
So calculated only makes sense in fields that OF wrote but not as a specification for a physical BC (that's why its in no tutorial) 
Hi
But in the userguide, the description of type 'calculated' is 'boundary condition phi derived from other fields'. now I want to set Dirichlet boundary condition for P,but the boundary value will changes with the time.I need to use the last step value of field P1 as the next timestep boundary value of P.So I feel the type 'calculated' is my best choice.But it always occur the error I said above. Does anyone can give me some suggestions? Thank you very much! lg88 
Quote:
If you don't believe me have a look at the source of the calculatedBC. THere is hardly any calculation going on. "calculated" stands for "has been calculated" not "will be calculated" Quote:

Hi
Thank you for your quick reply!Now I know that 'calculated' is not my need.I saw a thread here:http://www.cfdonline.com/Forums/ope...stepones.html Mybe It is what I want to express. What I really want to do is using the old time step value of P at SIDE to construct a "new" P for the new time step at the same patch. So I think function oldTime() is my need? but I don'k know what kind of boundary condition should I use? And I am not sure whether OpenFOAM1.6ext contain the function? Thank you very much lg88 
Hi
When I set my P input file as:  dimensions [0 2 2 0 0 0 0]; internalField uniform 0; boundaryField { IN { type zeroGradient; } OUT { type zeroGradient; } SIDE { type groovyBC; valueExpressions "P@SIDE=oldTime(P@SIDE)"; value uniform 0; } } I get the following error: FOAM FATAL ERROR: gradientInternalCoeffs cannot be called for a genericFvPatchField (actual type groovyBC) on patch UB of field P in file "/home/lg88/FAM_FVMtutorials/0/P" You are probably trying to solve for a field with a generic boundary condition. From function genericFvPatchField<Type>::gradientInternalCoeffs( ) const in file fields/fvPatchFields/basic/generic/genericFvPatchField.C at line 782. Do you know what it means? waiting for you reply! Thank you very much! lg88 
Quote:
Concerning your boundary condition:  oldTime is in my opinion unnecessary  your valueexpression won't work. You're mixing the valueExpression and variables here  the notation of the remote variables is "old school". The one in swak is different Quote:

Hello
I have loaded and compiled the groovyBClib successfully.Then add libs ( "libgroovyBC.so" ) ; to the system/controlDict of my case.And it run fluently without errors I mentioned above.But I didn't get my expected result.So I think I haven't set the right boundary condition. What I really want to do is using the old time step value of P at SIDE as a "new" P boundary value at the same patch for the new time step to solve P.Can you tell me what kind of boundary condition should I use ?And if groovyBC is right for me ,could you tell me how to write it?I have spend time reading the examples in groovyBC,but I can't come up with any ideas. Thank you in advance! lg88 
Quote:
IF the solver stores the old time values then oldTime(p) gives you the previous value of p. If p hasn't been solved for yet during that timestep then p and oldTime(p) are the same. So if your valueExpression says "p" it should have the same meaning. Anyway. Only application for oldTime(p) I see is if you want to get some kind of (under)relaxation. 
chtMultiRegionFoam
Quote:
i have a question about this calculated boundary condition. in chtMultiRegionFoam case p_rgh is specified as buoyant pressure and p as calculated. i want to know how p_rgh is calculated by user, and how p is calculated by processor, if p_rgh is dynamic pressure why it is specified although velocity is input. thanks in advance, Ahmed 
All times are GMT 4. The time now is 03:19. 