以前没学过c+,这几天看了看琢磨一下,
最后我是这样设置的
INLET
{
type codedFixedValue;
value uniform (0 0 0);
name IN;
code
#{
const vectorField& Cf = patch().Cf();
vectorField& field = *this;
forAll(Cf,faceI)
{
if( Cf[faceI].z()<300)
{
field[faceI] = vector(20*pow((Cf[faceI].z()/10), 0.15), 0, 0);
}else{
field[faceI] = vector(30, 0, 0);
}
}
#};