|
[Sponsors] |
Help-How to reach the goal in my BC,what's the error? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 13, 2009, 03:15 |
Help-How to reach the goal in my BC,what's the error?
|
#1 |
Member
jingjing
Join Date: Mar 2009
Location: shanghai,China
Posts: 30
Rep Power: 17 |
I have to write a new boundary condition derived from the " mixed "type. The goal is to set the velocity at the boundary as follow:
The following sentences must have some error that I could not found out: Code:
const labelList patchCells = this->patch().faceCells(); scalar UMaker(0); UMaker=cos(omega_*db().time().value()); forAll(patchCells,i) { this->refValue()[i]= vector(UMaker,0.0,0.0); this->refGrad()[i] = vector(0.0,0.0,0.0); this->valueFraction()[i] = 0.0; } gradientInternalCoeffs cannot be called for a genericFvPatchField (actual type waveMakerVelocity) on patch inlet of field U in file "/home/jingjing/OpenFOAM/jingjing-1.5/run/othercases/surfacewaveBC/waveBC2/linearWave/0/U" 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 692. FOAM exiting why??? about the second goal: Can I fetch the vertical velocity on the cells next to the patch like this: Code:
const tmp< Field<vector> >& refUy=this->patchInternalField(); forAll(patchCells,i) { Uy=refUy()[patchCells[i]].y(); ... If it's not correct.What's the correct expression for the second goal? Any help will be appreciated!!! |
|
October 13, 2009, 08:01 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
BTW: another possibility would be to prototype the boundary condition in groovyBC. internalField() would get you the internal values of a field |
||
October 13, 2009, 10:21 |
There may be other reasons
|
#3 |
Member
jingjing
Join Date: Mar 2009
Location: shanghai,China
Posts: 30
Rep Power: 17 |
Hi gschaider,
I have examined it carefully.About the link problem: after " wmake libso" , my BC became a lib like any other standard BCs in FOAM. In this situation,if the BC has no error, it will be known by the solver. I have implemented other non-standard BC well in this way.So it may be not the link problem but the error from my BC code. BWT, in my version (1.5), the method "load the binary as a plugin (libs in controlDict)" doesn't work .I don't know why The typeName in the case file 0/U is as the same as that in my BC code. So I still don't know why the solver cann't know my BC.-----where is the error in my BC? maybe for the second goal ,I can use " Uy=internalField()[patchCells[i]].y(); "But that is not the key point. Thanks for any help! Last edited by zhajingjing; October 14, 2009 at 04:26. |
|
October 14, 2009, 04:59 |
this is my BC code
|
#4 |
Member
jingjing
Join Date: Mar 2009
Location: shanghai,China
Posts: 30
Rep Power: 17 |
Hello everyone,
the following is my BC and a waveTank case,if you are interested in my problem,you can have a look and try .Thank you jingjing Last edited by zhajingjing; October 14, 2009 at 10:57. |
|
October 14, 2009, 15:31 |
a foolish mistake!
|
#5 |
Member
jingjing
Join Date: Mar 2009
Location: shanghai,China
Posts: 30
Rep Power: 17 |
I'm so sorry that I make a foolish mistake-----I forgot to add the BC lib to the solver's makefile and recompile the solver. I used a non-standard BC successfully long time ago,so I forgot the correct way of linking a new BC to a solver.
I apologize for wasting your time. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compile problem | ivanyao | OpenFOAM Running, Solving & CFD | 1 | October 12, 2012 10:31 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |
Compiling problems with hello worldC | fw407 | OpenFOAM Installation | 21 | January 6, 2008 18:38 |
DecomposePar links against liblamso0 with OpenMPI | jens_klostermann | OpenFOAM Bugs | 11 | June 28, 2007 18:51 |
user subroutine error | CFDUSER | CFX | 2 | December 9, 2006 07:31 |