Exemplo n.º 1
0
bool CNSVariable::SetPrimVar_Compressible(double eddy_visc, double turb_ke, CFluidModel *FluidModel) {
	unsigned short iVar;
  bool check_dens = false, check_press = false, check_sos = false, check_temp = false, RightVol = true;
  
  
  SetVelocity();   // Computes velocity and velocity^2
  double density = GetDensity();
  double staticEnergy = GetEnergy()-0.5*Velocity2 - turb_ke;

  /* check will be moved inside fluid model plus error description strings*/
  FluidModel->SetTDState_rhoe(density, staticEnergy);

  check_dens = SetDensity();
  check_press = SetPressure(FluidModel->GetPressure());
  check_sos = SetSoundSpeed(FluidModel->GetSoundSpeed2());
  check_temp = SetTemperature(FluidModel->GetTemperature());
  
  /*--- Check that the solution has a physical meaning ---*/
  
  if (check_dens || check_press || check_sos || check_temp) {
    
    /*--- Copy the old solution ---*/
    
    for (iVar = 0; iVar < nVar; iVar++)
      Solution[iVar] = Solution_Old[iVar];
    
    /*--- Recompute the primitive variables ---*/
    
    SetVelocity();   // Computes velocity and velocity^2
	double density = GetDensity();
	double staticEnergy = GetEnergy()-0.5*Velocity2 - turb_ke;
	/* check will be moved inside fluid model plus error description strings*/
	FluidModel->SetTDState_rhoe(density, staticEnergy);

	check_dens = SetDensity();
	check_press = SetPressure(FluidModel->GetPressure());
	check_sos = SetSoundSpeed(FluidModel->GetSoundSpeed2());
	check_temp = SetTemperature(FluidModel->GetTemperature());
    
    RightVol = false;
    
  }
  
  /*--- Set enthalpy ---*/
  
	SetEnthalpy();                                  // Requires pressure computation.
  
  /*--- Set laminar viscosity ---*/
  
	SetLaminarViscosity(FluidModel->GetLaminarViscosity(FluidModel->GetTemperature(), GetDensity()));
  
  /*--- Set eddy viscosity ---*/
  
  SetEddyViscosity(eddy_visc);
  
  return RightVol;
  
}
Exemplo n.º 2
0
bool CNSVariable::SetPrimVar_Compressible(double eddy_visc, double turb_ke, CConfig *config) {
	unsigned short iVar;
  bool check_dens = false, check_press = false, check_sos = false, check_temp = false, RightVol = true;
  
  double Gas_Constant = config->GetGas_ConstantND();
	double Gamma = config->GetGamma();
  
  SetVelocity();                                  // Computes velocity and velocity^2
  check_dens = SetDensity();                      // Check the density
	check_press = SetPressure(Gamma, turb_ke);      // Requires velocity2 computation.
	check_sos = SetSoundSpeed(Gamma);               // Requires pressure computation.
	check_temp = SetTemperature(Gas_Constant);      // Requires pressure computation.
  
  /*--- Check that the solution has a physical meaning ---*/
  
  if (check_dens || check_press || check_sos || check_temp) {
    
    /*--- Copy the old solution ---*/
    
    for (iVar = 0; iVar < nVar; iVar++)
      Solution[iVar] = Solution_Old[iVar];
    
    /*--- Recompute the primitive variables ---*/
    
    SetVelocity();
    check_dens = SetDensity();
    check_press = SetPressure(Gamma, turb_ke);
    check_sos = SetSoundSpeed(Gamma);
    check_temp = SetTemperature(Gas_Constant);
    
    RightVol = false;
    
  }
  
  /*--- Set enthalpy ---*/
  
	SetEnthalpy();                                  // Requires pressure computation.
  
  /*--- Set laminar viscosity ---*/
  
	SetLaminarViscosity(config);                    // Requires temperature computation.
  
  /*--- Set eddy viscosity ---*/
  
  SetEddyViscosity(eddy_visc);
  
  return RightVol;
  
}
Exemplo n.º 3
0
void XFunctions::ReadConfigurationValues() 
{
// Read parameter from stored configuration
   bool   bValue;
   double dValue;
   AFSampleCount lValue;
   
   wxString path;
   path.Printf(wxT("/Aurora/XFunctions/FftSize"));
   if(m_pAuroraCfg->Read(path, &lValue))  SetFFTLength(lValue);
   path.Printf(wxT("/Aurora/XFunctions/WindowType"));
   if(m_pAuroraCfg->Read(path, &lValue))  SetWindowType(int(lValue));
   
   path.Printf(wxT("/Aurora/XFunctions/XFunctionType"));
   if(m_pAuroraCfg->Read(path, &lValue))  SetXFunctionType(int(lValue));
   
   path.Printf(wxT("/Aurora/XFunctions/ProbeFreeField"));
   if(m_pAuroraCfg->Read(path, &bValue))  SetProbeFreeField(bValue);
   path.Printf(wxT("/Aurora/XFunctions/ProbeRigidTerminated"));
   if(m_pAuroraCfg->Read(path, &bValue))  SetProbeRigidTerminated(bValue);
   path.Printf(wxT("/Aurora/XFunctions/SoundSpeed"));
   if(m_pAuroraCfg->Read(path, &dValue))  SetSoundSpeed(dValue);
   path.Printf(wxT("/Aurora/XFunctions/ProbeMicDistance"));
   if(m_pAuroraCfg->Read(path, &dValue))  SetProbeDistance(dValue);
   path.Printf(wxT("/Aurora/XFunctions/ProbeMaxFreq"));
   if(m_pAuroraCfg->Read(path, &dValue))  SetProbeMaxFreq(dValue);

   path.Printf(wxT("/Aurora/XFunctions/FollowingFilter"));
   if(m_pAuroraCfg->Read(path, &bValue))  SetFollowingFilter(bValue);
   path.Printf(wxT("/Aurora/XFunctions/FollowingBandwidth"));
   if(m_pAuroraCfg->Read(path, &dValue))  SetFollowingBandwidth(dValue);
   
   path.Printf(wxT("/Aurora/XFunctions/Normalize"));
   if(m_pAuroraCfg->Read(path, &bValue))  SetNormalize(bValue);
   path.Printf(wxT("/Aurora/XFunctions/ShiftToHalfWindow"));
   if(m_pAuroraCfg->Read(path, &bValue))  SetShiftToHalfWindow(bValue);
   path.Printf(wxT("/Aurora/XFunctions/CoherenceWeighting"));
   if(m_pAuroraCfg->Read(path, &bValue))  SetCoherenceWeighting(bValue);
   path.Printf(wxT("/Aurora/XFunctions/HilbertTransform"));
   if(m_pAuroraCfg->Read(path, &bValue))  SetHilbertTransform(bValue);
   path.Printf(wxT("/Aurora/XFunctions/TimeReversal"));
   if(m_pAuroraCfg->Read(path, &bValue))  SetTimeReversal(bValue);
   path.Printf(wxT("/Aurora/XFunctions/SaveMultispectrum"));
   if(m_pAuroraCfg->Read(path, &bValue))  SetSaveMultispectrum(bValue);
   path.Printf(wxT("/Aurora/XFunctions/DiracPulse"));
   if(m_pAuroraCfg->Read(path, &bValue))  SetDiracPulse(bValue);
   
   path.Printf(wxT("/Aurora/XFunctions/TriggerLevel"));
   if(m_pAuroraCfg->Read(path, &dValue))  SetTriggerLevel(dValue);
}