solver中用p和T更新h
-
各位好,
最近在修改一个solver.
原来的solver中,是用:volScalarField& h = thermo.h();
建立了h场,然后在求解前后:
U.correctBoundaryConditions(); p.correctBoundaryConditions(); h.correctBoundaryConditions(); SOLVING.... U.correctBoundaryConditions(); p.correctBoundaryConditions(); h.correctBoundaryConditions(); thermo.correct();
由于此求解器在h.correctBoundaryConditions();出现了问题,我想能先组建T场,然后再用T场去更新thermo,然后再更新h场?我想的是如下:
Info<< "Allocating field T\n" << endl; volScalarField T ( IOobject ( "T", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), thermo.T() ); U.correctBoundaryConditions(); p.correctBoundaryConditions(); T.correctBoundaryConditions(); thermo.correct(); SOLVING.... U.correctBoundaryConditions(); p.correctBoundaryConditions(); h.correctBoundaryConditions(); //先更新h, thermo.correct(); //用更新后的h去更新thermo T.correctBoundaryConditions();//再更新T
现在如果按照我这样做的话,还是有问题的,不知道问题错在哪儿?
谢谢各位 !Janry