00001
00002
00003 #ifndef AMROC_PROBLEM_H
00004 #define AMROC_PROBLEM_H
00005
00006 #define DIM 2
00007
00008 #include "LBMProblem.h"
00009 #include "LBMD2Q9.h"
00010
00011 typedef double DataType;
00012 typedef LBMD2Q9<DataType> LBMType;
00013
00014 #define OWN_AMRSOLVER
00015 #include "LBMStdProblem.h"
00016 #include "LBMFileExactSolution.h"
00017
00018 class SolverSpecific :
00019 public AMRPreAdaptSolver<MicroType,FixupType,FlagType,DIM> {
00020 typedef AMRPreAdaptSolver<MicroType,FixupType,FlagType,DIM> base;
00021 typedef MicroType::InternalDataType DataType;
00022 public:
00023 SolverSpecific(IntegratorSpecific& integ,
00024 base::initial_condition_type& init,
00025 base::boundary_conditions_type& bc) : base(integ, init, bc) {
00026 SetLevelTransfer(new LBMF77LevelTransfer<LBMType,DIM>(integ.Scheme(), f_prolong, f_restrict));
00027 SetFileOutput(new SchemeFileOutput<LBMType,DIM>(integ.Scheme()));
00028 SetFixup(new FixupSpecific(integ.Scheme()));
00029 SetFlagging(new FlaggingSpecific(*this,integ.Scheme()));
00030 SetExactSolution(new LBMF77FileExactSolution<LBMType,DIM>(integ.Scheme(),f_prolong,f_restrict));
00031 }
00032
00033 ~SolverSpecific() {
00034 delete _LevelTransfer;
00035 delete _Flagging;
00036 delete _Fixup;
00037 delete _FileOutput;
00038 delete _ExactSolution;
00039 }
00040
00041 virtual void SetupData() {
00042 base::SetupData();
00043 base::NAMRTimeSteps = 1;
00044 base::AdaptBndTimeInterpolate = 0;
00045 base::Step[0].LastTime = 1.e37;
00046 base::Step[0].VariableTimeStepping = -1;
00047 base::Step[0].dtv[0] = ((LBMIntegrator<LBMType,DIM> &)Integrator_()).LBM().TimeScale();
00048
00049 LBMType &lbm = (LBMType &)((LBMIntegrator<LBMType,DIM> &)Integrator_()).LBM();
00050 DataType u_avg_p = ((LBMBoundaryConditions<LBMType,DIM> &)BoundaryConditions_()).Side(3).aux[0];
00051 BBox wb = base::GH().wholebbox();
00052 DCoords lc = base::GH().worldCoords(wb.lower(),wb.stepsize());
00053 DCoords uc = base::GH().worldCoords(wb.upper()+wb.stepsize(),wb.stepsize());
00054 DataType l0_p=uc(0)-lc(0);
00055 DataType omega = lbm.Omega(lbm.TimeScale());
00056 double Re_p=u_avg_p*l0_p/lbm.GasViscosity();
00057 double Re_lbm=(u_avg_p/lbm.VelocityScale())*(l0_p/lbm.LengthScale())/lbm.LatticeViscosity(omega);
00058 std::cout << "l0_p=" << l0_p << " u_avg_p=" << u_avg_p
00059 << " Re_p=" << Re_p << " Re_lbm=" << Re_lbm << std::endl;
00060 assert(std::fabs(Re_p-Re_lbm)<DBL_EPSILON*LB_FACTOR);
00061 }
00062 };